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
=== modified file 'CMakeLists.txt'
--- CMakeLists.txt 2010-09-18 12:19:06 +0000
+++ CMakeLists.txt 2010-10-06 17:25:57 +0000
@@ -10,7 +10,7 @@
10########### project ###############10########### project ###############
1111
12project ("cairo-dock")12project ("cairo-dock")
13set (VERSION "2.2.0-2")13set (VERSION "2.2.0-4")
1414
15add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall 15add_definitions (-std=c99 -Wstrict-prototypes -Wextra -Wwrite-strings -Wuninitialized -Werror-implicit-function-declaration) #-Wunreachable-code -Wno-unused-parameter -Wall
16if (NOT ${CMAKE_BUILD_TYPE})16if (NOT ${CMAKE_BUILD_TYPE})
1717
=== modified file 'data/default-theme/plug-ins/rendering/rendering.conf'
--- data/default-theme/plug-ins/rendering/rendering.conf 2010-08-07 01:28:23 +0000
+++ data/default-theme/plug-ins/rendering/rendering.conf 2010-10-06 17:25:57 +0000
@@ -84,13 +84,13 @@
84frame_grid=84frame_grid=
8585
86#i+[30;100] Space between columns:86#i+[30;100] Space between columns:
87simple_iconGapX=4087simple_iconGapX=50
8888
89#i+[30;100] Space between rows:89#i+[30;100] Space between rows:
90simple_iconGapY=3090simple_iconGapY=50
9191
92#e+[1;3] Max icon size:92#e+[1;3] Max icon size:
93simple_fScaleMax=1.600000000000000193simple_fScaleMax=1.600000000000000
9494
95#i+[50;1000] Sinusoidal wave radius:95#i+[50;1000] Sinusoidal wave radius:
96simple_sinW=20096simple_sinW=200
9797
=== modified file 'data/help.conf.in'
--- data/help.conf.in 2010-08-07 01:28:23 +0000
+++ data/help.conf.in 2010-10-06 17:25:57 +0000
@@ -311,10 +311,10 @@
311config_terminal = 311config_terminal =
312#X [So then, how can I remove completely the gnome-panel?]312#X [So then, how can I remove completely the gnome-panel?]
313Xremove=313Xremove=
314#> Open gconf-editor, edit the key /desktop/gnome/session/required_components_list/panel, and replace its content with "cairo-dock".314#> Open gconf-editor, edit the key /desktop/gnome/session/required_components/panel, and replace its content with "cairo-dock".
315#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).315#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).
316remove=316remove=
317#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:317#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:
318#{Tip: If this line is grayed, it's because this tip is not for you.)318#{Tip: If this line is grayed, it's because this tip is not for you.)
319widget_compiz=319widget_compiz=
320320
321321
=== modified file 'debian/changelog'
--- debian/changelog 2010-09-18 12:19:06 +0000
+++ debian/changelog 2010-10-06 17:25:57 +0000
@@ -1,3 +1,19 @@
1cairo-dock (2.2.0~4-0ubuntu1) UNRELEASED; urgency=low
2
3 * New Upstream Version (LP: #653702)
4 * Fixed a few bugs:
5 - Fixed a random crash if CD is launched much time before the WM
6 - Improved the OpenGL backend.
7 - Some Images paths were wrong
8 - Icon label text was truncated (LP: #611738)
9 - Fixed a bug when the font was too big
10 - Gauges: Add a line return in order to read all Readme file
11 - Dialogues don't respect selected font (LP: #518628)
12 * data/help.conf.in:
13 - Removed the Gnome-Panel: Used the right gconf key
14
15 -- Matthieu Baerts (matttbe) <matttbe@gmail.com> Wed, 06 Oct 2010 19:23:03 +0200
16
1cairo-dock (2.2.0~2-0ubuntu1) maverick; urgency=low17cairo-dock (2.2.0~2-0ubuntu1) maverick; urgency=low
218
3 * New Upstream Version (LP: #638527)19 * New Upstream Version (LP: #638527)
420
=== modified file 'src/cairo-dock-gui-launcher.c'
--- src/cairo-dock-gui-launcher.c 2010-09-16 01:04:13 +0000
+++ src/cairo-dock-gui-launcher.c 2010-10-06 17:25:57 +0000
@@ -285,7 +285,7 @@
285 g_free (cImagePath);285 g_free (cImagePath);
286 if (CAIRO_DOCK_IS_SEPARATOR (pIcon))286 if (CAIRO_DOCK_IS_SEPARATOR (pIcon))
287 {287 {
288 cImagePath = cairo_dock_generate_file_path (myIcons.cSeparatorImage);288 cImagePath = cairo_dock_search_image_s_path (myIcons.cSeparatorImage);
289 }289 }
290 else if (CAIRO_DOCK_IS_APPLET (pIcon))290 else if (CAIRO_DOCK_IS_APPLET (pIcon))
291 {291 {
@@ -293,7 +293,7 @@
293 }293 }
294 else294 else
295 {295 {
296 cImagePath = cairo_dock_generate_file_path (CAIRO_DOCK_DEFAULT_ICON_NAME);296 cImagePath = cairo_dock_search_image_s_path (CAIRO_DOCK_DEFAULT_ICON_NAME);
297 if (cImagePath == NULL || ! g_file_test (cImagePath, G_FILE_TEST_EXISTS))297 if (cImagePath == NULL || ! g_file_test (cImagePath, G_FILE_TEST_EXISTS))
298 {298 {
299 g_free (cImagePath);299 g_free (cImagePath);
300300
=== modified file 'src/cairo-dock-gui-simple.c'
--- src/cairo-dock-gui-simple.c 2010-09-16 01:04:13 +0000
+++ src/cairo-dock-gui-simple.c 2010-10-06 17:25:57 +0000
@@ -707,7 +707,8 @@
707static void _make_double_anim_widget (GtkWidget *pSimpleConfigWindow, GKeyFile *pKeyFile, const gchar *cGroupName, const gchar *cKeyName, const gchar *cLabel)707static void _make_double_anim_widget (GtkWidget *pSimpleConfigWindow, GKeyFile *pKeyFile, const gchar *cGroupName, const gchar *cKeyName, const gchar *cLabel)
708{708{
709 CairoDockGroupKeyWidget *myWidget = cairo_dock_gui_find_group_key_widget (pSimpleConfigWindow, cGroupName, cKeyName);709 CairoDockGroupKeyWidget *myWidget = cairo_dock_gui_find_group_key_widget (pSimpleConfigWindow, cGroupName, cKeyName);
710 g_return_if_fail (myWidget != NULL);710 if (myWidget == NULL) // peut arriver vu que en mode cairo on n'a pas "anim_hover"
711 return;
711 712
712 gsize length = 0;713 gsize length = 0;
713 gchar **cValues = g_key_file_get_string_list (pKeyFile, cGroupName, cKeyName, &length, NULL);714 gchar **cValues = g_key_file_get_string_list (pKeyFile, cGroupName, cKeyName, &length, NULL);
714715
=== modified file 'src/cairo-dock-menu.c'
--- src/cairo-dock-menu.c 2010-09-16 01:04:13 +0000
+++ src/cairo-dock-menu.c 2010-10-06 17:25:57 +0000
@@ -116,11 +116,12 @@
116 cd_message ("%s (%s)", __func__, cDockName);116 cd_message ("%s (%s)", __func__, cDockName);
117 117
118 gchar *cConfFilePath = g_strdup_printf ("%s/%s.conf", g_cCurrentThemePath, cDockName);118 gchar *cConfFilePath = g_strdup_printf ("%s/%s.conf", g_cCurrentThemePath, cDockName);
119 if (! g_file_test (cConfFilePath, G_FILE_TEST_EXISTS))119 if (! g_file_test (cConfFilePath, G_FILE_TEST_EXISTS)) // ne devrait pas arriver mais au cas ou.
120 {120 {
121 gchar *cCommand = g_strdup_printf ("cp \"%s\" \"%s\"", CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);121 cairo_dock_add_root_dock_config_for_name (cDockName);
122 /**gchar *cCommand = g_strdup_printf ("cp \"%s\" \"%s\"", CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);
122 int r = system (cCommand);123 int r = system (cCommand);
123 g_free (cCommand);124 g_free (cCommand);*/
124 }125 }
125 126
126 if (s_pRootDockConfigWindow != NULL)127 if (s_pRootDockConfigWindow != NULL)
127128
=== modified file 'src/cairo-dock.c'
--- src/cairo-dock.c 2010-09-18 12:19:06 +0000
+++ src/cairo-dock.c 2010-10-06 17:25:57 +0000
@@ -164,12 +164,29 @@
164static gboolean s_bTestComposite = TRUE;164static gboolean s_bTestComposite = TRUE;
165static gint s_iGuiMode = 0; // 0 = simple mode, 1 = advanced mode165static gint s_iGuiMode = 0; // 0 = simple mode, 1 = advanced mode
166166
167static inline void _cancel_metacity_composite (void)
168{
169 int r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false");
170}
167static void _accept_metacity_composition (int iClickedButton, GtkWidget *pInteractiveWidget, gpointer data, CairoDialog *pDialog)171static void _accept_metacity_composition (int iClickedButton, GtkWidget *pInteractiveWidget, gpointer data, CairoDialog *pDialog)
168{172{
169 if (iClickedButton == 1) // clic explicite sur "cancel"173 g_print ("%s (%d)\n", __func__, iClickedButton);
170 {174 if (iClickedButton == 1 || iClickedButton == -2) // clic explicite sur "cancel", ou Echap ou auto-delete.
171 int r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool false");175 {
172 }176 _cancel_metacity_composite ();
177 }
178 gboolean *bAccepted = data;
179 *bAccepted = TRUE; // l'utilisateur a valide son choix.
180}
181static void _on_free_metacity_dialog (gpointer data)
182{
183 gboolean *bAccepted = data;
184 g_print ("%s (%d)\n", __func__, *bAccepted);
185 if (! *bAccepted) // le dialogue s'est detruit sans que l'utilisateur n'ait valide la question => on annule tout.
186 {
187 _cancel_metacity_composite ();
188 }
189 g_free (data);
173}190}
174static void _toggle_remember_choice (GtkCheckButton *pButton, GtkWidget *pDialog)191static void _toggle_remember_choice (GtkCheckButton *pButton, GtkWidget *pDialog)
175{192{
@@ -200,17 +217,17 @@
200 g_signal_connect (G_OBJECT (pCheckBox), "toggled", G_CALLBACK(_toggle_remember_choice), pAskBox);217 g_signal_connect (G_OBJECT (pCheckBox), "toggled", G_CALLBACK(_toggle_remember_choice), pAskBox);
201 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);218 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);
202 219
203 gboolean bRememberChoice = GPOINTER_TO_INT (g_object_get_data (G_OBJECT (pAskBox), "remember"));220 gboolean bRememberChoice = gtk_toggle_button_get_active (GTK_TOGGLE_BUTTON (pCheckBox));
204 gtk_widget_destroy (pAskBox);221 gtk_widget_destroy (pAskBox); // le widget survit a un dialogue bloquant.
205 if (bRememberChoice)222 if (bRememberChoice)
206 {223 {
207 s_bTestComposite = FALSE;224 s_bTestComposite = FALSE;
208 }225 }
209 ///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));226 if (iClickedButton == 0 || iClickedButton == -1) // ok or Enter.
210 if (iClickedButton == 0 || iClickedButton == -1)
211 {227 {
212 int r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true");228 int r = system ("gconftool-2 -s '/apps/metacity/general/compositing_manager' --type bool true");
213 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);229 ///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);
230 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);
214 }231 }
215 232
216 }233 }
@@ -393,7 +410,7 @@
393 s_cLaunchCommand = sCommandString->str;410 s_cLaunchCommand = sCommandString->str;
394 g_string_free (sCommandString, FALSE);411 g_string_free (sCommandString, FALSE);
395 412
396 cd_log_init(FALSE); // no log by default.413 cd_log_init(FALSE); // warnings by default.
397 414
398 gtk_init (&argc, &argv);415 gtk_init (&argc, &argv);
399 416
@@ -543,6 +560,8 @@
543 gchar *cExtraDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_EXTRAS_DIR, NULL);560 gchar *cExtraDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_EXTRAS_DIR, NULL);
544 gchar *cThemesDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_THEMES_DIR, NULL);561 gchar *cThemesDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_THEMES_DIR, NULL);
545 gchar *cCurrentThemeDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_CURRENT_THEME_NAME, NULL);562 gchar *cCurrentThemeDirPath = g_strconcat (cRootDataDirPath, "/"CAIRO_DOCK_CURRENT_THEME_NAME, NULL);
563 gboolean bFirstLaunch = ! g_file_test (cRootDataDirPath, G_FILE_TEST_IS_DIR);
564
546 cairo_dock_set_paths (cRootDataDirPath, cExtraDirPath, cThemesDirPath, cCurrentThemeDirPath, cThemeServerAdress ? cThemeServerAdress : g_strdup (CAIRO_DOCK_THEME_SERVER));565 cairo_dock_set_paths (cRootDataDirPath, cExtraDirPath, cThemesDirPath, cCurrentThemeDirPath, cThemeServerAdress ? cThemeServerAdress : g_strdup (CAIRO_DOCK_THEME_SERVER));
547 566
548 //\___________________ On initialise le gestionnaire de docks (a faire en 1er).567 //\___________________ On initialise le gestionnaire de docks (a faire en 1er).
@@ -803,7 +822,6 @@
803 g_free (cConfFilePath);822 g_free (cConfFilePath);
804 }823 }
805 824
806 gboolean bFirstLaunch = ! g_file_test (cRootDataDirPath, G_FILE_TEST_IS_DIR);
807 if (bFirstLaunch) // tout premier lancement -> bienvenue !825 if (bFirstLaunch) // tout premier lancement -> bienvenue !
808 {826 {
809 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);827 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);
810828
=== modified file 'src/gldit/CMakeLists.txt'
--- src/gldit/CMakeLists.txt 2010-08-07 01:28:23 +0000
+++ src/gldit/CMakeLists.txt 2010-10-06 17:25:57 +0000
@@ -88,9 +88,20 @@
88 ${CMAKE_SOURCE_DIR}/src/icon-factory88 ${CMAKE_SOURCE_DIR}/src/icon-factory
89 ${CMAKE_SOURCE_DIR}/src/implementations)89 ${CMAKE_SOURCE_DIR}/src/implementations)
9090
91# Define the library
91add_library ("gldi" SHARED ${core_lib_SRCS})92add_library ("gldi" SHARED ${core_lib_SRCS})
93STRING (REGEX REPLACE "\\..*" "" SOVERSION "${VERSION}")
94set_target_properties ("gldi" PROPERTIES
95 # create *nix style library versions + symbolic links
96 VERSION ${VERSION}
97 SOVERSION ${SOVERSION}
98 # allow creating static and shared libs without conflicts
99 #CLEAN_DIRECT_OUTPUT 1
100 # avoid conflicts between library and binary target names
101 #OUTPUT_NAME ${PROJECT_NAME}
102)
92103
93# Link the executable to the librairies.104# Link the result to the librairies.
94target_link_libraries("gldi"105target_link_libraries("gldi"
95 ${PACKAGE_LIBRARIES}106 ${PACKAGE_LIBRARIES}
96 ${XEXTEND_LIBRARIES}107 ${XEXTEND_LIBRARIES}
@@ -102,6 +113,8 @@
102configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gldi.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gldi.pc)113configure_file (${CMAKE_CURRENT_SOURCE_DIR}/gldi.pc.in ${CMAKE_CURRENT_BINARY_DIR}/gldi.pc)
103install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gldi.pc DESTINATION ${libdir}/pkgconfig)114install (FILES ${CMAKE_CURRENT_BINARY_DIR}/gldi.pc DESTINATION ${libdir}/pkgconfig)
104install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libgldi.so DESTINATION ${libdir})115install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libgldi.so DESTINATION ${libdir})
116install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libgldi.so.${VERSION} DESTINATION ${libdir})
117install (FILES ${CMAKE_CURRENT_BINARY_DIR}/libgldi.so.${SOVERSION} DESTINATION ${libdir})
105118
106########### install files ###############119########### install files ###############
107120
108121
=== modified file 'src/gldit/cairo-dock-applet-manager.c'
--- src/gldit/cairo-dock-applet-manager.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-applet-manager.c 2010-10-06 17:25:57 +0000
@@ -69,18 +69,7 @@
69 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (icon->pModuleInstance->pModule->pVisitCard->cIconFilePath,69 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (icon->pModuleInstance->pModule->pVisitCard->cIconFilePath,
70 iWidth,70 iWidth,
71 iHeight);71 iHeight);
72 }72 } // 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.
73 /*if (icon->pIconBuffer != NULL && icon->pModuleInstance != NULL)
74 {
75 if (icon->pModuleInstance->pDrawContext != NULL)
76 cairo_destroy (icon->pModuleInstance->pDrawContext);
77 icon->pModuleInstance->pDrawContext = cairo_create (icon->pIconBuffer);
78 if (cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
79 {
80 cd_warning ("couldn't initialize drawing context, applet won't be reloaded !");
81 icon->pModuleInstance->pDrawContext = NULL;
82 }
83 }*/
84}73}
8574
86static gboolean _delete_applet (Icon *icon)75static gboolean _delete_applet (Icon *icon)
8776
=== modified file 'src/gldit/cairo-dock-application-facility.c'
--- src/gldit/cairo-dock-application-facility.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-application-facility.c 2010-10-06 17:25:57 +0000
@@ -141,7 +141,7 @@
141 if (pParentDock != NULL)141 if (pParentDock != NULL)
142 _cairo_dock_appli_demands_attention (pInhibitorIcon, pParentDock, bForceDemand, NULL);142 _cairo_dock_appli_demands_attention (pInhibitorIcon, pParentDock, bForceDemand, NULL);
143 }143 }
144 else if (bForceDemand) // appli pas affichee, mais on veut tout de même etre notifie.144 else if (bForceDemand) // appli pas affichee, mais on veut tout de m�me etre notifie.
145 {145 {
146 Icon *pOneIcon = cairo_dock_get_dialogless_icon (); // on prend une icone dans le main dock.146 Icon *pOneIcon = cairo_dock_get_dialogless_icon (); // on prend une icone dans le main dock.
147 if (pOneIcon != NULL)147 if (pOneIcon != NULL)
@@ -360,6 +360,7 @@
360 if (pParentDock == NULL) // alors il faut creer le sous-dock, qu'on associera soit a pSameClassIcon soit a un fake.360 if (pParentDock == NULL) // alors il faut creer le sous-dock, qu'on associera soit a pSameClassIcon soit a un fake.
361 {361 {
362 cd_message (" creation du dock pour la classe %s", icon->cClass);362 cd_message (" creation du dock pour la classe %s", icon->cClass);
363 pMainDock = cairo_dock_search_dock_from_name (pSameClassIcon->cParentDockName); // can be NULL (even if in practice will never be).
363 pParentDock = cairo_dock_create_subdock_from_scratch (NULL, icon->cClass, pMainDock);364 pParentDock = cairo_dock_create_subdock_from_scratch (NULL, icon->cClass, pMainDock);
364 }365 }
365 else366 else
@@ -432,6 +433,8 @@
432433
433CairoDock *cairo_dock_insert_appli_in_dock (Icon *icon, CairoDock *pMainDock, gboolean bUpdateSize, gboolean bAnimate)434CairoDock *cairo_dock_insert_appli_in_dock (Icon *icon, CairoDock *pMainDock, gboolean bUpdateSize, gboolean bAnimate)
434{435{
436 if (! myTaskBar.bShowAppli)
437 return NULL;
435 cd_message ("%s (%s, %d)", __func__, icon->cName, icon->Xid);438 cd_message ("%s (%s, %d)", __func__, icon->cName, icon->Xid);
436 439
437 //\_________________ On gere ses eventuels inhibiteurs.440 //\_________________ On gere ses eventuels inhibiteurs.
438441
=== modified file 'src/gldit/cairo-dock-applications-manager.c'
--- src/gldit/cairo-dock-applications-manager.c 2010-09-16 01:04:13 +0000
+++ src/gldit/cairo-dock-applications-manager.c 2010-10-06 17:25:57 +0000
@@ -217,7 +217,7 @@
217 if (!cairo_dock_is_temporary_hidden (pDock))217 if (!cairo_dock_is_temporary_hidden (pDock))
218 cairo_dock_activate_temporary_auto_hide (pDock);218 cairo_dock_activate_temporary_auto_hide (pDock);
219 }219 }
220 else220 else if (pDock->iVisibility != CAIRO_DOCK_VISI_AUTO_HIDE_ON_OVERLAP_ANY)
221 {221 {
222 if (cairo_dock_is_temporary_hidden (pDock))222 if (cairo_dock_is_temporary_hidden (pDock))
223 cairo_dock_deactivate_temporary_auto_hide (pDock);223 cairo_dock_deactivate_temporary_auto_hide (pDock);
@@ -306,21 +306,24 @@
306 {306 {
307 icon->iLastCheckTime = s_iTime;307 icon->iLastCheckTime = s_iTime;
308 icon->iStackOrder = iStackOrder ++;308 icon->iStackOrder = iStackOrder ++;
309 if ((! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (icon))) // bHideVisibleApplis est gere lors de l'insertion.309 if (myTaskBar.bShowAppli)
310 {310 {
311 cd_message (" insertion de %s ... (%d)", icon->cName, icon->iLastCheckTime);311 if ((! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (icon))) // bHideVisibleApplis est gere lors de l'insertion.
312 pParentDock = cairo_dock_insert_appli_in_dock (icon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, CAIRO_DOCK_ANIMATE_ICON);312 {
313 if (pParentDock != NULL)313 cd_message (" insertion de %s ... (%d)", icon->cName, icon->iLastCheckTime);
314 {314 pParentDock = cairo_dock_insert_appli_in_dock (icon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, CAIRO_DOCK_ANIMATE_ICON);
315 if (pParentDock->bIsMainDock)315 if (pParentDock != NULL)
316 bUpdateMainDockSize = TRUE;316 {
317 else317 if (pParentDock->bIsMainDock)
318 cairo_dock_update_dock_size (pParentDock);318 bUpdateMainDockSize = TRUE;
319 }319 else
320 }320 cairo_dock_update_dock_size (pParentDock);
321 else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.321 }
322 {322 }
323 cairo_dock_prevent_inhibated_class (icon);323 else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.
324 {
325 cairo_dock_prevent_inhibated_class (icon);
326 }
324 }327 }
325 328
326 // visibilite329 // visibilite
@@ -419,7 +422,7 @@
419 CairoDock *pDock = g_pMainDock;422 CairoDock *pDock = g_pMainDock;
420 423
421 // applis du bureau courant seulement.424 // applis du bureau courant seulement.
422 if (myTaskBar.bAppliOnCurrentDesktopOnly)425 if (myTaskBar.bAppliOnCurrentDesktopOnly && myTaskBar.bShowAppli)
423 {426 {
424 g_hash_table_foreach (s_hXWindowTable, (GHFunc) _cairo_dock_hide_show_windows_on_other_desktops, pDock);427 g_hash_table_foreach (s_hXWindowTable, (GHFunc) _cairo_dock_hide_show_windows_on_other_desktops, pDock);
425 }428 }
@@ -472,7 +475,7 @@
472 {475 {
473 icon->bIsFullScreen = bIsFullScreen;476 icon->bIsFullScreen = bIsFullScreen;
474 icon->bIsHidden = bIsHidden;477 icon->bIsHidden = bIsHidden;
475 cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, NULL);478 cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, icon);
476 }479 }
477 }480 }
478 481
@@ -509,7 +512,7 @@
509 }512 }
510 513
511 // applis minimisees seulement514 // applis minimisees seulement
512 if (myTaskBar.bHideVisibleApplis) // on insere/detache l'icone selon la visibilite de la fenetre, avec une animation.515 if (myTaskBar.bHideVisibleApplis && myTaskBar.bShowAppli) // on insere/detache l'icone selon la visibilite de la fenetre, avec une animation.
513 {516 {
514 if (bIsHidden) // se cache => on insere son icone.517 if (bIsHidden) // se cache => on insere son icone.
515 {518 {
@@ -570,7 +573,7 @@
570 icon->iNumDesktop = cairo_dock_get_xwindow_desktop (Xid);573 icon->iNumDesktop = cairo_dock_get_xwindow_desktop (Xid);
571 574
572 // applis du bureau courant seulement.575 // applis du bureau courant seulement.
573 if (myTaskBar.bAppliOnCurrentDesktopOnly)576 if (myTaskBar.bAppliOnCurrentDesktopOnly && myTaskBar.bShowAppli)
574 {577 {
575 _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.578 _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.
576 }579 }
@@ -578,7 +581,7 @@
578 // visibilite581 // visibilite
579 if (Xid == s_iCurrentActiveWindow) // c'est la fenetre courante qui a change de bureau.582 if (Xid == s_iCurrentActiveWindow) // c'est la fenetre courante qui a change de bureau.
580 {583 {
581 cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, NULL);584 cairo_dock_foreach_root_docks ((GFunc)_hide_show_if_on_our_way, icon);
582 }585 }
583 586
584 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.587 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.
@@ -633,10 +636,10 @@
633 else // elle est sur le bureau.636 else // elle est sur le bureau.
634 {637 {
635 // applis du bureau courant seulement.638 // applis du bureau courant seulement.
636 if (myTaskBar.bAppliOnCurrentDesktopOnly && icon->cParentDockName == NULL)639 if (myTaskBar.bAppliOnCurrentDesktopOnly && icon->cParentDockName == NULL && myTaskBar.bShowAppli)
637 {640 {
638 cd_message ("cette fenetre est sur le bureau courant (%d;%d)", e->x, e->y);641 cd_message ("cette fenetre est sur le bureau courant (%d;%d)", e->x, e->y);
639 gboolean bInsideDock = (icon->cParentDockName != NULL); // jamais verifie mais ca devrait etre bon.642 gboolean bInsideDock = (icon->cParentDockName != NULL);
640 if (! bInsideDock)643 if (! bInsideDock)
641 cairo_dock_insert_appli_in_dock (icon, g_pMainDock, CAIRO_DOCK_UPDATE_DOCK_SIZE, ! CAIRO_DOCK_ANIMATE_ICON);644 cairo_dock_insert_appli_in_dock (icon, g_pMainDock, CAIRO_DOCK_UPDATE_DOCK_SIZE, ! CAIRO_DOCK_ANIMATE_ICON);
642 }645 }
@@ -853,7 +856,7 @@
853856
854void cairo_dock_start_application_manager (CairoDock *pDock)857void cairo_dock_start_application_manager (CairoDock *pDock)
855{858{
856 g_return_if_fail (!s_bAppliManagerIsRunning && myTaskBar.bShowAppli);859 g_return_if_fail (!s_bAppliManagerIsRunning);
857 860
858 cairo_dock_set_overwrite_exceptions (myTaskBar.cOverwriteException);861 cairo_dock_set_overwrite_exceptions (myTaskBar.cOverwriteException);
859 cairo_dock_set_group_exceptions (myTaskBar.cGroupException);862 cairo_dock_set_group_exceptions (myTaskBar.cGroupException);
@@ -896,21 +899,24 @@
896 {899 {
897 //pIcon->fOrder = iOrder++;900 //pIcon->fOrder = iOrder++;
898 pIcon->iLastCheckTime = s_iTime;901 pIcon->iLastCheckTime = s_iTime;
899 if (! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (pIcon)) // le filtre 'bHideVisibleApplis' est gere dans la fonction d'insertion.902 if (myTaskBar.bShowAppli)
900 {903 {
901 pParentDock = cairo_dock_insert_appli_in_dock (pIcon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, ! CAIRO_DOCK_ANIMATE_ICON);904 if (! myTaskBar.bAppliOnCurrentDesktopOnly || cairo_dock_appli_is_on_current_desktop (pIcon)) // le filtre 'bHideVisibleApplis' est gere dans la fonction d'insertion.
902 //g_print (">>>>>>>>>>>> Xid : %d\n", Xid);905 {
903 if (pParentDock != NULL)906 pParentDock = cairo_dock_insert_appli_in_dock (pIcon, pDock, ! CAIRO_DOCK_UPDATE_DOCK_SIZE, ! CAIRO_DOCK_ANIMATE_ICON);
904 {907 //g_print (">>>>>>>>>>>> Xid : %d\n", Xid);
905 if (pParentDock->bIsMainDock)908 if (pParentDock != NULL)
906 bUpdateMainDockSize = TRUE;909 {
907 else910 if (pParentDock->bIsMainDock)
908 cairo_dock_update_dock_size (pParentDock);911 bUpdateMainDockSize = TRUE;
909 }912 else
910 }913 cairo_dock_update_dock_size (pParentDock);
911 else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.914 }
912 {915 }
913 cairo_dock_prevent_inhibated_class (pIcon);916 else if (myTaskBar.bMixLauncherAppli) // on met tout de meme l'indicateur sur le lanceur.
917 {
918 cairo_dock_prevent_inhibated_class (pIcon);
919 }
914 }920 }
915 }921 }
916 else922 else
@@ -1347,11 +1353,10 @@
1347 icon->pIconBuffer = cairo_dock_create_surface_from_xwindow (icon->Xid, iWidth, iHeight);1353 icon->pIconBuffer = cairo_dock_create_surface_from_xwindow (icon->Xid, iWidth, iHeight);
1348 if (icon->pIconBuffer == NULL) // certaines applis comme xterm ne definissent pas d'icone, on en met une par defaut.1354 if (icon->pIconBuffer == NULL) // certaines applis comme xterm ne definissent pas d'icone, on en met une par defaut.
1349 {1355 {
1350 cd_debug ("%s (%ld) doesn't define any icon, we set the default one.\n", icon->cName, icon->Xid);1356 cd_debug ("%s (%ld) doesn't define any icon, we set the default one.", icon->cName, icon->Xid);
1351 gchar *cIconPath = cairo_dock_generate_file_path (CAIRO_DOCK_DEFAULT_APPLI_ICON_NAME);1357 gchar *cIconPath = cairo_dock_search_image_s_path (CAIRO_DOCK_DEFAULT_APPLI_ICON_NAME);
1352 if (cIconPath == NULL || ! g_file_test (cIconPath, G_FILE_TEST_EXISTS))1358 if (cIconPath == NULL) // image non trouvee.
1353 {1359 {
1354 g_free (cIconPath);
1355 cIconPath = g_strdup (CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_DEFAULT_APPLI_ICON_NAME);1360 cIconPath = g_strdup (CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_DEFAULT_APPLI_ICON_NAME);
1356 }1361 }
1357 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (cIconPath,1362 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (cIconPath,
@@ -1405,26 +1410,23 @@
1405 icon->bHasIndicator = myIndicators.bDrawIndicatorOnAppli;1410 icon->bHasIndicator = myIndicators.bDrawIndicatorOnAppli;
1406 1411
1407 //\____________ On remplit ses buffers.1412 //\____________ On remplit ses buffers.
1408 #ifdef HAVE_XEXTEND1413 if (myTaskBar.bShowAppli)
1409 if (myTaskBar.iMinimizedWindowRenderType == 1 && ! icon->bIsHidden)1414 {
1410 {1415 #ifdef HAVE_XEXTEND
1411 //Display *display = gdk_x11_get_default_xdisplay ();1416 if (myTaskBar.iMinimizedWindowRenderType == 1 && ! icon->bIsHidden)
1412 icon->iBackingPixmap = XCompositeNameWindowPixmap (s_XDisplay, Xid);1417 {
1413 /*icon->iDamageHandle = XDamageCreate (s_XDisplay, Xid, XDamageReportNonEmpty); // XDamageReportRawRectangles1418 //Display *display = gdk_x11_get_default_xdisplay ();
1414 cd_debug ("backing pixmap : %d ; iDamageHandle : %d\n", icon->iBackingPixmap, icon->iDamageHandle);*/1419 icon->iBackingPixmap = XCompositeNameWindowPixmap (s_XDisplay, Xid);
1415 }1420 /*icon->iDamageHandle = XDamageCreate (s_XDisplay, Xid, XDamageReportNonEmpty); // XDamageReportRawRectangles
1416 #endif1421 cd_debug ("backing pixmap : %d ; iDamageHandle : %d\n", icon->iBackingPixmap, icon->iDamageHandle);*/
1417 1422 }
1418 if (pDock)1423 #endif
1419 {1424
1420 cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock));1425 if (pDock)
1421 /**if (icon->bIsHidden && myTaskBar.iMinimizedWindowRenderType == 2)1426 {
1422 {1427 cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock));
1423 cairo_dock_draw_hidden_appli_icon (icon, CAIRO_CONTAINER (pDock), FALSE);1428 }
1424 }*/1429 }
1425 }
1426 else
1427 g_print ("%s is not loaded\n", icon->cName);
1428 1430
1429 //\____________ On enregistre l'appli et on commence a la surveiller.1431 //\____________ On enregistre l'appli et on commence a la surveiller.
1430 cairo_dock_register_appli (icon);1432 cairo_dock_register_appli (icon);
14311433
=== modified file 'src/gldit/cairo-dock-config.c'
--- src/gldit/cairo-dock-config.c 2010-09-18 12:19:06 +0000
+++ src/gldit/cairo-dock-config.c 2010-10-06 17:25:57 +0000
@@ -450,8 +450,8 @@
450 gchar *cFileName = cairo_dock_get_string_key_value (pKeyFile, cGroupName, cKeyName, bFlushConfFileNeeded, NULL, cDefaultGroupName, cDefaultKeyName);450 gchar *cFileName = cairo_dock_get_string_key_value (pKeyFile, cGroupName, cKeyName, bFlushConfFileNeeded, NULL, cDefaultGroupName, cDefaultKeyName);
451 gchar *cFilePath = NULL;451 gchar *cFilePath = NULL;
452 if (cFileName != NULL)452 if (cFileName != NULL)
453 cFilePath = cairo_dock_generate_file_path (cFileName);453 cFilePath = cairo_dock_search_image_s_path (cFileName);
454 else if (cDefaultFileName != NULL && cDefaultDir != NULL)454 if (cFilePath == NULL && cDefaultFileName != NULL && cDefaultDir != NULL) // pas d'image specifiee, ou image introuvable => on prend l'image par defaut fournie.
455 cFilePath = g_strdup_printf ("%s/%s", cDefaultDir, cDefaultFileName);455 cFilePath = g_strdup_printf ("%s/%s", cDefaultDir, cDefaultFileName);
456 return cFilePath;456 return cFilePath;
457}457}
@@ -516,11 +516,9 @@
516 double fTime = time_val.tv_sec + time_val.tv_usec * 1e-6;516 double fTime = time_val.tv_sec + time_val.tv_usec * 1e-6;
517 cairo_dock_activate_modules_from_list (mySystem.cActiveModuleList, fTime);517 cairo_dock_activate_modules_from_list (mySystem.cActiveModuleList, fTime);
518 518
519 //\___________________ On lance la barre des taches.519 //\___________________ 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.
520 if (myTaskBar.bShowAppli)520 ///if (myTaskBar.bShowAppli)
521 {
522 cairo_dock_start_application_manager (pMainDock); // va inserer le separateur si necessaire.521 cairo_dock_start_application_manager (pMainDock); // va inserer le separateur si necessaire.
523 }
524 522
525 //\___________________ On dessine tout.523 //\___________________ On dessine tout.
526 cairo_dock_draw_subdock_icons ();524 cairo_dock_draw_subdock_icons ();
@@ -581,13 +579,13 @@
581 //\___________________ On garde une trace de certains parametres.579 //\___________________ On garde une trace de certains parametres.
582 gchar *cRaiseDockShortcutOld = myAccessibility.cRaiseDockShortcut;580 gchar *cRaiseDockShortcutOld = myAccessibility.cRaiseDockShortcut;
583 myAccessibility.cRaiseDockShortcut = NULL;581 myAccessibility.cRaiseDockShortcut = NULL;
584 ///gboolean bPopUpOld = myAccessibility.bPopUp; // FALSE initialement.
585 gboolean bUseFakeTransparencyOld = mySystem.bUseFakeTransparency; // FALSE initialement.582 gboolean bUseFakeTransparencyOld = mySystem.bUseFakeTransparency; // FALSE initialement.
586 gboolean bGroupAppliByClassOld = myTaskBar.bGroupAppliByClass; // FALSE initialement.583 gboolean bGroupAppliByClassOld = myTaskBar.bGroupAppliByClass; // FALSE initialement.
587 gboolean bHideVisibleApplisOld = myTaskBar.bHideVisibleApplis;584 gboolean bHideVisibleApplisOld = myTaskBar.bHideVisibleApplis;
588 gboolean bAppliOnCurrentDesktopOnlyOld = myTaskBar.bAppliOnCurrentDesktopOnly;585 gboolean bAppliOnCurrentDesktopOnlyOld = myTaskBar.bAppliOnCurrentDesktopOnly;
589 gboolean bMixLauncherAppliOld = myTaskBar.bMixLauncherAppli;586 gboolean bMixLauncherAppliOld = myTaskBar.bMixLauncherAppli;
590 gboolean bOverWriteXIconsOld = myTaskBar.bOverWriteXIcons; // TRUE initialement.587 gboolean bOverWriteXIconsOld = myTaskBar.bOverWriteXIcons; // TRUE initialement.
588 gboolean bShowAppliOld = myTaskBar.bShowAppli;
591 gint iMinimizedWindowRenderTypeOld = myTaskBar.iMinimizedWindowRenderType;589 gint iMinimizedWindowRenderTypeOld = myTaskBar.iMinimizedWindowRenderType;
592 gchar *cDeskletDecorationsNameOld = myDesklets.cDeskletDecorationsName;590 gchar *cDeskletDecorationsNameOld = myDesklets.cDeskletDecorationsName;
593 myDesklets.cDeskletDecorationsName = NULL;591 myDesklets.cDeskletDecorationsName = NULL;
@@ -682,7 +680,7 @@
682 bMixLauncherAppliOld != myTaskBar.bMixLauncherAppli ||680 bMixLauncherAppliOld != myTaskBar.bMixLauncherAppli ||
683 bOverWriteXIconsOld != myTaskBar.bOverWriteXIcons ||681 bOverWriteXIconsOld != myTaskBar.bOverWriteXIcons ||
684 iMinimizedWindowRenderTypeOld != myTaskBar.iMinimizedWindowRenderType ||682 iMinimizedWindowRenderTypeOld != myTaskBar.iMinimizedWindowRenderType ||
685 (cairo_dock_application_manager_is_running () && ! myTaskBar.bShowAppli)) // on ne veut plus voir les applis, il faut donc les enlever.683 (bShowAppliOld != myTaskBar.bShowAppli))
686 {684 {
687 cairo_dock_stop_application_manager ();685 cairo_dock_stop_application_manager ();
688 }686 }
@@ -710,7 +708,7 @@
710 cairo_dock_activate_modules_from_list (mySystem.cActiveModuleList, fTime);708 cairo_dock_activate_modules_from_list (mySystem.cActiveModuleList, fTime);
711 cairo_dock_deactivate_old_modules (fTime);709 cairo_dock_deactivate_old_modules (fTime);
712 710
713 if (! cairo_dock_application_manager_is_running () && myTaskBar.bShowAppli) // maintenant on veut voir les applis !711 if (! cairo_dock_application_manager_is_running ()) // maintenant on veut voir les applis !
714 {712 {
715 cairo_dock_start_application_manager (pDock); // va inserer le separateur si necessaire.713 cairo_dock_start_application_manager (pDock); // va inserer le separateur si necessaire.
716 }714 }
717715
=== modified file 'src/gldit/cairo-dock-container.c'
--- src/gldit/cairo-dock-container.c 2010-09-18 12:19:06 +0000
+++ src/gldit/cairo-dock-container.c 2010-10-06 17:25:57 +0000
@@ -41,6 +41,7 @@
41#include "cairo-dock-notifications.h"41#include "cairo-dock-notifications.h"
42#include "cairo-dock-animations.h"42#include "cairo-dock-animations.h"
43#include "cairo-dock-callbacks.h"43#include "cairo-dock-callbacks.h"
44#include "cairo-dock-X-manager.h"
44#include "cairo-dock-container.h"45#include "cairo-dock-container.h"
4546
46static gboolean s_bSticky = TRUE;47static gboolean s_bSticky = TRUE;
@@ -49,6 +50,7 @@
49CairoContainer *g_pPrimaryContainer = NULL;50CairoContainer *g_pPrimaryContainer = NULL;
50extern gboolean g_bUseOpenGL;51extern gboolean g_bUseOpenGL;
51extern CairoDockHidingEffect *g_pHidingBackend; // cairo_dock_is_hidden52extern CairoDockHidingEffect *g_pHidingBackend; // cairo_dock_is_hidden
53extern CairoDockDesktopGeometry g_desktopGeometry;
5254
5355
54static gboolean _cairo_dock_on_delete (GtkWidget *pWidget, GdkEvent *event, gpointer data)56static gboolean _cairo_dock_on_delete (GtkWidget *pWidget, GdkEvent *event, gpointer data)
@@ -109,7 +111,7 @@
109 }111 }
110 if (g_pPrimaryContainer == pContainer)112 if (g_pPrimaryContainer == pContainer)
111 g_pPrimaryContainer = NULL;113 g_pPrimaryContainer = NULL;
112 else if (g_pPrimaryContainer != NULL)114 else if (g_bUseOpenGL && g_pPrimaryContainer != NULL)
113 cairo_dock_set_default_gl_context ();115 cairo_dock_set_default_gl_context ();
114}116}
115117
@@ -434,15 +436,15 @@
434 {436 {
435 *x = x0;437 *x = x0;
436 if (pContainer->bDirectionUp)438 if (pContainer->bDirectionUp)
437 *y = y0 - h; /// - h_menu ?...439 *y = y0 - h;
438 else440 else
439 *y = y0 + pIcon->fHeight * pIcon->fScale;441 *y = y0 + pIcon->fHeight * pIcon->fScale;
440 }442 }
441 else443 else
442 {444 {
443 *y = x0;445 *y = MIN (x0, g_desktopGeometry.iXScreenHeight[CAIRO_DOCK_HORIZONTAL] - h);
444 if (pContainer->bDirectionUp)446 if (pContainer->bDirectionUp)
445 *x = y0 - w; /// - w_menu ?...447 *x = y0 - w;
446 else448 else
447 *x = y0 + pIcon->fHeight * pIcon->fScale;449 *x = y0 + pIcon->fHeight * pIcon->fScale;
448 }450 }
449451
=== modified file 'src/gldit/cairo-dock-dialog-manager.c'
--- src/gldit/cairo-dock-dialog-manager.c 2010-09-18 12:19:06 +0000
+++ src/gldit/cairo-dock-dialog-manager.c 2010-10-06 17:25:57 +0000
@@ -928,10 +928,12 @@
928 cd_message ("%s (%d)", __func__, iClickedButton);928 cd_message ("%s (%d)", __func__, iClickedButton);
929 int *iAnswerBuffer = data[0];929 int *iAnswerBuffer = data[0];
930 GMainLoop *pBlockingLoop = data[1];930 GMainLoop *pBlockingLoop = data[1];
931 GtkWidget *pWidgetCatcher = data[2];931 /**GtkWidget *pWidgetCatcher = data[2];
932 if (pInteractiveWidget != NULL)932 if (pInteractiveWidget != NULL)
933 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).933 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).*/
934934
935 cairo_dock_steal_interactive_widget_from_dialog (pDialog); // le dialogue disparaitra apres cette fonction, mais le widget interactif doit rester.
936
935 *iAnswerBuffer = iClickedButton;937 *iAnswerBuffer = iClickedButton;
936938
937 if (g_main_loop_is_running (pBlockingLoop))939 if (g_main_loop_is_running (pBlockingLoop))
@@ -940,19 +942,19 @@
940static gboolean _cairo_dock_dialog_destroyed (GtkWidget *pWidget, GdkEvent *event, GMainLoop *pBlockingLoop)942static gboolean _cairo_dock_dialog_destroyed (GtkWidget *pWidget, GdkEvent *event, GMainLoop *pBlockingLoop)
941{943{
942 cd_debug ("dialogue detruit, on sort de la boucle\n");944 cd_debug ("dialogue detruit, on sort de la boucle\n");
943 gtk_window_set_modal (GTK_WINDOW (pWidget), FALSE);945 gtk_window_set_modal (GTK_WINDOW (pWidget), FALSE); /// utile ?...
944 if (g_main_loop_is_running (pBlockingLoop))946 if (g_main_loop_is_running (pBlockingLoop))
945 g_main_loop_quit (pBlockingLoop);947 g_main_loop_quit (pBlockingLoop);
946 return FALSE;948 return FALSE;
947}949}
948int cairo_dock_show_dialog_and_wait (const gchar *cText, Icon *pIcon, CairoContainer *pContainer, double fTimeLength, const gchar *cIconPath, GtkWidget *pInteractiveWidget)950int cairo_dock_show_dialog_and_wait (const gchar *cText, Icon *pIcon, CairoContainer *pContainer, double fTimeLength, const gchar *cIconPath, GtkWidget *pInteractiveWidget)
949{951{
950 static GtkWidget *pWidgetCatcher = NULL; // voir l'astuce plus haut.952 ///static GtkWidget *pWidgetCatcher = NULL; // voir l'astuce plus haut.
951 int iClickedButton = -3;953 int iClickedButton = -3;
952 GMainLoop *pBlockingLoop = g_main_loop_new (NULL, FALSE);954 GMainLoop *pBlockingLoop = g_main_loop_new (NULL, FALSE);
953 if (pWidgetCatcher == NULL)955 /**if (pWidgetCatcher == NULL)
954 pWidgetCatcher = gtk_hbox_new (0, FALSE);956 pWidgetCatcher = gtk_hbox_new (0, FALSE);*/
955 gpointer data[3] = {&iClickedButton, pBlockingLoop, pWidgetCatcher}; // inutile d'allouer 'data' puisqu'on va bloquer.957 gpointer data[2/**3*/] = {&iClickedButton, pBlockingLoop/**, pWidgetCatcher*/}; // inutile d'allouer 'data' puisqu'on va bloquer.
956958
957 CairoDialog *pDialog = cairo_dock_show_dialog_full (cText,959 CairoDialog *pDialog = cairo_dock_show_dialog_full (cText,
958 pIcon,960 pIcon,
@@ -989,11 +991,7 @@
989 cd_message ("on force a quitter");991 cd_message ("on force a quitter");
990 CairoDock *pDock = CAIRO_DOCK (pContainer);992 CairoDock *pDock = CAIRO_DOCK (pContainer);
991 pDock->container.bInside = TRUE;993 pDock->container.bInside = TRUE;
992 ///pDock->bAtBottom = FALSE;
993 cairo_dock_emit_leave_signal (CAIRO_CONTAINER (pDock));994 cairo_dock_emit_leave_signal (CAIRO_CONTAINER (pDock));
994 /*cairo_dock_on_leave_notify (pDock->container.pWidget,
995 NULL,
996 pDock);*/
997 }995 }
998 }996 }
999997
1000998
=== modified file 'src/gldit/cairo-dock-dock-facility.c'
--- src/gldit/cairo-dock-dock-facility.c 2010-09-16 01:04:13 +0000
+++ src/gldit/cairo-dock-dock-facility.c 2010-10-06 17:25:57 +0000
@@ -309,8 +309,16 @@
309 else if (iWindowPositionY > g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight)309 else if (iWindowPositionY > g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight)
310 iWindowPositionY = g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight;310 iWindowPositionY = g_desktopGeometry.iScreenHeight[pDock->container.bIsHorizontal] - iNewHeight + pDock->iMaxIconHeight;
311 311
312 *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetX;312 if (pDock->container.bIsHorizontal)
313 *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetY;313 {
314 *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetX;
315 *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetY;
316 }
317 else
318 {
319 *iNewPositionX = iWindowPositionX + pDock->iScreenOffsetY;
320 *iNewPositionY = iWindowPositionY + pDock->iScreenOffsetX;
321 }
314 //g_print ("POSITION : %d+%d ; %d+%d\n", iWindowPositionX, pDock->iScreenOffsetX, iWindowPositionY, pDock->iScreenOffsetY);322 //g_print ("POSITION : %d+%d ; %d+%d\n", iWindowPositionX, pDock->iScreenOffsetX, iWindowPositionY, pDock->iScreenOffsetY);
315}323}
316324
317325
=== modified file 'src/gldit/cairo-dock-dock-manager.c'
--- src/gldit/cairo-dock-dock-manager.c 2010-09-18 12:19:06 +0000
+++ src/gldit/cairo-dock-dock-manager.c 2010-10-06 17:25:57 +0000
@@ -543,9 +543,13 @@
543}543}
544544
545545
546static void _reload_buffer_in_one_dock (const gchar *cDockName, CairoDock *pDock, gpointer data)
547{
548 cairo_dock_reload_buffers_in_dock (pDock, GPOINTER_TO_INT (data), FALSE);
549}
546void cairo_dock_reload_buffers_in_all_docks (gboolean bReloadAppletsToo)550void cairo_dock_reload_buffers_in_all_docks (gboolean bReloadAppletsToo)
547{551{
548 g_hash_table_foreach (s_hDocksTable, (GHFunc) cairo_dock_reload_buffers_in_dock, GINT_TO_POINTER (bReloadAppletsToo));552 g_hash_table_foreach (s_hDocksTable, (GHFunc) _reload_buffer_in_one_dock, GINT_TO_POINTER (bReloadAppletsToo));
549 553
550 cairo_dock_draw_subdock_icons ();554 cairo_dock_draw_subdock_icons ();
551}555}
@@ -705,7 +709,7 @@
705 g_free (pDock->cBgImagePath);709 g_free (pDock->cBgImagePath);
706 if (cBgImage != NULL)710 if (cBgImage != NULL)
707 {711 {
708 pDock->cBgImagePath = cairo_dock_generate_file_path (cBgImage);712 pDock->cBgImagePath = cairo_dock_search_image_s_path (cBgImage);
709 g_free (cBgImage);713 g_free (cBgImage);
710 }714 }
711 else715 else
@@ -751,7 +755,7 @@
751{755{
752 // on cree le fichier de conf a partir du template.756 // on cree le fichier de conf a partir du template.
753 gchar *cConfFilePath = g_strdup_printf ("%s/%s.conf", g_cCurrentThemePath, cDockName);757 gchar *cConfFilePath = g_strdup_printf ("%s/%s.conf", g_cCurrentThemePath, cDockName);
754 gchar *cCommand = g_strdup_printf ("cp '%s/%s' '%s'", CAIRO_DOCK_SHARE_DATA_DIR, CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);758 gchar *cCommand = g_strdup_printf ("cp '%s' '%s'", CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_MAIN_DOCK_CONF_FILE, cConfFilePath);
755 int r = system (cCommand);759 int r = system (cCommand);
756 g_free (cCommand);760 g_free (cCommand);
757 761
@@ -784,7 +788,8 @@
784{788{
785 cairo_dock_read_root_dock_config (cDockName, pDock);789 cairo_dock_read_root_dock_config (cDockName, pDock);
786 790
787 cairo_dock_load_buffers_in_one_dock (pDock); // recharge les icones et les applets.791 ///cairo_dock_load_buffers_in_one_dock (pDock); // recharge les icones et les applets.
792 cairo_dock_reload_buffers_in_dock (pDock, TRUE, TRUE); // recharge les icones et les applets, recursivement.
788 793
789 pDock->backgroundBuffer.iWidth ++; // pour forcer le chargement du fond.794 pDock->backgroundBuffer.iWidth ++; // pour forcer le chargement du fond.
790 cairo_dock_set_default_renderer (pDock);795 cairo_dock_set_default_renderer (pDock);
@@ -838,14 +843,14 @@
838 {843 {
839 pSubDock->container.bDirectionUp = pDock->container.bDirectionUp;844 pSubDock->container.bDirectionUp = pDock->container.bDirectionUp;
840 pSubDock->container.bIsHorizontal = pDock->container.bIsHorizontal;845 pSubDock->container.bIsHorizontal = pDock->container.bIsHorizontal;
841 pSubDock->iScreenOffsetX = pDock->iScreenOffsetX;
842 pSubDock->iScreenOffsetY = pDock->iScreenOffsetY;
843 if (bReloadBuffersIfNecessary)846 if (bReloadBuffersIfNecessary)
844 cairo_dock_reload_reflects_in_dock (pSubDock);847 cairo_dock_reload_reflects_in_dock (pSubDock);
845 cairo_dock_update_dock_size (pSubDock);848 cairo_dock_update_dock_size (pSubDock);
846 849
847 cairo_dock_synchronize_sub_docks_orientation (pSubDock, bReloadBuffersIfNecessary);850 cairo_dock_synchronize_sub_docks_orientation (pSubDock, bReloadBuffersIfNecessary);
848 }851 }
852 pSubDock->iScreenOffsetX = pDock->iScreenOffsetX;
853 pSubDock->iScreenOffsetY = pDock->iScreenOffsetY;
849}854}
850855
851void cairo_dock_synchronize_sub_docks_orientation (CairoDock *pDock, gboolean bReloadBuffersIfNecessary)856void cairo_dock_synchronize_sub_docks_orientation (CairoDock *pDock, gboolean bReloadBuffersIfNecessary)
@@ -911,7 +916,7 @@
911916
912static void _cairo_dock_stop_quick_hide_one_root_dock (const gchar *cDockName, CairoDock *pDock, gpointer data)917static void _cairo_dock_stop_quick_hide_one_root_dock (const gchar *cDockName, CairoDock *pDock, gpointer data)
913{918{
914 if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden && pDock->bAutoHide)919 if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden && pDock->bAutoHide && pDock->iVisibility != CAIRO_DOCK_VISI_AUTO_HIDE)
915 {920 {
916 pDock->bAutoHide = FALSE;921 pDock->bAutoHide = FALSE;
917 922
@@ -949,7 +954,7 @@
949954
950void cairo_dock_activate_temporary_auto_hide (CairoDock *pDock)955void cairo_dock_activate_temporary_auto_hide (CairoDock *pDock)
951{956{
952 if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden)957 if (pDock->iRefCount == 0 && ! pDock->bTemporaryHidden && pDock->iVisibility != CAIRO_DOCK_VISI_AUTO_HIDE)
953 {958 {
954 //g_print ("hide\n");959 //g_print ("hide\n");
955 pDock->bTemporaryHidden = TRUE;960 pDock->bTemporaryHidden = TRUE;
956961
=== modified file 'src/gldit/cairo-dock-draw-opengl.c'
--- src/gldit/cairo-dock-draw-opengl.c 2010-09-07 00:38:36 +0000
+++ src/gldit/cairo-dock-draw-opengl.c 2010-10-06 17:25:57 +0000
@@ -422,9 +422,9 @@
422 glTranslatef (floor (fY + icon->fHeight * icon->fScale * (1 - icon->fGlideScale/2)), floor (fX), - icon->fHeight * (1+myIcons.fAmplitude));422 glTranslatef (floor (fY + icon->fHeight * icon->fScale * (1 - icon->fGlideScale/2)), floor (fX), - icon->fHeight * (1+myIcons.fAmplitude));
423 423
424 double fOffsetX = 0.;424 double fOffsetX = 0.;
425 if (icon->fDrawX + icon->fWidth * icon->fScale/2 - icon->iTextWidth/2 < 0)425 if (icon->fDrawX + icon->fWidth * icon->fScale/2 - icon->iTextWidth/2 < 0) // l'etiquette deborde a gauche.
426 fOffsetX = icon->iTextWidth/2 - (icon->fDrawX + icon->fWidth * icon->fScale/2);426 fOffsetX = icon->iTextWidth/2 - (icon->fDrawX + icon->fWidth * icon->fScale/2);
427 else if (icon->fDrawX + icon->fWidth * icon->fScale/2 + icon->iTextWidth/2 > pDock->container.iWidth)427 else if (icon->fDrawX + icon->fWidth * icon->fScale/2 + icon->iTextWidth/2 > pDock->container.iWidth) // l'etiquette deborde a droite.
428 fOffsetX = pDock->container.iWidth - (icon->fDrawX + icon->fWidth * icon->fScale/2 + icon->iTextWidth/2);428 fOffsetX = pDock->container.iWidth - (icon->fDrawX + icon->fWidth * icon->fScale/2 + icon->iTextWidth/2);
429 if (icon->fOrientation != 0 && ! myLabels.bTextAlwaysHorizontal)429 if (icon->fOrientation != 0 && ! myLabels.bTextAlwaysHorizontal)
430 {430 {
@@ -435,7 +435,13 @@
435 435
436 double dx = .5 * (icon->iTextWidth & 1); // on decale la texture pour la coller sur la grille des coordonnees entieres.436 double dx = .5 * (icon->iTextWidth & 1); // on decale la texture pour la coller sur la grille des coordonnees entieres.
437 double dy = .5 * (icon->iTextHeight & 1);437 double dy = .5 * (icon->iTextHeight & 1);
438 if (! pDock->container.bIsHorizontal && myLabels.bTextAlwaysHorizontal)438 if (pDock->container.bIsHorizontal)
439 {
440 glTranslatef (floor (fOffsetX) + dx,
441 floor ((pDock->container.bDirectionUp ? 1:-1) * (icon->fHeight * icon->fScale/2 + myLabels.iLabelSize - icon->iTextHeight / 2)) + dy,
442 0.);
443 }
444 else if (myLabels.bTextAlwaysHorizontal)
439 {445 {
440 fOffsetX = MIN (0, icon->fDrawY + icon->fWidth * icon->fScale/2 - icon->iTextWidth/2);446 fOffsetX = MIN (0, icon->fDrawY + icon->fWidth * icon->fScale/2 - icon->iTextWidth/2);
441 double y = (icon->fWidth * icon->fScale + icon->iTextHeight) / 2;447 double y = (icon->fWidth * icon->fScale + icon->iTextHeight) / 2;
@@ -445,16 +451,10 @@
445 floor (y) + dy,451 floor (y) + dy,
446 0.);452 0.);
447 }453 }
448 else if (pDock->container.bIsHorizontal)
449 {
450 glTranslatef (floor (fOffsetX) + dx,
451 floor ((pDock->container.bDirectionUp ? 1:-1) * (icon->fHeight * icon->fScale/2 + myLabels.iLabelSize - icon->iTextHeight / 2)) + dy,
452 0.);
453 }
454 else454 else
455 {455 {
456 glTranslatef (floor ((pDock->container.bDirectionUp ? -.5:.5) * (icon->fHeight * icon->fScale + icon->iTextHeight)) + dx,456 glTranslatef (floor ((pDock->container.bDirectionUp ? -.5:.5) * (icon->fHeight * icon->fScale + icon->iTextHeight)) + dx,
457 floor (fOffsetX) + dy,457 - floor (fOffsetX) + dy,
458 0.);458 0.);
459 glRotatef (pDock->container.bDirectionUp ? 90 : -90, 0., 0., 1.);459 glRotatef (pDock->container.bDirectionUp ? 90 : -90, 0., 0., 1.);
460 }460 }
@@ -664,7 +664,7 @@
664 if (*cImageFile == '/')664 if (*cImageFile == '/')
665 cImagePath = (gchar *)cImageFile;665 cImagePath = (gchar *)cImageFile;
666 else666 else
667 cImagePath = cairo_dock_generate_file_path (cImageFile);667 cImagePath = cairo_dock_search_image_s_path (cImageFile);
668 668
669 cairo_t *pCairoContext = cairo_dock_create_drawing_context_generic (g_pPrimaryContainer);669 cairo_t *pCairoContext = cairo_dock_create_drawing_context_generic (g_pPrimaryContainer);
670 cairo_surface_t *pSurface = cairo_dock_create_surface_from_image (cImagePath,670 cairo_surface_t *pSurface = cairo_dock_create_surface_from_image (cImagePath,
671671
=== modified file 'src/gldit/cairo-dock-draw.c'
--- src/gldit/cairo-dock-draw.c 2010-09-07 00:38:36 +0000
+++ src/gldit/cairo-dock-draw.c 2010-10-06 17:25:57 +0000
@@ -571,39 +571,38 @@
571 else571 else
572 cairo_translate (pCairoContext, floor (icon->fDrawY), floor (icon->fDrawX + icon->fGlideOffset * icon->fWidth * icon->fScale * (icon->fGlideOffset < 0 ? fGlideScale : 1)));572 cairo_translate (pCairoContext, floor (icon->fDrawY), floor (icon->fDrawX + icon->fGlideOffset * icon->fWidth * icon->fScale * (icon->fGlideOffset < 0 ? fGlideScale : 1)));
573 573
574 double fOffsetX = (/**icon->fWidthFactor * */icon->fWidth * icon->fScale - icon->iTextWidth) / 2;574 double fOffsetX = (icon->fWidth * icon->fScale - icon->iTextWidth) / 2;
575 if (fOffsetX < - icon->fDrawX)575 if (fOffsetX < - icon->fDrawX) // l'etiquette deborde a gauche.
576 fOffsetX = - icon->fDrawX;576 fOffsetX = - icon->fDrawX;
577 else if (icon->fDrawX + fOffsetX + icon->iTextWidth > iWidth)577 else if (icon->fDrawX + fOffsetX + icon->iTextWidth > iWidth) // l'etiquette deborde a droite.
578 fOffsetX = iWidth - icon->iTextWidth - icon->fDrawX;578 fOffsetX = iWidth - icon->iTextWidth - icon->fDrawX;
579 579
580 if (icon->fOrientation != 0 && ! myLabels.bTextAlwaysHorizontal)580 if (icon->fOrientation != 0 && ! myLabels.bTextAlwaysHorizontal)
581 cairo_rotate (pCairoContext, icon->fOrientation);581 cairo_rotate (pCairoContext, icon->fOrientation);
582 582
583 if (! bIsHorizontal && myLabels.bTextAlwaysHorizontal)583 if (bIsHorizontal)
584 {
585 cairo_set_source_surface (pCairoContext,
586 icon->pTextBuffer,
587 floor (fOffsetX),
588 floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale));
589 }
590 else if (myLabels.bTextAlwaysHorizontal)
584 {591 {
585 if (fOffsetX < - icon->fDrawY)592 if (fOffsetX < - icon->fDrawY)
586 fOffsetX = - icon->fDrawY;593 fOffsetX = - icon->fDrawY;
587 cairo_set_source_surface (pCairoContext,594 cairo_set_source_surface (pCairoContext,
588 icon->pTextBuffer,595 icon->pTextBuffer,
589 /**floor ((pDock->container.bDirectionUp ? -myLabels.iLabelSize : - (pDock->container.bUseReflect ? myIcons.fReflectSize : 0.)) - myLabels.iconTextDescription.iMargin + 1),*/
590 floor (fOffsetX),596 floor (fOffsetX),
591 0.);597 0.);
592 }598 }
593 else if (bIsHorizontal)
594 cairo_set_source_surface (pCairoContext,
595 icon->pTextBuffer,
596 floor (fOffsetX),
597 floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale/* - icon->fTextYOffset*/));
598 else599 else
599 {600 {
600 cairo_translate (pCairoContext, icon->iTextWidth/2, icon->iTextHeight/2);
601 cairo_rotate (pCairoContext, bDirectionUp ? - G_PI/2 : G_PI/2);601 cairo_rotate (pCairoContext, bDirectionUp ? - G_PI/2 : G_PI/2);
602 cairo_translate (pCairoContext, -icon->iTextWidth/2, -icon->iTextHeight/2);
603 cairo_set_source_surface (pCairoContext,602 cairo_set_source_surface (pCairoContext,
604 icon->pTextBuffer,603 icon->pTextBuffer,
605 floor (bDirectionUp ? -myLabels.iLabelSize : icon->fHeight * icon->fScale/* - icon->fTextYOffset*/),604 floor (bDirectionUp ? fOffsetX - icon->fWidth * icon->fScale : fOffsetX),
606 floor (fOffsetX));605 -floor (bDirectionUp ? myLabels.iLabelSize : icon->fHeight * icon->fScale + myLabels.iLabelSize));
607 }606 }
608 double fMagnitude;607 double fMagnitude;
609 if (myLabels.bLabelForPointedIconOnly || pDock->fMagnitudeMax == 0.)608 if (myLabels.bLabelForPointedIconOnly || pDock->fMagnitudeMax == 0.)
610609
=== modified file 'src/gldit/cairo-dock-gui-factory.c'
--- src/gldit/cairo-dock-gui-factory.c 2010-09-16 01:04:13 +0000
+++ src/gldit/cairo-dock-gui-factory.c 2010-10-06 17:25:57 +0000
@@ -2177,7 +2177,7 @@
2177 gchar *cShareThemesDir = NULL, *cUserThemesDir = NULL, *cDistantThemesDir = NULL;2177 gchar *cShareThemesDir = NULL, *cUserThemesDir = NULL, *cDistantThemesDir = NULL;
2178 if (pAuthorizedValuesList[0] != NULL)2178 if (pAuthorizedValuesList[0] != NULL)
2179 {2179 {
2180 cShareThemesDir = (*pAuthorizedValuesList[0] != '\0' ? cairo_dock_generate_file_path (pAuthorizedValuesList[0]) : NULL); // on autorise les ~/blabla.2180 cShareThemesDir = (*pAuthorizedValuesList[0] != '\0' ? cairo_dock_search_image_s_path (pAuthorizedValuesList[0]) : NULL); // on autorise les ~/blabla.
2181 if (pAuthorizedValuesList[1] != NULL)2181 if (pAuthorizedValuesList[1] != NULL)
2182 {2182 {
2183 cUserThemesDir = g_strdup_printf ("%s/%s", g_cExtrasDirPath, pAuthorizedValuesList[1]);2183 cUserThemesDir = g_strdup_printf ("%s/%s", g_cExtrasDirPath, pAuthorizedValuesList[1]);
21842184
=== modified file 'src/gldit/cairo-dock-icon-loader.c'
--- src/gldit/cairo-dock-icon-loader.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-icon-loader.c 2010-10-06 17:25:57 +0000
@@ -249,10 +249,9 @@
249 if ((icon->pIconBuffer == pPrevSurface || icon->pIconBuffer == NULL) &&249 if ((icon->pIconBuffer == pPrevSurface || icon->pIconBuffer == NULL) &&
250 (icon->iIconTexture == iPrevTexture || icon->iIconTexture == 0))250 (icon->iIconTexture == iPrevTexture || icon->iIconTexture == 0))
251 {251 {
252 gchar *cIconPath = cairo_dock_generate_file_path (CAIRO_DOCK_DEFAULT_ICON_NAME);252 gchar *cIconPath = cairo_dock_search_image_s_path (CAIRO_DOCK_DEFAULT_ICON_NAME);
253 if (cIconPath == NULL || ! g_file_test (cIconPath, G_FILE_TEST_EXISTS))253 if (cIconPath == NULL) // fichier non trouve.
254 {254 {
255 g_free (cIconPath);
256 cIconPath = g_strdup (CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_DEFAULT_ICON_NAME);255 cIconPath = g_strdup (CAIRO_DOCK_SHARE_DATA_DIR"/"CAIRO_DOCK_DEFAULT_ICON_NAME);
257 }256 }
258 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (cIconPath,257 icon->pIconBuffer = cairo_dock_create_surface_from_image_simple (cIconPath,
@@ -490,10 +489,9 @@
490}489}
491490
492491
493void cairo_dock_reload_buffers_in_dock (gchar *cDockName, CairoDock *pDock, gpointer data)492void cairo_dock_reload_buffers_in_dock (CairoDock *pDock, gboolean bReloadAppletsToo, gboolean bRecursive)
494{493{
495 gboolean bReloadAppletsToo = GPOINTER_TO_INT (data);494 cd_message ("%s (%d, %d)", __func__, bReloadAppletsToo, bRecursive);
496 cd_message ("%s (%s, %d)", __func__, cDockName, bReloadAppletsToo);
497495
498 double fFlatDockWidth = - myIcons.iIconGap;496 double fFlatDockWidth = - myIcons.iIconGap;
499 pDock->iMaxIconHeight = 0;497 pDock->iMaxIconHeight = 0;
@@ -514,6 +512,12 @@
514 cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock)); // fait un set_icon_size512 cairo_dock_trigger_load_icon_buffers (icon, CAIRO_CONTAINER (pDock)); // fait un set_icon_size
515 icon->fWidth *= pDock->container.fRatio;513 icon->fWidth *= pDock->container.fRatio;
516 icon->fHeight *= pDock->container.fRatio;514 icon->fHeight *= pDock->container.fRatio;
515
516 if (bRecursive && icon->pSubDock != NULL)
517 {
518 cairo_dock_synchronize_one_sub_dock_orientation (icon->pSubDock, pDock, FALSE);
519 cairo_dock_reload_buffers_in_dock (icon->pSubDock, bReloadAppletsToo, bRecursive);
520 }
517 }521 }
518 522
519 //g_print (" =size <- %.2fx%.2f\n", icon->fWidth, icon->fHeight);523 //g_print (" =size <- %.2fx%.2f\n", icon->fWidth, icon->fHeight);
520524
=== modified file 'src/gldit/cairo-dock-icon-loader.h'
--- src/gldit/cairo-dock-icon-loader.h 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-icon-loader.h 2010-10-06 17:25:57 +0000
@@ -80,8 +80,8 @@
8080
81void cairo_dock_trigger_load_icon_buffers (Icon *pIcon, CairoContainer *pContainer);81void cairo_dock_trigger_load_icon_buffers (Icon *pIcon, CairoContainer *pContainer);
8282
83void cairo_dock_reload_buffers_in_dock (gchar *cDockName, CairoDock *pDock, gpointer data);83void cairo_dock_reload_buffers_in_dock (CairoDock *pDock, gboolean bReloadAppletsToo, gboolean bRecursive);
84#define cairo_dock_load_buffers_in_one_dock(pDock) cairo_dock_reload_buffers_in_dock (NULL, pDock, GINT_TO_POINTER (TRUE))84#define cairo_dock_load_buffers_in_one_dock(pDock) cairo_dock_reload_buffers_in_dock (pDock, TRUE, FALSE)
8585
86void cairo_dock_reload_icon_image (Icon *icon, CairoContainer *pContainer);86void cairo_dock_reload_icon_image (Icon *icon, CairoContainer *pContainer);
8787
8888
=== modified file 'src/gldit/cairo-dock-internal-background.c'
--- src/gldit/cairo-dock-internal-background.c 2010-09-07 00:38:36 +0000
+++ src/gldit/cairo-dock-internal-background.c 2010-10-06 17:25:57 +0000
@@ -53,14 +53,14 @@
53 53
54 gchar *cBgImage = cairo_dock_get_string_key_value (pKeyFile, "Background", "background image", &bFlushConfFileNeeded, NULL, NULL, NULL);54 gchar *cBgImage = cairo_dock_get_string_key_value (pKeyFile, "Background", "background image", &bFlushConfFileNeeded, NULL, NULL, NULL);
55 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.55 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.
56 if (iFillBg == -1)56 if (iFillBg == -1) // nouvelle cle
57 {57 {
58 iFillBg = (cBgImage != NULL ? 0 : 1);58 iFillBg = (cBgImage != NULL ? 0 : 1); // si une image etait definie auparavant, on dit qu'on veut le mode "image"
59 g_key_file_set_integer (pKeyFile, "Background", "fill bg", iFillBg);59 g_key_file_set_integer (pKeyFile, "Background", "fill bg", iFillBg);
60 }60 }
61 else61 else
62 {62 {
63 if (iFillBg != 0)63 if (iFillBg != 0) // remplissage avec un degrade => on ne veut pas d'image
64 {64 {
65 g_free (cBgImage);65 g_free (cBgImage);
66 cBgImage = NULL;66 cBgImage = NULL;
@@ -68,8 +68,11 @@
68 }68 }
69 69
70 // image de fond.70 // image de fond.
71 pBackground->cBackgroundImageFile = cairo_dock_generate_file_path (cBgImage);71 if (cBgImage != NULL)
72 g_free (cBgImage);72 {
73 pBackground->cBackgroundImageFile = cairo_dock_search_image_s_path (cBgImage);
74 g_free (cBgImage);
75 }
73 76
74 pBackground->fBackgroundImageAlpha = cairo_dock_get_double_key_value (pKeyFile, "Background", "image alpha", &bFlushConfFileNeeded, 0.5, NULL, NULL);77 pBackground->fBackgroundImageAlpha = cairo_dock_get_double_key_value (pKeyFile, "Background", "image alpha", &bFlushConfFileNeeded, 0.5, NULL, NULL);
7578
7679
=== modified file 'src/gldit/cairo-dock-internal-dialogs.c'
--- src/gldit/cairo-dock-internal-dialogs.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-internal-dialogs.c 2010-10-06 17:25:57 +0000
@@ -57,6 +57,7 @@
57 pDialogs->dialogTextDescription.iSize *= 1.33; // c'est pas beau, mais ca evite de casser tous les themes.57 pDialogs->dialogTextDescription.iSize *= 1.33; // c'est pas beau, mais ca evite de casser tous les themes.
58 pDialogs->dialogTextDescription.iWeight = pango_font_description_get_weight (fd);58 pDialogs->dialogTextDescription.iWeight = pango_font_description_get_weight (fd);
59 pDialogs->dialogTextDescription.iStyle = pango_font_description_get_style (fd);59 pDialogs->dialogTextDescription.iStyle = pango_font_description_get_style (fd);
60 pDialogs->dialogTextDescription.fMaxRelativeWidth = .5; // on limite a la moitie de l'ecran.
60 61
61 if (g_key_file_has_key (pKeyFile, "Dialogs", "message size", NULL)) // anciens parametres.62 if (g_key_file_has_key (pKeyFile, "Dialogs", "message size", NULL)) // anciens parametres.
62 {63 {
6364
=== modified file 'src/gldit/cairo-dock-internal-icons.c'
--- src/gldit/cairo-dock-internal-icons.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-internal-icons.c 2010-10-06 17:25:57 +0000
@@ -208,7 +208,7 @@
208 gchar *cLauncherBackgroundImageName = cairo_dock_get_string_key_value (pKeyFile, "Icons", "icons bg", &bFlushConfFileNeeded, NULL, NULL, NULL);208 gchar *cLauncherBackgroundImageName = cairo_dock_get_string_key_value (pKeyFile, "Icons", "icons bg", &bFlushConfFileNeeded, NULL, NULL, NULL);
209 if (cLauncherBackgroundImageName != NULL)209 if (cLauncherBackgroundImageName != NULL)
210 {210 {
211 pIcons->cBackgroundImagePath = cairo_dock_generate_file_path (cLauncherBackgroundImageName);211 pIcons->cBackgroundImagePath = cairo_dock_search_image_s_path (cLauncherBackgroundImageName);
212 g_free (cLauncherBackgroundImageName);212 g_free (cLauncherBackgroundImageName);
213 }213 }
214 214
215215
=== modified file 'src/gldit/cairo-dock-internal-indicators.c'
--- src/gldit/cairo-dock-internal-indicators.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-internal-indicators.c 2010-10-06 17:25:57 +0000
@@ -41,7 +41,7 @@
41 cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "indicator image", &bFlushConfFileNeeded, NULL, "Icons", NULL);41 cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "indicator image", &bFlushConfFileNeeded, NULL, "Icons", NULL);
42 if (cIndicatorImageName != NULL)42 if (cIndicatorImageName != NULL)
43 {43 {
44 pIndicators->cIndicatorImagePath = cairo_dock_generate_file_path (cIndicatorImageName);44 pIndicators->cIndicatorImagePath = cairo_dock_search_image_s_path (cIndicatorImageName);
45 g_free (cIndicatorImageName);45 g_free (cIndicatorImageName);
46 }46 }
47 else47 else
@@ -112,7 +112,7 @@
112 112
113 if (cIndicatorImageName != NULL)113 if (cIndicatorImageName != NULL)
114 {114 {
115 pIndicators->cActiveIndicatorImagePath = cairo_dock_generate_file_path (cIndicatorImageName);115 pIndicators->cActiveIndicatorImagePath = cairo_dock_search_image_s_path (cIndicatorImageName);
116 g_free (cIndicatorImageName);116 g_free (cIndicatorImageName);
117 }117 }
118 else118 else
@@ -124,7 +124,7 @@
124 cairo_dock_get_double_list_key_value (pKeyFile, "Indicators", "active color", &bFlushConfFileNeeded, pIndicators->fActiveColor, 4, couleur_active, "Icons", NULL);124 cairo_dock_get_double_list_key_value (pKeyFile, "Indicators", "active color", &bFlushConfFileNeeded, pIndicators->fActiveColor, 4, couleur_active, "Icons", NULL);
125 pIndicators->iActiveLineWidth = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active line width", &bFlushConfFileNeeded, 3, "Icons", NULL);125 pIndicators->iActiveLineWidth = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active line width", &bFlushConfFileNeeded, 3, "Icons", NULL);
126 pIndicators->iActiveCornerRadius = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active corner radius", &bFlushConfFileNeeded, 6, "Icons", NULL);126 pIndicators->iActiveCornerRadius = cairo_dock_get_integer_key_value (pKeyFile, "Indicators", "active corner radius", &bFlushConfFileNeeded, 6, "Icons", NULL);
127 }127 } // donc ici si on choisit le mode "image" sans en definir une, le alpha de la couleur reste a 0 => aucun indicateur
128 128
129 pIndicators->bActiveIndicatorAbove = cairo_dock_get_boolean_key_value (pKeyFile, "Indicators", "active frame position", &bFlushConfFileNeeded, TRUE, "Icons", NULL);129 pIndicators->bActiveIndicatorAbove = cairo_dock_get_boolean_key_value (pKeyFile, "Indicators", "active frame position", &bFlushConfFileNeeded, TRUE, "Icons", NULL);
130 130
@@ -135,7 +135,7 @@
135 cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "class indicator", &bFlushConfFileNeeded, NULL, NULL, NULL);135 cIndicatorImageName = cairo_dock_get_string_key_value (pKeyFile, "Indicators", "class indicator", &bFlushConfFileNeeded, NULL, NULL, NULL);
136 if (cIndicatorImageName != NULL)136 if (cIndicatorImageName != NULL)
137 {137 {
138 pIndicators->cClassIndicatorImagePath = cairo_dock_generate_file_path (cIndicatorImageName);138 pIndicators->cClassIndicatorImagePath = cairo_dock_search_image_s_path (cIndicatorImageName);
139 g_free (cIndicatorImageName);139 g_free (cIndicatorImageName);
140 }140 }
141 else141 else
142142
=== modified file 'src/gldit/cairo-dock-internal-taskbar.c'
--- src/gldit/cairo-dock-internal-taskbar.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-internal-taskbar.c 2010-10-06 17:25:57 +0000
@@ -45,70 +45,72 @@
45 // comportement45 // comportement
46 pTaskBar->bShowAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "show applications", &bFlushConfFileNeeded, TRUE, "Applications", NULL);46 pTaskBar->bShowAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "show applications", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
47 47
48 pTaskBar->bAppliOnCurrentDesktopOnly = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "current desktop only", &bFlushConfFileNeeded, FALSE, "Applications", NULL);48 if (pTaskBar->bShowAppli)
49 49 {
50 pTaskBar->bMixLauncherAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "mix launcher appli", &bFlushConfFileNeeded, TRUE, NULL, NULL);50 pTaskBar->bAppliOnCurrentDesktopOnly = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "current desktop only", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
51 51
52 pTaskBar->bGroupAppliByClass = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "group by class", &bFlushConfFileNeeded, TRUE, "Applications", NULL);52 pTaskBar->bMixLauncherAppli = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "mix launcher appli", &bFlushConfFileNeeded, TRUE, NULL, NULL);
53 pTaskBar->cGroupException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "group exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);53
54 if (pTaskBar->cGroupException)54 pTaskBar->bGroupAppliByClass = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "group by class", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
55 {55 pTaskBar->cGroupException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "group exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
56 int i;56 if (pTaskBar->cGroupException)
57 for (i = 0; pTaskBar->cGroupException[i] != '\0'; i ++) // on passe tout en minuscule.57 {
58 pTaskBar->cGroupException[i] = g_ascii_tolower (pTaskBar->cGroupException[i]);58 int i;
59 }59 for (i = 0; pTaskBar->cGroupException[i] != '\0'; i ++) // on passe tout en minuscule.
60 60 pTaskBar->cGroupException[i] = g_ascii_tolower (pTaskBar->cGroupException[i]);
61 pTaskBar->bHideVisibleApplis = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "hide visible", &bFlushConfFileNeeded, FALSE, "Applications", NULL);61 }
62 62
63 63 pTaskBar->bHideVisibleApplis = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "hide visible", &bFlushConfFileNeeded, FALSE, "Applications", NULL);
64 // representation64
65 pTaskBar->bOverWriteXIcons = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "overwrite xicon", &bFlushConfFileNeeded, TRUE, NULL, NULL);65
66 pTaskBar->cOverwriteException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "overwrite exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);66 // representation
67 if (pTaskBar->cOverwriteException)67 pTaskBar->bOverWriteXIcons = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "overwrite xicon", &bFlushConfFileNeeded, TRUE, NULL, NULL);
68 {68 pTaskBar->cOverwriteException = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "overwrite exception", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
69 int i;69 if (pTaskBar->cOverwriteException)
70 for (i = 0; pTaskBar->cOverwriteException[i] != '\0'; i ++)70 {
71 pTaskBar->cOverwriteException[i] = g_ascii_tolower (pTaskBar->cOverwriteException[i]);71 int i;
72 }72 for (i = 0; pTaskBar->cOverwriteException[i] != '\0'; i ++)
73 73 pTaskBar->cOverwriteException[i] = g_ascii_tolower (pTaskBar->cOverwriteException[i]);
74 pTaskBar->iMinimizedWindowRenderType = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "minimized", &bFlushConfFileNeeded, -1, NULL, NULL);74 }
75 if (pTaskBar->iMinimizedWindowRenderType == -1) // anciens parametres.75
76 {76 pTaskBar->iMinimizedWindowRenderType = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "minimized", &bFlushConfFileNeeded, -1, NULL, NULL);
77 gboolean bShowThumbnail = g_key_file_get_boolean (pKeyFile, "TaskBar", "window thumbnail", NULL);77 if (pTaskBar->iMinimizedWindowRenderType == -1) // anciens parametres.
78 if (bShowThumbnail)78 {
79 pTaskBar->iMinimizedWindowRenderType = 1;79 gboolean bShowThumbnail = g_key_file_get_boolean (pKeyFile, "TaskBar", "window thumbnail", NULL);
80 else80 if (bShowThumbnail)
81 pTaskBar->iMinimizedWindowRenderType = 1;
82 else
83 pTaskBar->iMinimizedWindowRenderType = 0;
84 g_key_file_set_integer (pKeyFile, "TaskBar", "minimized", pTaskBar->iMinimizedWindowRenderType);
85 }
86
87 if (pTaskBar->iMinimizedWindowRenderType == 1 && ! cairo_dock_xcomposite_is_available ())
88 {
89 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");
81 pTaskBar->iMinimizedWindowRenderType = 0;90 pTaskBar->iMinimizedWindowRenderType = 0;
82 g_key_file_set_integer (pKeyFile, "TaskBar", "minimized", pTaskBar->iMinimizedWindowRenderType);91 }
83 }92 if (pTaskBar->iMinimizedWindowRenderType == 0)
84 93 pTaskBar->fVisibleAppliAlpha = MIN (.6, cairo_dock_get_double_key_value (pKeyFile, "TaskBar", "visibility alpha", &bFlushConfFileNeeded, .35, "Applications", NULL));
85 if (pTaskBar->iMinimizedWindowRenderType == 1 && ! cairo_dock_xcomposite_is_available ())94
86 {95 pTaskBar->iAppliMaxNameLength = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "max name length", &bFlushConfFileNeeded, 15, "Applications", NULL);
87 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");96
88 pTaskBar->iMinimizedWindowRenderType = 0;97
89 }98 // interaction
90 if (pTaskBar->iMinimizedWindowRenderType == 0)99 pTaskBar->bMinimizeOnClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "minimize on click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
91 pTaskBar->fVisibleAppliAlpha = MIN (.6, cairo_dock_get_double_key_value (pKeyFile, "TaskBar", "visibility alpha", &bFlushConfFileNeeded, .35, "Applications", NULL));100 pTaskBar->bCloseAppliOnMiddleClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "close on middle click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
92 101
93 pTaskBar->iAppliMaxNameLength = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "max name length", &bFlushConfFileNeeded, 15, "Applications", NULL);102 pTaskBar->bDemandsAttentionWithDialog = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "demands attention with dialog", &bFlushConfFileNeeded, TRUE, "Applications", NULL);
94 103 pTaskBar->iDialogDuration = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "duration", &bFlushConfFileNeeded, 2, NULL, NULL);
95 104 pTaskBar->cAnimationOnDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on demands attention", &bFlushConfFileNeeded, "fire", NULL, NULL);
96 // interaction105 gchar *cForceDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "force demands attention", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);
97 pTaskBar->bMinimizeOnClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "minimize on click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);106 if (cForceDemandsAttention != NULL)
98 pTaskBar->bCloseAppliOnMiddleClick = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "close on middle click", &bFlushConfFileNeeded, TRUE, "Applications", NULL);107 {
99 108 pTaskBar->cForceDemandsAttention = g_ascii_strdown (cForceDemandsAttention, -1);
100 pTaskBar->bDemandsAttentionWithDialog = cairo_dock_get_boolean_key_value (pKeyFile, "TaskBar", "demands attention with dialog", &bFlushConfFileNeeded, TRUE, "Applications", NULL);109 g_free (cForceDemandsAttention);
101 pTaskBar->iDialogDuration = cairo_dock_get_integer_key_value (pKeyFile, "TaskBar", "duration", &bFlushConfFileNeeded, 2, NULL, NULL);110 }
102 pTaskBar->cAnimationOnDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on demands attention", &bFlushConfFileNeeded, "fire", NULL, NULL);111
103 gchar *cForceDemandsAttention = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "force demands attention", &bFlushConfFileNeeded, "pidgin;xchat", NULL, NULL);112 pTaskBar->cAnimationOnActiveWindow = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on active window", &bFlushConfFileNeeded, "wobbly", NULL, NULL);
104 if (cForceDemandsAttention != NULL)113 }
105 {
106 pTaskBar->cForceDemandsAttention = g_ascii_strdown (cForceDemandsAttention, -1);
107 g_free (cForceDemandsAttention);
108 }
109
110 pTaskBar->cAnimationOnActiveWindow = cairo_dock_get_string_key_value (pKeyFile, "TaskBar", "animation on active window", &bFlushConfFileNeeded, "wobbly", NULL, NULL);
111
112 return bFlushConfFileNeeded;114 return bFlushConfFileNeeded;
113}115}
114116
@@ -137,13 +139,13 @@
137 pPrevTaskBar->iAppliMaxNameLength != pTaskBar->iAppliMaxNameLength ||139 pPrevTaskBar->iAppliMaxNameLength != pTaskBar->iAppliMaxNameLength ||
138 cairo_dock_strings_differ (pPrevTaskBar->cGroupException, pTaskBar->cGroupException) ||140 cairo_dock_strings_differ (pPrevTaskBar->cGroupException, pTaskBar->cGroupException) ||
139 cairo_dock_strings_differ (pPrevTaskBar->cOverwriteException, pTaskBar->cOverwriteException) ||141 cairo_dock_strings_differ (pPrevTaskBar->cOverwriteException, pTaskBar->cOverwriteException) ||
140 (cairo_dock_application_manager_is_running () && ! pTaskBar->bShowAppli)) // on ne veut plus voir les applis, il faut donc les enlever.142 pPrevTaskBar->bShowAppli != pTaskBar->bShowAppli)
141 {143 {
142 cairo_dock_stop_application_manager ();144 cairo_dock_stop_application_manager ();
143 bUpdateSize = TRUE;145 bUpdateSize = TRUE;
144 }146 }
145 147
146 if (! cairo_dock_application_manager_is_running () && pTaskBar->bShowAppli) // maintenant on veut voir les applis !148 if (! cairo_dock_application_manager_is_running ()) // maintenant on veut voir les applis !
147 {149 {
148 cairo_dock_start_application_manager (pDock); // va inserer le separateur si necessaire.150 cairo_dock_start_application_manager (pDock); // va inserer le separateur si necessaire.
149 bUpdateSize = TRUE;151 bUpdateSize = TRUE;
150152
=== modified file 'src/gldit/cairo-dock-load.c'
--- src/gldit/cairo-dock-load.c 2010-09-07 00:38:36 +0000
+++ src/gldit/cairo-dock-load.c 2010-10-06 17:25:57 +0000
@@ -69,6 +69,8 @@
69extern CairoDockDesktopBackground *g_pFakeTransparencyDesktopBg;69extern CairoDockDesktopBackground *g_pFakeTransparencyDesktopBg;
7070
71extern gchar *g_cCurrentThemePath;71extern gchar *g_cCurrentThemePath;
72extern gchar *g_cCurrentIconsPath;
73extern gchar *g_cCurrentImagesPath;
7274
73extern GLuint g_pGradationTexture[2];75extern GLuint g_pGradationTexture[2];
7476
@@ -99,21 +101,44 @@
99 return pTextDescription;101 return pTextDescription;
100}102}
101103
102gchar *cairo_dock_generate_file_path (const gchar *cImageFile)104gchar *cairo_dock_search_image_s_path (const gchar *cImageFile)
103{105{
104 g_return_val_if_fail (cImageFile != NULL, NULL);106 g_return_val_if_fail (cImageFile != NULL, NULL);
105 gchar *cImagePath;107 gchar *cImagePath;
106 if (*cImageFile == '~')108 if (*cImageFile == '~')
107 {109 {
108 cImagePath = g_strdup_printf ("%s%s", getenv("HOME"), cImageFile + 1);110 cImagePath = g_strdup_printf ("%s%s", getenv("HOME"), cImageFile + 1);
111 if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
112 {
113 g_free (cImagePath);
114 cImagePath = NULL;
115 }
109 }116 }
110 else if (*cImageFile == '/')117 else if (*cImageFile == '/')
111 {118 {
112 cImagePath = g_strdup (cImageFile);119 if (!g_file_test (cImageFile, G_FILE_TEST_EXISTS))
120 cImagePath = NULL;
121 else
122 cImagePath = g_strdup (cImageFile);
113 }123 }
114 else124 else
115 {125 {
116 cImagePath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, cImageFile);126 cImagePath = g_strdup_printf ("%s/%s", g_cCurrentImagesPath, cImageFile);
127 if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
128 {
129 g_free (cImagePath);
130 cImagePath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, cImageFile);
131 if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
132 {
133 g_free (cImagePath);
134 cImagePath = g_strdup_printf ("%s/%s", g_cCurrentIconsPath, cImageFile);
135 if (!g_file_test (cImagePath, G_FILE_TEST_EXISTS))
136 {
137 g_free (cImagePath);
138 cImagePath = NULL;
139 }
140 }
141 }
117 }142 }
118 return cImagePath;143 return cImagePath;
119}144}
@@ -123,7 +148,7 @@
123{148{
124 if (cImageFile == NULL)149 if (cImageFile == NULL)
125 return;150 return;
126 gchar *cImagePath = cairo_dock_generate_file_path (cImageFile);151 gchar *cImagePath = cairo_dock_search_image_s_path (cImageFile);
127 double w, h;152 double w, h;
128 pImage->pSurface = cairo_dock_create_surface_from_image (153 pImage->pSurface = cairo_dock_create_surface_from_image (
129 cImagePath,154 cImagePath,
130155
=== modified file 'src/gldit/cairo-dock-load.h'
--- src/gldit/cairo-dock-load.h 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-load.h 2010-10-06 17:25:57 +0000
@@ -31,7 +31,7 @@
31/**31/**
32*@file cairo-dock-load.h This class defines a simple image loader interface.32*@file cairo-dock-load.h This class defines a simple image loader interface.
33* It also handles the main image buffers of the dock.33* It also handles the main image buffers of the dock.
34* 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.34* 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.
35* Use \ref cairo_dock_free_image_buffer to destroy it or \ref cairo_dock_unload_image_buffer to unload and reset it to 0.35* Use \ref cairo_dock_free_image_buffer to destroy it or \ref cairo_dock_unload_image_buffer to unload and reset it to 0.
36* If you just want to load an image into a mere cairo_surface, use the functions of the surface-factory.36* If you just want to load an image into a mere cairo_surface, use the functions of the surface-factory.
37*/37*/
@@ -72,8 +72,8 @@
72*@param cImageFile a file name or path. If it's already a path, it will just be duplicated.72*@param cImageFile a file name or path. If it's already a path, it will just be duplicated.
73*@return the path of the file.73*@return the path of the file.
74*/74*/
75gchar *cairo_dock_generate_file_path (const gchar *cImageFile);75gchar *cairo_dock_search_image_s_path (const gchar *cImageFile);
7676#define cairo_dock_generate_file_path cairo_dock_search_image_s_path
7777
78/** 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.78/** 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.
79*@param pImage an ImageBuffer.79*@param pImage an ImageBuffer.
8080
=== modified file 'src/gldit/cairo-dock-log.c'
--- src/gldit/cairo-dock-log.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-log.c 2010-10-06 17:25:57 +0000
@@ -30,7 +30,7 @@
30#include "cairo-dock-log.h"30#include "cairo-dock-log.h"
3131
32static char s_iLogColor = '0';32static char s_iLogColor = '0';
33static GLogLevelFlags s_gLogLevel = 0;33static GLogLevelFlags s_gLogLevel = G_LOG_LEVEL_WARNING;
3434
35/* # 'default' => "\033[1m", */35/* # 'default' => "\033[1m", */
3636
3737
=== modified file 'src/gldit/cairo-dock-modules.c'
--- src/gldit/cairo-dock-modules.c 2010-09-07 00:38:36 +0000
+++ src/gldit/cairo-dock-modules.c 2010-10-06 17:25:57 +0000
@@ -644,14 +644,17 @@
644 {644 {
645 cd_warning ("icon's buffer is NULL, applet won't be able to draw to it !");645 cd_warning ("icon's buffer is NULL, applet won't be able to draw to it !");
646 pInstance->pDrawContext = NULL;646 pInstance->pDrawContext = NULL;
647 bCanInit = FALSE;
647 }648 }
648 else649 else
650 {
649 pInstance->pDrawContext = cairo_create (pIcon->pIconBuffer);651 pInstance->pDrawContext = cairo_create (pIcon->pIconBuffer);
650 if (cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)652 if (!pInstance->pDrawContext || cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
651 {653 {
652 cd_warning ("couldn't initialize drawing context, applet won't be able to draw itself !");654 cd_warning ("couldn't initialize drawing context, applet won't be able to draw itself !");
653 pInstance->pDrawContext = NULL;655 pInstance->pDrawContext = NULL;
654 bCanInit = FALSE;656 bCanInit = FALSE;
657 }
655 }658 }
656 }659 }
657 660
@@ -878,7 +881,7 @@
878 if (pIcon && pIcon->pIconBuffer) // applet, on lui associe un contexte de dessin avant le reload.881 if (pIcon && pIcon->pIconBuffer) // applet, on lui associe un contexte de dessin avant le reload.
879 {882 {
880 pInstance->pDrawContext = cairo_create (pIcon->pIconBuffer);883 pInstance->pDrawContext = cairo_create (pIcon->pIconBuffer);
881 if (cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)884 if (!pInstance->pDrawContext || cairo_status (pInstance->pDrawContext) != CAIRO_STATUS_SUCCESS)
882 {885 {
883 cd_warning ("couldn't initialize drawing context, applet won't be reloaded !");886 cd_warning ("couldn't initialize drawing context, applet won't be reloaded !");
884 bCanReload = FALSE;887 bCanReload = FALSE;
@@ -1385,6 +1388,7 @@
1385#define REGISTER_INTERNAL_MODULE(cGroupName) \1388#define REGISTER_INTERNAL_MODULE(cGroupName) \
1386 pModule = g_new0 (CairoDockInternalModule, 1);\1389 pModule = g_new0 (CairoDockInternalModule, 1);\
1387 cairo_dock_pre_init_##cGroupName (pModule);\1390 cairo_dock_pre_init_##cGroupName (pModule);\
1391 memset (pModule->pConfig, 0, pModule->iSizeOfConfig);\
1388 g_hash_table_insert (pModuleTable, (gpointer)pModule->cModuleName, pModule)1392 g_hash_table_insert (pModuleTable, (gpointer)pModule->cModuleName, pModule)
1389void cairo_dock_preload_internal_modules (GHashTable *pModuleTable)1393void cairo_dock_preload_internal_modules (GHashTable *pModuleTable)
1390{1394{
13911395
=== modified file 'src/gldit/cairo-dock-separator-manager.c'
--- src/gldit/cairo-dock-separator-manager.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-separator-manager.c 2010-10-06 17:25:57 +0000
@@ -51,7 +51,7 @@
51 }51 }
52 else52 else
53 {53 {
54 gchar *cImagePath = cairo_dock_generate_file_path (myIcons.cSeparatorImage);54 gchar *cImagePath = cairo_dock_search_image_s_path (myIcons.cSeparatorImage);
55 55
56 pNewSurface = cairo_dock_create_surface_from_image_simple (cImagePath,56 pNewSurface = cairo_dock_create_surface_from_image_simple (cImagePath,
57 iWidth,57 iWidth,
5858
=== modified file 'src/gldit/cairo-dock-surface-factory.c'
--- src/gldit/cairo-dock-surface-factory.c 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-surface-factory.c 2010-10-06 17:25:57 +0000
@@ -28,10 +28,12 @@
28#include "cairo-dock-launcher-manager.h"28#include "cairo-dock-launcher-manager.h"
29#include "cairo-dock-container.h"29#include "cairo-dock-container.h"
30#include "cairo-dock-load.h"30#include "cairo-dock-load.h"
31#include "cairo-dock-X-manager.h"
31#include "cairo-dock-surface-factory.h"32#include "cairo-dock-surface-factory.h"
3233
33extern CairoContainer *g_pPrimaryContainer;34extern CairoContainer *g_pPrimaryContainer;
34extern gboolean g_bUseOpenGL;35extern gboolean g_bUseOpenGL;
36extern CairoDockDesktopGeometry g_desktopGeometry;
3537
36static cairo_t *s_pSourceContext = NULL;38static cairo_t *s_pSourceContext = NULL;
3739
@@ -548,7 +550,7 @@
548 if (*cImageFile == '/')550 if (*cImageFile == '/')
549 cImagePath = (gchar *)cImageFile;551 cImagePath = (gchar *)cImageFile;
550 else552 else
551 cImagePath = cairo_dock_generate_file_path (cImageFile);553 cImagePath = cairo_dock_search_image_s_path (cImageFile);
552 554
553 cairo_surface_t *pSurface = cairo_dock_create_surface_from_image (cImagePath,555 cairo_surface_t *pSurface = cairo_dock_create_surface_from_image (cImagePath,
554 1.,556 1.,
@@ -594,7 +596,7 @@
594596
595 if (cImageFile != NULL)597 if (cImageFile != NULL)
596 {598 {
597 gchar *cImagePath = cairo_dock_generate_file_path (cImageFile);599 gchar *cImagePath = cairo_dock_search_image_s_path (cImageFile);
598 double fImageWidth, fImageHeight;600 double fImageWidth, fImageHeight;
599 cairo_surface_t *pPatternSurface = cairo_dock_create_surface_from_image (cImagePath,601 cairo_surface_t *pPatternSurface = cairo_dock_create_surface_from_image (cImagePath,
600 1.,602 1.,
@@ -785,6 +787,79 @@
785}787}
786788
787789
790void cairo_dock_limit_string_width (gchar *cLine, PangoLayout *pLayout, gboolean bUseMarkup, int iMaxWidth)
791{
792 // on insere des retours chariot pour tenir dans la largeur donnee.
793 PangoRectangle ink, log;
794 gchar *sp, *last_sp=NULL;
795 double w;
796 int iNbLines = 0;
797
798 gchar *str = cLine;
799 while (*str == ' ') // on saute les espaces en debut de ligne.
800 str ++;
801
802 sp = str;
803 do
804 {
805 sp = strchr (sp+1, ' '); // on trouve l'espace suivant.
806 if (!sp) // plus d'espace, on quitte.
807 break ;
808
809 *sp = '\0'; // on coupe a cet espace.
810 if (bUseMarkup) // on regarde la taille de str a sp.
811 pango_layout_set_markup (pLayout, str, -1);
812 else
813 pango_layout_set_text (pLayout, str, -1);
814 pango_layout_get_pixel_extents (pLayout, &ink, &log);
815 //g_print ("%s => w:%d/%d, x:%d/%d\n", str, log.width, ink.width, log.x, ink.x);
816 w = log.width + log.x;
817
818 if (w > iMaxWidth) // on deborde.
819 {
820 if (last_sp != NULL) // on coupe au dernier espace connu.
821 {
822 *sp = ' '; // on remet l'espace.
823 *last_sp = '\n'; // on coupe.
824 iNbLines ++;
825 str = last_sp + 1; // on place le debut de ligne apres la coupure.
826 }
827 else // aucun espace, c'est un mot entier.
828 {
829 *sp = '\n'; // on coupe apres le mot.
830 iNbLines ++;
831 str = sp + 1; // on place le debut de ligne apres la coupure.
832 }
833
834 while (*str == ' ') // on saute les espaces en debut de ligne.
835 str ++;
836 sp = str;
837 last_sp = NULL;
838 }
839 else // ca rentre.
840 {
841 *sp = ' '; // on remet l'espace.
842 last_sp = sp; // on memorise la derniere cesure qui fait tenir la ligne en largeur.
843 sp ++; // on se place apres.
844 while (*sp == ' ') // on saute tous les espaces.
845 sp ++;
846 }
847 } while (sp);
848
849 // dernier mot.
850 if (bUseMarkup) // on regarde la taille de str a sp.
851 pango_layout_set_markup (pLayout, str, -1);
852 else
853 pango_layout_set_text (pLayout, str, -1);
854 pango_layout_get_pixel_extents (pLayout, &ink, &log);
855 w = log.width + log.x;
856 if (w > iMaxWidth) // on deborde.
857 {
858 if (last_sp != NULL) // on coupe au dernier espace connu.
859 *last_sp = '\n';
860 }
861}
862
788cairo_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)863cairo_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)
789{864{
790 g_return_val_if_fail (cText != NULL && pLabelDescription != NULL, NULL);865 g_return_val_if_fail (cText != NULL && pLabelDescription != NULL, NULL);
@@ -805,20 +880,52 @@
805 880
806 pango_layout_set_text (pLayout, "|", -1); // donne la hauteur max des lettres.881 pango_layout_set_text (pLayout, "|", -1); // donne la hauteur max des lettres.
807 pango_layout_get_pixel_extents (pLayout, &ink, &log);882 pango_layout_get_pixel_extents (pLayout, &ink, &log);
808 int iMaxSize = ink.height;883 int iMinSize = ink.height; // hauteur min = au moins la plus grande lettre pour une uniformite des labels.
809 884
810 if (pLabelDescription->bUseMarkup)885 if (pLabelDescription->bUseMarkup)
811 pango_layout_set_markup (pLayout, cText, -1);886 pango_layout_set_markup (pLayout, cText, -1);
812 else887 else
813 pango_layout_set_text (pLayout, cText, -1);888 pango_layout_set_text (pLayout, cText, -1);
814 889
890 //\_________________ On insere des retours chariot si necessaire.
891 pango_layout_get_pixel_extents (pLayout, &ink, &log);
892
893 if (pLabelDescription->fMaxRelativeWidth != 0)
894 {
895 int iMaxLineWidth = pLabelDescription->fMaxRelativeWidth * g_desktopGeometry.iScreenWidth[CAIRO_DOCK_HORIZONTAL];
896 int w = ink.width;
897 //g_print ("text width : %d / %d\n", w, iMaxLineWidth);
898 if (w > iMaxLineWidth) // le texte est trop long.
899 {
900 // on decoupe le texte en lignes et on limite chaque ligne trop longue.
901 gchar *sp, *last_sp=NULL;
902 gchar **cLines = g_strsplit (cText, "\n", -1);
903 gchar *cLine;
904 int i;
905 for (i = 0; cLines[i] != NULL; i ++)
906 {
907 cLine = cLines[i];
908 cairo_dock_limit_string_width (cLine, pLayout, pLabelDescription->bUseMarkup, iMaxLineWidth);
909 g_print (" + %s\n", cLine);
910 }
911
912 // on reforme le texte et on le passe a pango.
913 gchar *cCutText = g_strjoinv ("\n", cLines);
914 if (pLabelDescription->bUseMarkup)
915 pango_layout_set_markup (pLayout, cCutText, -1);
916 else
917 pango_layout_set_text (pLayout, cCutText, -1);
918 pango_layout_get_pixel_extents (pLayout, &ink, &log);
919 g_strfreev (cLines);
920 g_free (cCutText);
921 }
922 }
923
815 //\_________________ On cree une surface aux dimensions du texte.924 //\_________________ On cree une surface aux dimensions du texte.
816 pango_layout_get_pixel_extents (pLayout, &ink, &log);
817
818 gboolean bDrawBackground = (pLabelDescription->fBackgroundColor != NULL && pLabelDescription->fBackgroundColor[3] > 0);925 gboolean bDrawBackground = (pLabelDescription->fBackgroundColor != NULL && pLabelDescription->fBackgroundColor[3] > 0);
819 double fRadius = fMaxScale * MAX (pLabelDescription->iMargin, MIN (6, pLabelDescription->iSize/3)); // permet d'avoir un rayon meme si on n'a pas de marge.926 double fRadius = fMaxScale * MAX (pLabelDescription->iMargin, MIN (6, pLabelDescription->iSize/3)); // permet d'avoir un rayon meme si on n'a pas de marge.
820 int iOutlineMargin = 2*pLabelDescription->iMargin + (pLabelDescription->bOutlined ? 2 : 0); // outlined => +1 tout autour des lettres.927 int iOutlineMargin = 2*pLabelDescription->iMargin + (pLabelDescription->bOutlined ? 2 : 0); // outlined => +1 tout autour des lettres.
821 double fZoomX = ((iMaxWidth != 0 && ink.width + iOutlineMargin > iMaxWidth) ? 1.*iMaxWidth / (ink.width + iOutlineMargin) : 1.);928 double fZoomX = ((iMaxWidth != 0 && ink.width + iOutlineMargin > iMaxWidth) ? (double)iMaxWidth / (ink.width + iOutlineMargin) : 1.);
822 929
823 *iTextWidth = (ink.width + iOutlineMargin) * fZoomX; // le texte + la marge de chaque cote.930 *iTextWidth = (ink.width + iOutlineMargin) * fZoomX; // le texte + la marge de chaque cote.
824 if (bDrawBackground) // quand on trace le cadre, on evite qu'avec des petits textes genre "1" on obtienne un fond tout rond.931 if (bDrawBackground) // quand on trace le cadre, on evite qu'avec des petits textes genre "1" on obtienne un fond tout rond.
@@ -827,7 +934,7 @@
827 if (iMaxWidth != 0 && *iTextWidth > iMaxWidth)934 if (iMaxWidth != 0 && *iTextWidth > iMaxWidth)
828 *iTextWidth = iMaxWidth;935 *iTextWidth = iMaxWidth;
829 }936 }
830 *iTextHeight = MAX (iMaxSize, ink.height) + iOutlineMargin + 0; // +1 car certaines polices "debordent".937 *iTextHeight = MAX (iMinSize, ink.height) + iOutlineMargin + 0; // +1 car certaines polices "debordent".
831 938
832 cairo_surface_t* pNewSurface = cairo_dock_create_blank_surface (939 cairo_surface_t* pNewSurface = cairo_dock_create_blank_surface (
833 *iTextWidth,940 *iTextWidth,
834941
=== modified file 'src/gldit/cairo-dock-surface-factory.h'
--- src/gldit/cairo-dock-surface-factory.h 2010-08-07 01:28:23 +0000
+++ src/gldit/cairo-dock-surface-factory.h 2010-10-06 17:25:57 +0000
@@ -38,6 +38,7 @@
38* 38*
39* 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.39* 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.
40*40*
41* 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).
41*/42*/
4243
43/// Types of image loading modifiers.44/// Types of image loading modifiers.
@@ -90,6 +91,8 @@
90 gint iMargin;91 gint iMargin;
91 /// 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;")92 /// 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;")
92 gboolean bUseMarkup;93 gboolean bUseMarkup;
94 /// maximum width allowed, in ratio of the screen's width. Carriage returns will be inserted if necessary. 0 means no limit.
95 gdouble fMaxRelativeWidth;
93};96};
9497
9598
9699
=== modified file 'src/gldit/cairo-dock-themes-manager.c'
--- src/gldit/cairo-dock-themes-manager.c 2010-09-16 01:04:13 +0000
+++ src/gldit/cairo-dock-themes-manager.c 2010-10-06 17:25:57 +0000
@@ -49,6 +49,7 @@
49gchar *g_cThemesDirPath = NULL; // le chemin vers le repertoire des themes.49gchar *g_cThemesDirPath = NULL; // le chemin vers le repertoire des themes.
50gchar *g_cCurrentLaunchersPath = NULL; // le chemin vers le repertoire des lanceurs du theme courant.50gchar *g_cCurrentLaunchersPath = NULL; // le chemin vers le repertoire des lanceurs du theme courant.
51gchar *g_cCurrentIconsPath = NULL; // le chemin vers le repertoire des icones du theme courant.51gchar *g_cCurrentIconsPath = NULL; // le chemin vers le repertoire des icones du theme courant.
52gchar *g_cCurrentImagesPath = NULL; // le chemin vers le repertoire des images ou autre du theme courant.
52gchar *g_cCurrentPlugInsPath = NULL; // le chemin vers le repertoire des plug-ins du theme courant.53gchar *g_cCurrentPlugInsPath = NULL; // le chemin vers le repertoire des plug-ins du theme courant.
53gchar *g_cConfFile = NULL; // le chemin du fichier de conf.54gchar *g_cConfFile = NULL; // le chemin du fichier de conf.
54int g_iMajorVersion, g_iMinorVersion, g_iMicroVersion; // version de la lib.55int g_iMajorVersion, g_iMinorVersion, g_iMicroVersion; // version de la lib.
@@ -59,6 +60,7 @@
59#define CAIRO_DOCK_LAUNCHERS_DIR "launchers"60#define CAIRO_DOCK_LAUNCHERS_DIR "launchers"
60#define CAIRO_DOCK_PLUG_INS_DIR "plug-ins"61#define CAIRO_DOCK_PLUG_INS_DIR "plug-ins"
61#define CAIRO_DOCK_LOCAL_ICONS_DIR "icons"62#define CAIRO_DOCK_LOCAL_ICONS_DIR "icons"
63#define CAIRO_DOCK_LOCAL_IMAGES_DIR "images"
6264
63void cairo_dock_mark_current_theme_as_modified (gboolean bModified)65void cairo_dock_mark_current_theme_as_modified (gboolean bModified)
64{66{
@@ -547,6 +549,7 @@
547 g_cCurrentLaunchersPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LAUNCHERS_DIR);549 g_cCurrentLaunchersPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LAUNCHERS_DIR);
548 _check_dir (g_cCurrentLaunchersPath);550 _check_dir (g_cCurrentLaunchersPath);
549 g_cCurrentIconsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LOCAL_ICONS_DIR);551 g_cCurrentIconsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LOCAL_ICONS_DIR);
552 g_cCurrentImagesPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_LOCAL_IMAGES_DIR);
550 _check_dir (g_cCurrentIconsPath);553 _check_dir (g_cCurrentIconsPath);
551 g_cCurrentPlugInsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_PLUG_INS_DIR);554 g_cCurrentPlugInsPath = g_strdup_printf ("%s/%s", g_cCurrentThemePath, CAIRO_DOCK_PLUG_INS_DIR);
552 _check_dir (g_cCurrentPlugInsPath);555 _check_dir (g_cCurrentPlugInsPath);

Subscribers

People subscribed via source and target branches