Awn

Merge lp:~malept/awn/0.4-libdesktop-agnostic into lp:~awn-core/awn/trunk-rewrite

Proposed by Mark Lee
Status: Merged
Approved by: Mark Lee
Approved revision: 847
Merged at revision: 1200
Proposed branch: lp:~malept/awn/0.4-libdesktop-agnostic
Merge into: lp:~awn-core/awn/trunk-rewrite
Diff against target: None lines
To merge this branch: bzr merge lp:~malept/awn/0.4-libdesktop-agnostic
Reviewer Review Type Date Requested Status
moonbeam Approve
Review via email: mp+9798@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Mark Lee (malept) wrote :

84 files changed, 2253 insertions(+), 7731 deletions(-)

Revision history for this message
moonbeam (rcryderman) wrote :

ok... Huge merge. I haven't reviewed it as such. I say let's just go for it and hope for the best. Anything that breaks will get fixed.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
=== modified file '.bzrignore'
--- .bzrignore 2009-07-15 17:12:11 +0000
+++ .bzrignore 2009-07-27 18:28:46 +0000
@@ -45,7 +45,6 @@
45libawn/*awn-enum-types.*45libawn/*awn-enum-types.*
46libawn/*libawnmarshal.*46libawn/*libawnmarshal.*
47libawn/libawn-marshal.*47libawn/libawn-marshal.*
48libawn/egg/*egg-enum-types.*
49bindings/python/awn.c48bindings/python/awn.c
50awn-manager/awnDefs.py49awn-manager/awnDefs.py
51awn-manager/awnManager.py50awn-manager/awnManager.py
@@ -77,11 +76,11 @@
77doc/reference/tmpl/*.sgml76doc/reference/tmpl/*.sgml
78doc/reference/tmpl/*.sgml.bak77doc/reference/tmpl/*.sgml.bak
79doc/reference/*-scan.c78doc/reference/*-scan.c
80data/awn.schemas*79data/avant-window-navigator.schemas*
81config.h.in80config.h.in
82test/vala-test81test/vala-test
83awn-manager/awn-launcher-editor82awn-manager/awn-launcher-editor
84data/awn.schema-ini83data/avant-window-navigator.schema-ini
85src/awn84src/awn
86src/awn-app-glue.h85src/awn-app-glue.h
87src/awn-panel-glue.h86src/awn-panel-glue.h
@@ -93,8 +92,7 @@
93tests/test-themed-icon92tests/test-themed-icon
94tests/test-awn-icon-box93tests/test-awn-icon-box
95./tests/test-taskmanager94./tests/test-taskmanager
96applets/taskmanager/taskmanager.schemas95applets/taskmanager/awn-applet-taskmanager.schemas*
97applets/taskmanager/taskmanager.schemas.in
98tests/test-awn-effects96tests/test-awn-effects
99awn-manager/awnManagerMini.py97awn-manager/awnManagerMini.py
100m4/gtk-doc.m498m4/gtk-doc.m4
10199
=== modified file 'ChangeLog'
--- ChangeLog 2009-08-06 06:57:04 +0000
+++ ChangeLog 2009-08-06 20:35:34 +0000
@@ -1,3 +1,27 @@
12009-08-06 Mark Lee <avant-wn@lazymalevolence.com>
2
3 * bindings/python/Makefile.am:
4 * bindings/python/awn.defs:
5 * bindings/python/awn.override:
6 * configure.in:
7 Add/fix Python bindings with regards to functions which depend on the
8 libdesktop-agnostic Python bindings.
9
102009-08-06 Mark Lee <avant-wn@lazymalevolence.com>
11
12 * applets/taskmanager/task-launcher.c:
13 * applets/taskmanager/task-manager.c:
14 * applets/taskmanager/util.c:
15 * applets/taskmanager/util.h:
16 * awn-applet-activation/main.c:
17 Update due to naming changes in the libdesktop-agnostic desktop
18 entry API.
19
202009-08-06 Mark Lee <avant-wn@lazymalevolence.com>
21
22 * applets/taskmanager/task-settings.c (cfg_load_int):
23 Update due to a change in the libdesktop-agnostic config API.
24
12009-08-06 Michal Hruby <michal.mhr@gmail.com>252009-08-06 Michal Hruby <michal.mhr@gmail.com>
226
3 * libawn/awn-cairo-utils.c:27 * libawn/awn-cairo-utils.c:
@@ -25,6 +49,23 @@
25 On TaskIcon click... Better to check if active (and then do a minimize)49 On TaskIcon click... Better to check if active (and then do a minimize)
26 first instead of checking if minimized (and then do a restore).50 first instead of checking if minimized (and then do a restore).
2751
522009-08-05 Mark Lee <avant-wn@lazymalevolence.com>
53
54 * Makefile.schemas:
55 * configure.in:
56 * data/Makefile.am:
57 * data/awn-schema-to-gconf (removed):
58 * debian/awn-settings-trunk.install:
59 * debian/control:
60 Replace awn-schema-to-gconf with the equivalent program packaged
61 with libdesktop-agnostic.
62
632009-08-04 Mark Lee <avant-wn@lazymalevolence.com>
64
65 * applets/taskmanager/task-manager.c:
66 Convert the launcher_paths member to a GValueArray, to avoid
67 converting to and from GSList.
68
282009-08-04 Rodney Cryderman <rcryderman@gmail.com>692009-08-04 Rodney Cryderman <rcryderman@gmail.com>
2970
30 * applets/taskmanager/task-icon.c:71 * applets/taskmanager/task-icon.c:
@@ -374,6 +415,13 @@
374 Close dialog on icon click if it is open.415 Close dialog on icon click if it is open.
375 Add some comments to the clicked signal handler.416 Add some comments to the clicked signal handler.
376417
4182009-07-27 Mark Lee <avant-wn@lazymalevolence.com>
419
420 * doc/reference/libawn-docs.sgml:
421 Add the awn-config page to the documentation.
422 * libawn/awn-config.c:
423 Fix the gtk-doc documentation.
424
3772009-07-27 Rodney Cryderman <rcryderman@gmail.com>4252009-07-27 Rodney Cryderman <rcryderman@gmail.com>
378426
379 * applets/taskmanager/task-icon.c:427 * applets/taskmanager/task-icon.c:
@@ -525,6 +573,11 @@
525 Looks for a desktop file to associate with windows that are not 573 Looks for a desktop file to associate with windows that are not
526 already associated with a TaskLauncher.574 already associated with a TaskLauncher.
527575
5762009-07-24 Mark Lee <avant-wn@lazymalevolence.com>
577
578 * libawn/awn-dialog.c (awn_dialog_constructed):
579 Fix typo.
580
5282009-07-24 Michal Hruby <michal.mhr@gmail.com>5812009-07-24 Michal Hruby <michal.mhr@gmail.com>
529582
530 * awn-settings/awn-settings.xml:583 * awn-settings/awn-settings.xml:
@@ -641,6 +694,11 @@
641 * applets/taskmanager/task-launcher.c:694 * applets/taskmanager/task-launcher.c:
642 Small style cleanup.695 Small style cleanup.
643696
6972009-07-21 Mark Lee <avant-wn@lazymalevolence.com>
698
699 * libawn/awn-utils.h (awn_utils_gslist_to_gvaluearray):
700 Fix gtk-doc.
701
6442009-07-21 Michal Hruby <michal.mhr@gmail.com>7022009-07-21 Michal Hruby <michal.mhr@gmail.com>
645703
646 * data/awn.schema-ini.in:704 * data/awn.schema-ini.in:
@@ -657,6 +715,29 @@
657715
6582009-07-20 Mark Lee <avant-wn@lazymalevolence.com>7162009-07-20 Mark Lee <avant-wn@lazymalevolence.com>
659717
718 * libawn/awn-overlay-text.c (awn_overlay_text_constructed,
719 awn_overlay_text_class_init):
720 * libawn/awn-tooltip.c (awn_tooltip_get_property,
721 awn_tooltip_set_property, awn_tooltip_finalize,
722 awn_tooltip_class_init, ensure_tooltip, awn_tooltip_set_font_color,
723 awn_tooltip_set_background_color):
724 * libawn/awn-tooltip.h:
725 Fix/convert color-related code.
726
7272009-07-20 Mark Lee <avant-wn@lazymalevolence.com>
728
729 * src/awn-applet-manager.c (awn_applet_manager_constructed,
730 set_list_property, awn_applet_manager_set_property):
731 Fix typo.
732 Fix setting list properties.
733
7342009-07-20 Mark Lee <avant-wn@lazymalevolence.com>
735
736 * applets/taskmanager/awn-applet-taskmanager.schema-ini:
737 Fix schema type names.
738
7392009-07-20 Mark Lee <avant-wn@lazymalevolence.com>
740
660 * applets/taskmanager/taskmanager.schema-ini:741 * applets/taskmanager/taskmanager.schema-ini:
661 Fix the match_strength default so that it's a valid value.742 Fix the match_strength default so that it's a valid value.
662743
@@ -687,6 +768,29 @@
687 * src/awn-monitor.c:768 * src/awn-monitor.c:
688 Auto-config when using multiple monitors now really works.769 Auto-config when using multiple monitors now really works.
689770
7712009-07-18 Mark Lee <avant-wn@lazymalevolence.com>
772
773 * src/awn-applet-manager.c (awn_applet_manager_get_property,
774 awn_applet_manager_set_property, awn_applet_manager_class_init):
775 * src/awn-background.c (awn_background_set_property,
776 awn_background_class_init):
777 * src/awn-monitor.c (awn_monitor_get_property,
778 awn_monitor_set_property, awn_monitor_class_init):
779 * src/awn-panel.c (awn_panel_get_property, awn_panel_set_property,
780 awn_panel_class_init):
781 Fix property types.
782
7832009-07-18 Mark Lee <avant-wn@lazymalevolence.com>
784
785 * libawn/awn-utils.h:
786 Fix gtk-doc.
787
7882009-07-18 Mark Lee <avant-wn@lazymalevolence.com>
789
790 * applets/taskmanager/task-launcher.c:
791 * awn-applet-activation/main.c:
792 Update due to the VFS API change in libdesktop-agnostic.
793
6902009-07-17 Mark Lee <avant-wn@lazymalevolence.com>7942009-07-17 Mark Lee <avant-wn@lazymalevolence.com>
691795
692 * Makefile.marshal:796 * Makefile.marshal:
@@ -704,6 +808,20 @@
704 * doc/reference/libawn.types:808 * doc/reference/libawn.types:
705 Update the doc templates.809 Update the doc templates.
706810
8112009-07-17 Mark Lee <avant-wn@lazymalevolence.com>
812
813 * doc/reference/libawn-sections.txt:
814 * libawn/awn-utils.c (awn_utils_ensure_transparent_bg,
815 awn_utils_gslist_to_gvaluearray):
816 * libawn/awn-utils.h:
817 Add awn_utils_gslist_to_gvaluearray(), to make converting between the two
818 structures easier.
819 * src/awn-applet-manager.c (awn_applet_manager_get_property,
820 awn_ua_add_applet):
821 Convert to use the new function.
822 * src/awn-ua-alignment.c (awn_ua_alignment_plug_removed):
823 Convert to use the libdesktop-agnostic API.
824
7072009-07-17 Rodney Cryderman <rcryderman@gmail.com>8252009-07-17 Rodney Cryderman <rcryderman@gmail.com>
708826
709 * src/awn-ua-alignment.c:827 * src/awn-ua-alignment.c:
@@ -771,6 +889,26 @@
771 Improved the task matching. Please test with a match strength889 Improved the task matching. Please test with a match strength
772 of 99. Especially interested in false positives.890 of 99. Especially interested in false positives.
773891
8922009-07-15 Mark Lee <avant-wn@lazymalevolence.com>
893
894 * applets/taskmanager/task-icon.c (task_icon_dest_drag_data_received):
895 * awn-applet-activation/main.c (main):
896 * libawn/awn-utils.c (awn_vfs_init):
897 * src/awn-main.c (main):
898 Update to use the new libdesktop-agnostic VFS convenience API.
899
9002009-07-15 Mark Lee <avant-wn@lazymalevolence.com>
901
902 * applets/taskmanager/task-icon.c (task_icon_dispose,
903 task_icon_finalize, do_bind_property,
904 task_icon_constructed):
905 Convert to use the libdesktop-agnostic config API.
906
9072009-07-15 Mark Lee <avant-wn@lazymalevolence.com>
908
909 * data/avant-window-navigator.schema-ini.in:
910 Fix keys that should be labeled as colors.
911
7742009-07-15 Rodney Cryderman <rcryderman@gmail.com>9122009-07-15 Rodney Cryderman <rcryderman@gmail.com>
775913
776 * applets/taskmanager/task-icon.c:914 * applets/taskmanager/task-icon.c:
@@ -799,6 +937,19 @@
799 * applets/taskmanager/task-icon.c:937 * applets/taskmanager/task-icon.c:
800 awn_icon_set_indicator_count() deals with values >3 intelligently.938 awn_icon_set_indicator_count() deals with values >3 intelligently.
801939
9402009-07-14 Mark Lee <avant-wn@lazymalevolence.com>
941
942 * libawn/awn-label.c (do_bind_property, awn_label_constructed,
943 awn_label_get_property, awn_label_set_property,
944 awn_label_class_init):
945 Convert to use the libdesktop-agnostic config API.
946
9472009-07-14 Mark Lee <avant-wn@lazymalevolence.com>
948
949 * bindings/python/awnmodule.c:
950 * src/awn-main.c (main):
951 Remove obsolete usage of preprocessor variable.
952
8022009-07-14 Rodney Cryderman <rcryderman@gmail.com>9532009-07-14 Rodney Cryderman <rcryderman@gmail.com>
803954
804 * applets/taskmanager/task-icon.c:955 * applets/taskmanager/task-icon.c:
@@ -887,6 +1038,39 @@
887 * bindings/python/Makefile.am:1038 * bindings/python/Makefile.am:
888 Shave-ify the Python bindings generator command.1039 Shave-ify the Python bindings generator command.
8891040
10412009-07-13 Mark Lee <avant-wn@lazymalevolence.com>
1042
1043 * applets/taskmanager/task-manager.c (task_manager_class_init,
1044 task_manager_size_changed, task_manager_dispose):
1045 * libawn/awn-dialog.c (awn_dialog_set_property, awn_dialog_finalize):
1046 * libawn/awn-icon.c (awn_icon_set_property, awn_icon_dispose):
1047 * libawn/awn-overlay-text.c (awn_overlay_text_set_property,
1048 awn_overlay_text_dispose):
1049 * libawn/awn-tooltip.c (awn_tooltip_set_property, awn_tooltip_dispose):
1050 * src/awn-applet-manager.c (awn_applet_manager_dispose):
1051 * src/awn-background.c (awn_background_finalize):
1052 * src/awn-monitor.c (awn_monitor_dispose, awn_monitor_class_init):
1053 * src/awn-panel.c (awn_panel_dispose):
1054 Clean up the config key <-> property bindings when the object is garbage
1055 collected.
1056
10572009-07-13 Mark Lee <avant-wn@lazymalevolence.com>
1058
1059 * applets/taskmanager/task-icon.c:
1060 * applets/taskmanager/task-launcher.c:
1061 * awn-applet-activation/main.c:
1062 * libawn/awn-config.h:
1063 * libawn/awn-utils.c:
1064 * src/awn-main.c:
1065 * src/awn-monitor.h:
1066 * src/awn-panel.h:
1067 Update #includes due to libdesktop-agnostic changes.
1068
10692009-07-12 Mark Lee <avant-wn@lazymalevolence.com>
1070
1071 * libawn/awn-defines.h (AWN_PANEL_ID_DEFAULT):
1072 Fix gtk-doc.
1073
8902009-07-12 Rodney Cryderman <rcryderman@gmail.com>10742009-07-12 Rodney Cryderman <rcryderman@gmail.com>
8911075
892 * libawn/awn-themed-icon.c:1076 * libawn/awn-themed-icon.c:
@@ -1003,6 +1187,11 @@
1003 awn-applet-activation -> awn-applet.1187 awn-applet-activation -> awn-applet.
1004 Attempt to rename the process was removed.1188 Attempt to rename the process was removed.
10051189
11902009-07-08 Mark Lee <avant-wn@lazymalevolence.com>
1191
1192 * libawn/awn-config.c:
1193 Handle single-instance applets when the mode is denoted in the UID.
1194
10062009-07-08 Michal Hruby <michal.mhr@gmail.com>11952009-07-08 Michal Hruby <michal.mhr@gmail.com>
10071196
1008 * libawn/awn-applet.c:1197 * libawn/awn-applet.c:
@@ -1017,6 +1206,26 @@
1017 A couple of changes to get proper shape mask support.1206 A couple of changes to get proper shape mask support.
1018 Started the workaround for D&D deadzone.1207 Started the workaround for D&D deadzone.
10191208
12092009-07-08 Mark Lee <avant-wn@lazymalevolence.com>
1210
1211 * data/avant-window-navigator.schema-ini.in:
1212 Fix shared config option types.
1213
12142009-07-07 Mark Lee <avant-wn@lazymalevolence.com>
1215
1216 * awn.pc.in:
1217 Remove obsolete variable from pkgconfig file.
1218
12192009-07-07 Mark Lee <avant-wn@lazymalevolence.com>
1220
1221 * applets/taskmanager/task-settings.c (cfg_notify_int):
1222 Update due to API change in libdesktop-agnostic.
1223
12242009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
1225
1226 * applets/taskmanager/task-manager.c:
1227 Launchers work again.
1228
10202009-07-06 Mark Lee <avant-wn@lazymalevolence.com>12292009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
10211230
1022 * doc/reference/libawn-sections.txt:1231 * doc/reference/libawn-sections.txt:
@@ -1033,6 +1242,24 @@
10331242
10342009-07-06 Mark Lee <avant-wn@lazymalevolence.com>12432009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
10351244
1245 * data/awn-schema-to-gconf (main):
1246 The third argument is now mandatory.
1247 Applets are no longer nested in the avant-window-navigator directory.
1248
12492009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
1250
1251 * Makefile.marshal:
1252 * Makefile.schemas:
1253 * Makefile.shave:
1254 * applets/taskmanager/Makefile.am:
1255 * data/Makefile.am:
1256 * src/Makefile.am:
1257 Modularize the shave-related variables into its own Makefile.
1258 Modularize the schema-related variables/rules into its own Makefile.
1259 Use shave when generating the GConf schemas.
1260
12612009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
1262
1036 * .bzrignore:1263 * .bzrignore:
1037 * data/Makefile.am:1264 * data/Makefile.am:
1038 * data/awn.schema-ini.in:1265 * data/awn.schema-ini.in:
@@ -1041,6 +1268,24 @@
10411268
10422009-07-06 Mark Lee <avant-wn@lazymalevolence.com>12692009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
10431270
1271 * data/awn-schema-to-gconf:
1272 Make sure types are converted properly.
1273
12742009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
1275
1276 * data/avant-window-navigator.schema-ini.in:
1277 Fix types.
1278
12792009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
1280
1281 * applets/taskmanager/Makefile.am:
1282 * configure.in:
1283 * data/Makefile.am:
1284 Only install the schema files if requested.
1285 Make the schema config conversion rule more generic.
1286
12872009-07-06 Mark Lee <avant-wn@lazymalevolence.com>
1288
1044 * applets/expander/Makefile.am:1289 * applets/expander/Makefile.am:
1045 Remove unnecessary linking.1290 Remove unnecessary linking.
10461291
@@ -1102,6 +1347,29 @@
1102 * tests/test-effects.py:1347 * tests/test-effects.py:
1103 Various fixes.1348 Various fixes.
11041349
13502009-07-05 Mark Lee <avant-wn@lazymalevolence.com>
1351
1352 * .bzrignore:
1353 * applets/taskmanager/Makefile.am:
1354 * applets/taskmanager/awn-applet-taskmanager.schema-ini:
1355 Rename schema file.
1356 * applets/taskmanager/task-manager.c (task_manager_get_property,
1357 task_manager_set_property, task_manager_constructed):
1358 Continue converting taskmanager to use the libdesktop-agnostic config
1359 API.
1360
13612009-07-04 Mark Lee <avant-wn@lazymalevolence.com>
1362
1363 * libawn/awn-config.c (awn_config_get_default,
1364 awn_config_get_default_for_applet,
1365 awn_config_get_default_for_applet_by_info):
1366 Implement the convenience methods for creating applet config objects.
1367 Fix potential crasher.
1368
13692009-07-04 Mark Lee <avant-wn@lazymalevolence.com>
1370
1371 * libawn/awn-dialog.c:
1372 Convert color properties to be of type DesktopAgnosticColor*.
11052009-07-04 Mark Lee <avant-wn@lazymalevolence.com>13732009-07-04 Mark Lee <avant-wn@lazymalevolence.com>
11061374
1107 * applets/taskmanager/task-item.c (task_item_init):1375 * applets/taskmanager/task-item.c (task_item_init):
@@ -1113,6 +1381,88 @@
1113 Fix typo.1381 Fix typo.
1114 Make sure taskmanager defines the canonical-name property.1382 Make sure taskmanager defines the canonical-name property.
11151383
13842009-07-04 Mark Lee <avant-wn@lazymalevolence.com>
1385
1386 * libawn/awn-config.c:
1387 * libawn/awn-config.h:
1388 Added.
1389
1390 * libawn/awn-config-bridge.c:
1391 * libawn/awn-config-bridge.h:
1392 * libawn/awn-config-client-gconf.c:
1393 * libawn/awn-config-client-gkeyfile.c:
1394 * libawn/awn-config-client-shared.c:
1395 * libawn/awn-config-client.h:
1396 * tests/test-config-client.c:
1397 * tests/test-config-client.py:
1398 Removed.
1399
1400 * bindings/python/awn.defs:
1401 * bindings/python/awn.override:
1402 Remove bindings.
1403
1404 * data/Makefile.am:
1405 * data/avant-window-navigator.schema-ini.in:
1406 Rename schema files.
1407
1408 * doc/reference/libawn-docs.sgml:
1409 * doc/reference/libawn-sections.txt:
1410 * doc/reference/libawn.types:
1411 Update documentation templates.
1412
1413 * libawn/awn-defines.h (AWN_PANEL_ID_DEFAULT):
1414 Add default panel ID constant.
1415
1416 * .bzrignore:
1417 * applets/taskmanager/Makefile.am:
1418 * applets/taskmanager/task-manager.c (task_manager_constructed,
1419 _drag_source_end):
1420 * applets/taskmanager/task-settings.c (cfg_notify_int, cfg_load_int,
1421 task_settings_get_default):
1422 * configure.in:
1423 * libawn/Makefile.am:
1424 * libawn/awn-dialog.c (awn_dialog_constructed, awn_dialog_get_property,
1425 awn_dialog_set_property, awn_dialog_finalize):
1426 * libawn/awn-effects.c:
1427 * libawn/awn-effects.h:
1428 * libawn/awn-icon.c (awn_icon_constructed, awn_icon_set_property,
1429 awn_icon_dispose):
1430 * libawn/awn-overlay-text.c (awn_overlay_text_set_property,
1431 awn_overlay_text_dispose, awn_overlay_text_init):
1432 * libawn/awn-tooltip.c (awn_tooltip_constructed, awn_tooltip_set_property,
1433 awn_tooltip_init):
1434 * libawn/libawn.h:
1435 * src/awn-app.c (awn_app_finalize, awn_app_init):
1436 * src/awn-applet-manager.c (awn_applet_manager_constructed,
1437 awn_applet_manager_get_property, awn_applet_manager_set_property,
1438 awn_applet_manager_class_init, awn_applet_manager_new_from_config,
1439 free_list):
1440 * src/awn-applet-manager.h:
1441 * src/awn-applet-proxy.h:
1442 * src/awn-background-3d.c (awn_background_3d_new):
1443 * src/awn-background-3d.h:
1444 * src/awn-background-curves.c (awn_background_curves_new):
1445 * src/awn-background-curves.h:
1446 * src/awn-background-edgy.c (awn_background_edgy_new):
1447 * src/awn-background-edgy.h:
1448 * src/awn-background-flat.c (awn_background_flat_new):
1449 * src/awn-background-flat.h:
1450 * src/awn-background.c (awn_background_constructed,
1451 awn_background_get_property, awn_background_set_property,
1452 awn_background_class_init, set_cfg_from_theme,
1453 load_colours_from_widget):
1454 * src/awn-background.h:
1455 * src/awn-monitor.c (awn_monitor_constructed, awn_monitor_class_init,
1456 awn_monitor_new_from_config):
1457 * src/awn-monitor.h (geometry_changed):
1458 * src/awn-panel.c (awn_panel_constructed, awn_panel_class_init,
1459 awn_panel_new_from_config):
1460 * src/awn-panel.h:
1461 * tests/Makefile.am:
1462 The first part of converting Awn to use the libdesktop-agnostic
1463 configuration API. The applet convenience methods still need to be
1464 implemented.
1465
11162009-07-04 Michal Hruby <michal.mhr@gmail.com>14662009-07-04 Michal Hruby <michal.mhr@gmail.com>
11171467
1118 * libawn/awn-dialog.c:1468 * libawn/awn-dialog.c:
@@ -1341,6 +1691,14 @@
1341 * doc/reference/libawn-sections.txt:1691 * doc/reference/libawn-sections.txt:
1342 Update the gtk-doc generated sections file.1692 Update the gtk-doc generated sections file.
13431693
16942009-06-27 Mark Lee <avant-wn@lazymalevolence.com>
1695
1696 * doc/reference/libawn-sections.txt:
1697 * libawn/awn-cairo-utils.c:
1698 * libawn/awn-cairo-utils.h:
1699 Update the cairo color convenience functions to use the libdesktop-agnostic
1700 cairo color convenience API.
1701
13442009-06-27 Julien Lavergne <julien.lavergne@gmail.com>17022009-06-27 Julien Lavergne <julien.lavergne@gmail.com>
13451703
1346 * awn-settings/awn-settings.xml:1704 * awn-settings/awn-settings.xml:
@@ -1826,6 +2184,18 @@
18262184
18272009-06-19 Mark Lee <avant-wn@lazymalevolence.com>21852009-06-19 Mark Lee <avant-wn@lazymalevolence.com>
18282186
2187 * .bzrignore:
2188 * configure.in:
2189 * doc/reference/Makefile.am:
2190 Remove remnants of the old libawn/egg directory.
2191
21922009-06-19 Mark Lee <avant-wn@lazymalevolence.com>
2193
2194 * applets/taskmanager/task-launcher.c:
2195 Remove unused variable.
2196
21972009-06-19 Mark Lee <avant-wn@lazymalevolence.com>
2198
1829 * bindings/python/awn.override:2199 * bindings/python/awn.override:
1830 * libawn/libawn.h:2200 * libawn/libawn.h:
1831 Clean up headers.2201 Clean up headers.
@@ -2524,6 +2894,11 @@
25242894
25252009-06-07 Mark Lee <avant-wn@lazymalevolence.com>28952009-06-07 Mark Lee <avant-wn@lazymalevolence.com>
25262896
2897 * awn-applet-activation/main.c:
2898 Fix typo.
2899
29002009-06-07 Mark Lee <avant-wn@lazymalevolence.com>
2901
2527 * doc/reference/libawn-docs.sgml:2902 * doc/reference/libawn-docs.sgml:
2528 Update/reorganize the table of contents.2903 Update/reorganize the table of contents.
25292904
@@ -2554,6 +2929,12 @@
25542929
25552009-06-07 Mark Lee <avant-wn@lazymalevolence.com>29302009-06-07 Mark Lee <avant-wn@lazymalevolence.com>
25562931
2932 * doc/reference/libawn-sections.txt:
2933 * doc/reference/libawn.types:
2934 Update, given the libdesktop-agnostic-related changes.
2935
29362009-06-07 Mark Lee <avant-wn@lazymalevolence.com>
2937
2557 * doc/reference/tmpl/awn-applet-dialog.sgml:2938 * doc/reference/tmpl/awn-applet-dialog.sgml:
2558 * doc/reference/tmpl/awn-applet-simple.sgml:2939 * doc/reference/tmpl/awn-applet-simple.sgml:
2559 * doc/reference/tmpl/awn-applet.sgml:2940 * doc/reference/tmpl/awn-applet.sgml:
@@ -2867,6 +3248,13 @@
2867 * libawn/awn-dialog.c:3248 * libawn/awn-dialog.c:
2868 Fix issue with titlebar spacing.3249 Fix issue with titlebar spacing.
28693250
32512009-05-30 Mark Lee <avant-wn@lazymalevolence.com>
3252
3253 * applets/taskmanager/task-launcher.c:
3254 * awn-applet-activation/main.c:
3255 * libawn/awn-config-client-gkeyfile.c:
3256 Use the updated libdesktop-agnostic API.
3257
28702009-05-30 Michal Hruby <michal.mhr@gmail.com>32582009-05-30 Michal Hruby <michal.mhr@gmail.com>
28713259
2872 * libawn/awn-cairo-utils.c:3260 * libawn/awn-cairo-utils.c:
@@ -2914,6 +3302,29 @@
29143302
29152009-05-22 Mark Lee <avant-wn@lazymalevolence.com>33032009-05-22 Mark Lee <avant-wn@lazymalevolence.com>
29163304
3305 * bindings/python/awn.defs:
3306 * libawn/awn-utils.c:
3307 * libawn/awn-utils.h:
3308 Re-add awn_vfs_init () until one can access libdesktop-agnostic
3309 from Python.
3310
33112009-05-22 Mark Lee <avant-wn@lazymalevolence.com>
3312
3313 * applets/taskmanager/task-launcher.c:
3314 * awn-applet-activation/main.c:
3315 * bindings/python/awn.defs:
3316 * bindings/python/awn.override:
3317 * configure.in:
3318 * libawn/Makefile.am:
3319 * libawn/awn-desktop-item.h:
3320 * libawn/awn-desktop-item-egg.c:
3321 * libawn/egg/:
3322 * libawn/libawn.h:
3323 Replace AwnDesktopItem/EggDesktopFile with the equivalent API in
3324 libdesktop-agnostic.
3325
33262009-05-22 Mark Lee <avant-wn@lazymalevolence.com>
3327
2917 * INSTALL:3328 * INSTALL:
2918 Update.3329 Update.
29193330
@@ -2940,6 +3351,18 @@
29403351
29412009-05-12 Mark Lee <avant-wn@lazymalevolence.com>33522009-05-12 Mark Lee <avant-wn@lazymalevolence.com>
29423353
3354 * libawn/awn-vfs.c:
3355 * libawn/awn-vfs.h:
3356 Removed (obsoleted by libdesktop-agnostic).
3357
3358 * bindings/python/awn.override:
3359 * configure.in:
3360 * libawn/Makefile.am:
3361 * libawn/libawn.h:
3362 Remove references of the removed files and their dependencies.
3363
33642009-05-12 Mark Lee <avant-wn@lazymalevolence.com>
3365
2943 * src/awn-background.c:3366 * src/awn-background.c:
2944 Fix the default values of the color properties to use the3367 Fix the default values of the color properties to use the
2945 libdesktop-agnostic syntax.3368 libdesktop-agnostic syntax.
@@ -3003,6 +3426,25 @@
30032009-04-25 Mark Lee <avant-wn@lazymalevolence.com>34262009-04-25 Mark Lee <avant-wn@lazymalevolence.com>
30043427
3005 * applets/taskmanager/task-icon.c:3428 * applets/taskmanager/task-icon.c:
3429 * awn-applet-activation/main.c:
3430 * libawn/awn-cairo-utils.h:
3431 * libawn/awn-config-client-gkeyfile.c:
3432 * libawn/awn-dialog.c:
3433 * libawn/awn-tooltip.c:
3434 * src/awn-background.c:
3435 * src/awn-background.h:
3436 * src/awn-main.c:
3437 The libdesktop-agnostic headers have been consolidated into a single
3438 header; use that instead.
3439
34402009-04-25 Mark Lee <avant-wn@lazymalevolence.com>
3441
3442 * debian/control:
3443 Add libdesktop-agnostic dependencies.
3444
34452009-04-25 Mark Lee <avant-wn@lazymalevolence.com>
3446
3447 * applets/taskmanager/task-icon.c:
3006 * libawn/Makefile.am:3448 * libawn/Makefile.am:
3007 * libawn/awn-applet.c:3449 * libawn/awn-applet.c:
3008 * libawn/awn-dialog.c:3450 * libawn/awn-dialog.c:
@@ -3020,6 +3462,28 @@
3020 * libawn/awn-cairo-utils.c:3462 * libawn/awn-cairo-utils.c:
3021 Fix variable shadowing errors.3463 Fix variable shadowing errors.
30223464
34652009-04-21 Mark Lee <avant-wn@lazymalevolence.com>
3466
3467 * libawn/awn-config-client-gkeyfile.c:
3468 Convert to use the libdesktop-agnostic VFS implementation. Only tested
3469 to see if it compiled correctly.
3470
34712009-04-21 Mark Lee <avant-wn@lazymalevolence.com>
3472
3473 * src/awn-main.c:
3474 Convert to use the libdesktop-agnostic VFS implementation (currently
3475 used only if the gkeyfile config backend is used).
3476
34772009-04-21 Mark Lee <avant-wn@lazymalevolence.com>
3478
3479 * applets/taskmanager/task-icon.c:
3480 Convert to use the libdesktop-agnostic VFS implementation.
3481
34822009-04-21 Mark Lee <avant-wn@lazymalevolence.com>
3483
3484 * awn-applet-activation/main.c:
3485 Convert to use the libdesktop-agnostic VFS implementation.
3486
30232009-04-20 Mark Lee <avant-wn@lazymalevolence.com>34872009-04-20 Mark Lee <avant-wn@lazymalevolence.com>
30243488
3025 reviewed by: R. Cryderman <rcryderman@gmail.com>3489 reviewed by: R. Cryderman <rcryderman@gmail.com>
@@ -5021,7 +5485,6 @@
5021 * libawn/awn-icons.h:5485 * libawn/awn-icons.h:
5022 Added awn_icons_get_icon_at_height() to awn-icons.5486 Added awn_icons_get_icon_at_height() to awn-icons.
50235487
5024>>>>>>> MERGE-SOURCE
50252008-07-13 Rodney Cryderman <rcryderman@gmail.com>54882008-07-13 Rodney Cryderman <rcryderman@gmail.com>
50265489
5027 * libawn/awn-icons.c:5490 * libawn/awn-icons.c:
50285491
=== added file 'Makefile.schemas'
--- Makefile.schemas 1970-01-01 00:00:00 +0000
+++ Makefile.schemas 2009-08-05 07:18:27 +0000
@@ -0,0 +1,25 @@
1# requires Makefile.shave
2
3# Usage
4# -----
5# 1. Set the schema_DATA variable to the schema-ini file(s) to install.
6# 2. Add install-gconf-schemas to the install-data-local rule dependencies.
7
8if GCONF_SCHEMAS_INSTALL
9schemasdir = @GCONF_SCHEMA_FILE_DIR@
10schemas_in_files = $(schema_DATA:.schema-ini=.schemas.in)
11schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
12
13%.schemas.in: %.schema-ini
14 $(QUIET_GEN)$(LDA_BINDIR)/lda-schema-to-gconf $< $@
15
16@INTLTOOL_SCHEMAS_RULE@
17
18install-gconf-schemas: $(schemas_DATA)
19 GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schemas_DATA)
20else
21install-gconf-schemas:
22endif
23
24schemadir = $(pkgdatadir)/schemas
25# vim: set ft=automake noet ts=8 sts=8 sw=8 :
026
=== added file 'Makefile.shave'
--- Makefile.shave 1970-01-01 00:00:00 +0000
+++ Makefile.shave 2009-07-06 23:38:20 +0000
@@ -0,0 +1,4 @@
1# shave-related
2V = @
3Q = $(V:1=)
4QUIET_GEN = $(Q:@=@echo ' GEN '$@;)
05
=== removed file 'Makefile.shave'
--- Makefile.shave 2009-07-18 07:00:32 +0000
+++ Makefile.shave 1970-01-01 00:00:00 +0000
@@ -1,4 +0,0 @@
1# shave-related
2V = @
3Q = $(V:1=)
4QUIET_GEN = $(Q:@=@echo ' GEN '$@;)
50
=== modified file 'applets/taskmanager/Makefile.am'
--- applets/taskmanager/Makefile.am 2009-07-28 01:24:31 +0000
+++ applets/taskmanager/Makefile.am 2009-07-31 18:34:39 +0000
@@ -1,6 +1,7 @@
1include $(top_srcdir)/Makefile.shave1include $(top_srcdir)/Makefile.shave
2MARSHAL_PREFIX = taskmanager2MARSHAL_PREFIX = taskmanager
3include $(top_srcdir)/Makefile.marshal3include $(top_srcdir)/Makefile.marshal
4include $(top_srcdir)/Makefile.schemas
45
5AM_CPPFLAGS = \6AM_CPPFLAGS = \
6 $(STANDARD_CPPFLAGS) \7 $(STANDARD_CPPFLAGS) \
@@ -58,27 +59,7 @@
58desktop_DATA = taskmanager.desktop59desktop_DATA = taskmanager.desktop
59@INTLTOOL_DESKTOP_RULE@60@INTLTOOL_DESKTOP_RULE@
6061
61if USE_GCONF62schema_DATA = awn-applet-taskmanager.schema-ini
62schemasdir = @GCONF_SCHEMA_FILE_DIR@
63schemas_in_files = taskmanager.schemas.in
64schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
65
66taskmanager.schemas.in: taskmanager.schema-ini
67 $(top_srcdir)/data/awn-schema-to-gconf $< $@ "taskmanager"
68
69@INTLTOOL_SCHEMAS_RULE@
70
71if GCONF_SCHEMAS_INSTALL
72install-gconf-schemas: $(schemas_DATA)
73 GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schemas_DATA)
74else
75install-gconf-schemas:
76endif
77else
78install-gconf-schemas:
79endif
80schemadir = $(pkgdatadir)/schemas
81schema_DATA = taskmanager.schema-ini
8263
83install-data-local: install-gconf-schemas64install-data-local: install-gconf-schemas
8465
@@ -89,4 +70,4 @@
89 $(NULL)70 $(NULL)
9071
91EXTRA_DIST = $(desktop_DATA).in.in $(schema_DATA)72EXTRA_DIST = $(desktop_DATA).in.in $(schema_DATA)
92CLEANFILES = $(desktop_DATA) $(shemas_in_files) $(schemas_DATA) $(BUILT_SOURCES)73CLEANFILES = $(desktop_DATA) $(schemas_in_files) $(schemas_DATA) $(BUILT_SOURCES)
9374
=== renamed file 'applets/taskmanager/taskmanager.schema-ini' => 'applets/taskmanager/awn-applet-taskmanager.schema-ini'
--- applets/taskmanager/taskmanager.schema-ini 2009-08-03 04:06:27 +0000
+++ applets/taskmanager/awn-applet-taskmanager.schema-ini 2009-08-05 04:06:09 +0000
@@ -1,10 +1,18 @@
1# Task Manager configuration schema
2# ---------------------------------
3
4# schema metadata
5[DEFAULT]
6single_instance = false
7
8# configuration options
1[DEFAULT/only_show_launchers]9[DEFAULT/only_show_launchers]
2type = bool10type = boolean
3default = false11default = false
4description = Only show and manager launcher windows12description = Only show and manager launcher windows
513
6[DEFAULT/show_all_windows]14[DEFAULT/show_all_windows]
7type = bool15type = boolean
8default = true16default = true
9description = Show windows from all workspaces17description = Show windows from all workspaces
1018
@@ -14,31 +22,33 @@
14description = a list of paths to .desktop files from which the taskmanager should create it's launchers22description = a list of paths to .desktop files from which the taskmanager should create it's launchers
1523
16[DEFAULT/drag_and_drop]24[DEFAULT/drag_and_drop]
17type = bool25type = boolean
18default = true26default = true
19description = Enable reordering of windows by drag and drop 27description = Enable reordering of windows by drag and drop
2028
21[DEFAULT/grouping]29[DEFAULT/grouping]
22type = bool30type = boolean
23default = true31default = true
24description = Enabling group of tasks.32description = Enabling group of tasks.
2533
26[DEFAULT/match_strength]34[DEFAULT/match_strength]
27type = int35type = integer
28default = 9936default = 99
29description = How radical matching is applied for grouping items. The value should be between 0 and 99. 0 is as good as no grouping. 99 will match almost everything.37description = How radical matching is applied for grouping items. The value should be between 0 and 99. 0 is as good as no grouping. 99 will match almost everything.
3038
31[DEFAULT/max_indicators]39[DEFAULT/max_indicators]
32type = int40type = integer
33default = 341default = 3
34description = Maximum number of task indicators to show under icons. Valid range is 0..3.42description = Maximum number of task indicators to show under icons. Valid range is 0..3.
3543
36[DEFAULT/txt_indicator_threshold]44[DEFAULT/txt_indicator_threshold]
37type = int45type = integer
38default = 446default = 4
39description = The threshold at which text count begins to be displayed. valid range 1..47description = The threshold at which text count begins to be displayed. valid range 1..
4048
41[DEFAULT/enable_long_press]49[DEFAULT/enable_long_press]
42type = bool50type = boolean
43default = true51default = true
44description = Enable long press to open Dialog.52description = Enable long press to open Dialog.
53
54# vim: set ft=dosini :
4555
=== modified file 'applets/taskmanager/task-icon.c'
--- applets/taskmanager/task-icon.c 2009-08-06 04:16:03 +0000
+++ applets/taskmanager/task-icon.c 2009-08-06 19:16:07 +0000
@@ -28,6 +28,7 @@
2828
29#include <libwnck/libwnck.h>29#include <libwnck/libwnck.h>
3030
31#include <libdesktop-agnostic/vfs.h>
31#include "libawn/gseal-transition.h"32#include "libawn/gseal-transition.h"
3233
33#include "taskmanager-marshal.h"34#include "taskmanager-marshal.h"
@@ -68,8 +69,8 @@
68 //An overlay for showing number of items69 //An overlay for showing number of items
69 AwnOverlayText *overlay_text;70 AwnOverlayText *overlay_text;
7071
71 //A Config client72 // Config client
72 AwnConfigClient * client;73 DesktopAgnosticConfigClient *client;
73 74
74 GdkPixbuf *icon;75 GdkPixbuf *icon;
75 AwnApplet *applet;76 AwnApplet *applet;
@@ -288,6 +289,9 @@
288task_icon_dispose (GObject *object)289task_icon_dispose (GObject *object)
289{290{
290 TaskIconPrivate *priv = TASK_ICON_GET_PRIVATE (object);291 TaskIconPrivate *priv = TASK_ICON_GET_PRIVATE (object);
292
293 desktop_agnostic_config_client_unbind_all_for_object (priv->client, object,
294 NULL);
291 295
292 /*this needs to be done in dispose, not finalize, due to idiosyncracies of 296 /*this needs to be done in dispose, not finalize, due to idiosyncracies of
293 AwnDialog*/297 AwnDialog*/
@@ -296,11 +300,6 @@
296 gtk_widget_destroy (priv->dialog);300 gtk_widget_destroy (priv->dialog);
297 priv->dialog = NULL;301 priv->dialog = NULL;
298 }302 }
299 if (priv->client)
300 {
301 awn_config_client_free(priv->client);
302 priv->client = NULL;
303 }
304 if (priv->overlay_text)303 if (priv->overlay_text)
305 {304 {
306 g_object_unref (priv->overlay_text);305 g_object_unref (priv->overlay_text);
@@ -331,12 +330,34 @@
331 G_OBJECT_CLASS (task_icon_parent_class)->finalize (object);330 G_OBJECT_CLASS (task_icon_parent_class)->finalize (object);
332}331}
333332
333static gboolean
334do_bind_property (DesktopAgnosticConfigClient *client, const gchar *key,
335 GObject *object, const gchar *property)
336{
337 GError *error = NULL;
338
339 desktop_agnostic_config_client_bind (client,
340 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
341 key, object, property, TRUE,
342 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
343 &error);
344 if (error)
345 {
346 g_warning ("Could not bind property '%s' to key '%s': %s", property, key,
347 error->message);
348 g_error_free (error);
349 return FALSE;
350 }
351
352 return TRUE;
353}
354
334static void355static void
335task_icon_constructed (GObject *object)356task_icon_constructed (GObject *object)
336{357{
337 AwnConfigBridge *bridge;
338 TaskIconPrivate *priv = TASK_ICON (object)->priv;358 TaskIconPrivate *priv = TASK_ICON (object)->priv;
339 GtkWidget *widget = GTK_WIDGET(object); 359 GtkWidget *widget = GTK_WIDGET(object);
360 GError *error = NULL;
340361
341 if ( G_OBJECT_CLASS (task_icon_parent_class)->constructed)362 if ( G_OBJECT_CLASS (task_icon_parent_class)->constructed)
342 {363 {
@@ -355,20 +376,33 @@
355 //update geometry of icon every second.376 //update geometry of icon every second.
356 priv->update_geometry_id = g_timeout_add_seconds (1, (GSourceFunc)_update_geometry, widget);377 priv->update_geometry_id = g_timeout_add_seconds (1, (GSourceFunc)_update_geometry, widget);
357378
358 priv->client = awn_config_client_new_for_applet ("taskmanager", NULL);379 priv->client = awn_config_get_default_for_applet (priv->applet, &error);
359 bridge = awn_config_bridge_get_default ();380
381 if (error)
382 {
383 g_warning ("Could not get the applet's configuration object: %s",
384 error->message);
385 g_error_free (error);
386 return;
387 }
360 388
361 awn_config_bridge_bind (bridge, priv->client,389 if (!do_bind_property (priv->client, "max_indicators", object,
362 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "max_indicators",390 "max_indicators"))
363 object, "max_indicators"); 391 {
364392 return;
365 awn_config_bridge_bind (bridge, priv->client,393 }
366 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "txt_indicator_threshold",394
367 object, "txt_indicator_threshold");395 if (!do_bind_property (priv->client, "txt_indicator_threshold", object,
368396 "txt_indicator_threshold"))
369 awn_config_bridge_bind (bridge, priv->client,397 {
370 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "enable_long_press",398 return;
371 object, "enable_long_press");399 }
400
401 if (!do_bind_property (priv->client, "enable_long_press", object,
402 "enable_long_press"))
403 {
404 return;
405 }
372}406}
373407
374/**408/**
@@ -2137,7 +2171,8 @@
2137 //}2171 //}
2138 2172
2139 error = NULL;2173 error = NULL;
2140 list = awn_vfs_get_pathlist_from_string (sdata_data, &error);2174
2175 list = desktop_agnostic_vfs_files_from_uri_list (sdata_data, &error);
2141 if (error)2176 if (error)
2142 {2177 {
2143 g_warning ("Unable to handle drop: %s", error->message);2178 g_warning ("Unable to handle drop: %s", error->message);
21442179
=== modified file 'applets/taskmanager/task-launcher.c'
--- applets/taskmanager/task-launcher.c 2009-08-03 18:30:37 +0000
+++ applets/taskmanager/task-launcher.c 2009-08-06 19:54:39 +0000
@@ -27,6 +27,7 @@
27#include <libwnck/libwnck.h>27#include <libwnck/libwnck.h>
28#include <glib/gi18n.h>28#include <glib/gi18n.h>
2929
30#include <libdesktop-agnostic/fdo.h>
30#undef G_DISABLE_SINGLE_INCLUDES31#undef G_DISABLE_SINGLE_INCLUDES
31#include <glibtop/procargs.h>32#include <glibtop/procargs.h>
32#include <glibtop/procuid.h>33#include <glibtop/procuid.h>
@@ -48,13 +49,13 @@
4849
49struct _TaskLauncherPrivate50struct _TaskLauncherPrivate
50{51{
51 gchar *path;52 gchar *path;
52 AwnDesktopItem *item;53 DesktopAgnosticFDODesktopEntry *entry;
5354
54 gchar *name;55 const gchar *name;
55 gchar *exec;56 const gchar *exec;
56 gchar *icon_name;57 const gchar *icon_name;
57 gint pid;58 GPid pid;
58 glong timestamp;59 glong timestamp;
59 60
60 GtkWidget *menu;61 GtkWidget *menu;
@@ -184,7 +185,7 @@
184 priv = launcher->priv = TASK_LAUNCHER_GET_PRIVATE (launcher);185 priv = launcher->priv = TASK_LAUNCHER_GET_PRIVATE (launcher);
185 186
186 priv->path = NULL;187 priv->path = NULL;
187 priv->item = NULL;188 priv->entry = NULL;
188}189}
189190
190TaskItem * 191TaskItem *
@@ -214,43 +215,53 @@
214task_launcher_set_desktop_file (TaskLauncher *launcher, const gchar *path)215task_launcher_set_desktop_file (TaskLauncher *launcher, const gchar *path)
215{216{
216 TaskLauncherPrivate *priv;217 TaskLauncherPrivate *priv;
217 TaskSettings * s = task_settings_get_default ();218 DesktopAgnosticVFSFile *file;
219 GError *error = NULL;
218 GdkPixbuf *pixbuf;220 GdkPixbuf *pixbuf;
219 gchar * exec_key = NULL;
220 gchar * needle = NULL;
221 221
222 g_return_if_fail (TASK_IS_LAUNCHER (launcher));222 g_return_if_fail (TASK_IS_LAUNCHER (launcher));
223 priv = launcher->priv;223 priv = launcher->priv;
224224
225 priv->path = g_strdup (path);225 priv->path = g_strdup (path);
226226
227 priv->item = awn_desktop_item_new (path);227 file = desktop_agnostic_vfs_file_new_for_path (path, &error);
228228
229 if (priv->item == NULL)229 if (error)
230 return;230 {
231231 g_critical ("Error when trying to load the launcher: %s", error->message);
232 priv->special_id = get_special_id_from_desktop(priv->item);232 g_error_free (error);
233 priv->name = awn_desktop_item_get_name (priv->item);233 return;
234234 }
235 exec_key = g_strstrip (awn_desktop_item_get_exec (priv->item) );235
236 if (file == NULL || !desktop_agnostic_vfs_file_exists (file))
237 {
238 g_critical ("File not found: '%s'", path);
239 return;
240 }
241
242 priv->entry = desktop_agnostic_fdo_desktop_entry_new_for_file (file, &error);
243
244 if (error)
245 {
246 g_critical ("Error when trying to load the launcher: %s", error->message);
247 g_error_free (error);
248 return;
249 }
250
251 if (priv->entry == NULL)
252 {
253 return;
254 }
255
256 priv->special_id = get_special_id_from_desktop(priv->entry);
257 priv->name = desktop_agnostic_fdo_desktop_entry_get_name (priv->entry);
258
259 priv->exec = g_strstrip (desktop_agnostic_fdo_desktop_entry_get_string (priv->entry, "Exec"));
236 260
237 /*do we have have any % chars? if so... then find the first one , 261 priv->icon_name = desktop_agnostic_fdo_desktop_entry_get_icon (priv->entry);
238 and truncate
239
240 There is an open question if we should remove any of other command line
241 args... for now leaving things alone as long as their is no %
242 */
243 needle = strchr (exec_key,'%');
244 if (needle)
245 {
246 *needle = '\0';
247 g_strstrip (exec_key);
248 }
249 priv->exec = exec_key;
250 priv->icon_name = awn_desktop_item_get_icon_name (priv->item);
251262
252 task_item_emit_name_changed (TASK_ITEM (launcher), priv->name);263 task_item_emit_name_changed (TASK_ITEM (launcher), priv->name);
253 pixbuf = awn_desktop_item_get_icon (priv->item, s->panel_size);264 pixbuf = _get_icon (TASK_ITEM (launcher));
254 task_item_emit_icon_changed (TASK_ITEM (launcher), pixbuf);265 task_item_emit_icon_changed (TASK_ITEM (launcher), pixbuf);
255 g_object_unref (pixbuf);266 g_object_unref (pixbuf);
256 task_item_emit_visible_changed (TASK_ITEM (launcher), TRUE);267 task_item_emit_visible_changed (TASK_ITEM (launcher), TRUE);
@@ -271,9 +282,32 @@
271static GdkPixbuf * 282static GdkPixbuf *
272_get_icon (TaskItem *item)283_get_icon (TaskItem *item)
273{284{
285 TaskLauncherPrivate *priv = TASK_LAUNCHER (item)->priv;
274 TaskSettings *s = task_settings_get_default ();286 TaskSettings *s = task_settings_get_default ();
275287 GError *error = NULL;
276 return awn_desktop_item_get_icon (TASK_LAUNCHER (item)->priv->item, s->panel_size);288 GdkPixbuf *pixbuf = NULL;
289
290 if (g_path_is_absolute (priv->icon_name))
291 {
292 pixbuf = gdk_pixbuf_new_from_file_at_scale (priv->icon_name,
293 s->panel_size, s->panel_size,
294 TRUE, &error);
295 }
296 else
297 {
298 GtkIconTheme *icon_theme = gtk_icon_theme_get_default ();
299
300 pixbuf = gtk_icon_theme_load_icon (icon_theme, priv->icon_name,
301 s->panel_size, 0, &error);
302 }
303 if (error)
304 {
305 g_warning ("The launcher '%s' could not load the icon '%s': %s",
306 priv->path, priv->icon_name, error->message);
307 g_error_free (error);
308 return NULL;
309 }
310 return pixbuf;
277}311}
278312
279static gboolean313static gboolean
@@ -467,7 +501,7 @@
467 /* is the launcher pid set?*/501 /* is the launcher pid set?*/
468 if (priv->pid)502 if (priv->pid)
469 {503 {
470 gchar * name = awn_desktop_item_get_name (priv->item);504 gchar *name = desktop_agnostic_fdo_desktop_entry_get_name (priv->entry);
471 GStrv tokens = g_strsplit (name, " ",-1);505 GStrv tokens = g_strsplit (name, " ",-1);
472 if (tokens && tokens[0] && (strlen (tokens[0])>5) )506 if (tokens && tokens[0] && (strlen (tokens[0])>5) )
473 {507 {
@@ -513,10 +547,12 @@
513 launcher = TASK_LAUNCHER (item);547 launcher = TASK_LAUNCHER (item);
514 priv = launcher->priv;548 priv = launcher->priv;
515549
516 priv->pid = awn_desktop_item_launch (priv->item, NULL, &error);550 priv->pid =
551 desktop_agnostic_fdo_desktop_entry_launch (priv->entry,
552 0, NULL, &error);
517 g_get_current_time (&timeval);553 g_get_current_time (&timeval);
518 priv->timestamp = timeval.tv_sec;554 priv->timestamp = timeval.tv_sec;
519 555
520#ifdef DEBUG 556#ifdef DEBUG
521 g_debug ("%s: current time = %ld",__func__,timeval.tv_sec); 557 g_debug ("%s: current time = %ld",__func__,timeval.tv_sec);
522 g_debug ("%s: launch pid = %d",__func__,priv->pid);558 g_debug ("%s: launch pid = %d",__func__,priv->pid);
@@ -579,7 +615,8 @@
579 launcher = TASK_LAUNCHER (item);615 launcher = TASK_LAUNCHER (item);
580 priv = launcher->priv;616 priv = launcher->priv;
581617
582 priv->pid = awn_desktop_item_launch (priv->item, NULL, &error);618 priv->pid = desktop_agnostic_fdo_desktop_entry_launch (priv->entry, 0,
619 NULL, &error);
583620
584 if (error)621 if (error)
585 {622 {
@@ -601,8 +638,9 @@
601 638
602 g_return_if_fail (TASK_IS_LAUNCHER (launcher));639 g_return_if_fail (TASK_IS_LAUNCHER (launcher));
603640
604 launcher->priv->pid = awn_desktop_item_launch (launcher->priv->item,641 launcher->priv->pid =
605 list, &error);642 desktop_agnostic_fdo_desktop_entry_launch (launcher->priv->entry,
643 0, list, &error);
606644
607 if (error)645 if (error)
608 {646 {
609647
=== modified file 'applets/taskmanager/task-manager.c'
--- applets/taskmanager/task-manager.c 2009-08-05 17:08:03 +0000
+++ applets/taskmanager/task-manager.c 2009-08-06 19:54:39 +0000
@@ -56,7 +56,7 @@
5656
57struct _TaskManagerPrivate57struct _TaskManagerPrivate
58{58{
59 AwnConfigClient *client;59 DesktopAgnosticConfigClient *client;
60 TaskSettings *settings;60 TaskSettings *settings;
61 WnckScreen *screen;61 WnckScreen *screen;
6262
@@ -72,12 +72,12 @@
72 GHashTable *win_table;72 GHashTable *win_table;
7373
74 /* Properties */74 /* Properties */
75 GSList *launcher_paths;75 GValueArray *launcher_paths;
76 gboolean show_all_windows;76 gboolean show_all_windows;
77 gboolean only_show_launchers;77 gboolean only_show_launchers;
78 gboolean drag_and_drop;78 gboolean drag_and_drop;
79 gboolean grouping;79 gboolean grouping;
80 gint match_strength;80 gint match_strength;
81};81};
8282
83enum83enum
@@ -111,7 +111,7 @@
111static void task_manager_set_show_only_launchers (TaskManager *manager, 111static void task_manager_set_show_only_launchers (TaskManager *manager,
112 gboolean show_only);112 gboolean show_only);
113static void task_manager_refresh_launcher_paths (TaskManager *manager,113static void task_manager_refresh_launcher_paths (TaskManager *manager,
114 GSList *list);114 GValueArray *list);
115static void task_manager_set_drag_and_drop (TaskManager *manager, 115static void task_manager_set_drag_and_drop (TaskManager *manager,
116 gboolean drag_and_drop);116 gboolean drag_and_drop);
117117
@@ -126,6 +126,8 @@
126static void task_manager_size_changed (AwnApplet *applet,126static void task_manager_size_changed (AwnApplet *applet,
127 gint size);127 gint size);
128128
129static void task_manager_dispose (GObject *object);
130
129typedef enum 131typedef enum
130{132{
131 TASK_MANAGER_ERROR_UNSUPPORTED_WINDOW_TYPE,133 TASK_MANAGER_ERROR_UNSUPPORTED_WINDOW_TYPE,
@@ -175,9 +177,8 @@
175 break;177 break;
176178
177 case PROP_LAUNCHER_PATHS:179 case PROP_LAUNCHER_PATHS:
178 g_value_set_pointer (value, manager->priv->launcher_paths);180 g_value_set_boxed (value, manager->priv->launcher_paths);
179 break;181 break;
180
181 case PROP_DRAG_AND_DROP:182 case PROP_DRAG_AND_DROP:
182 g_value_set_boolean (value, manager->priv->drag_and_drop);183 g_value_set_boolean (value, manager->priv->drag_and_drop);
183 break;184 break;
@@ -215,10 +216,15 @@
215 break;216 break;
216217
217 case PROP_LAUNCHER_PATHS:218 case PROP_LAUNCHER_PATHS:
218 task_manager_refresh_launcher_paths (manager, 219 if (manager->priv->launcher_paths)
219 g_value_get_pointer (value));220 {
221 g_value_array_free (manager->priv->launcher_paths);
222 manager->priv->launcher_paths = NULL;
223 }
224 manager->priv->launcher_paths = (GValueArray*)g_value_dup_boxed (value);
225 task_manager_refresh_launcher_paths (manager,
226 manager->priv->launcher_paths);
220 break;227 break;
221
222 case PROP_DRAG_AND_DROP:228 case PROP_DRAG_AND_DROP:
223 task_manager_set_drag_and_drop (manager, 229 task_manager_set_drag_and_drop (manager,
224 g_value_get_boolean (value));230 g_value_get_boolean (value));
@@ -243,9 +249,7 @@
243task_manager_constructed (GObject *object)249task_manager_constructed (GObject *object)
244{250{
245 TaskManagerPrivate *priv;251 TaskManagerPrivate *priv;
246 AwnConfigBridge *bridge;
247 GtkWidget *widget;252 GtkWidget *widget;
248 gchar *uid = NULL;
249253
250 G_OBJECT_CLASS (task_manager_parent_class)->constructed (object);254 G_OBJECT_CLASS (task_manager_parent_class)->constructed (object);
251 255
@@ -253,35 +257,46 @@
253 widget = GTK_WIDGET (object);257 widget = GTK_WIDGET (object);
254258
255 priv->settings = task_settings_get_default ();259 priv->settings = task_settings_get_default ();
256 /* Load the uid */260
257 /* FIXME: AwnConfigClient needs to associate the default schema when uid is261 priv->client = awn_config_get_default_for_applet (AWN_APPLET (object), NULL);
258 * used
259 */
260 g_object_get (object, "uid", &uid, NULL);
261 priv->client = awn_config_client_new_for_applet ("taskmanager", NULL);
262 g_free (uid);
263262
264 /* Connect up the important bits */263 /* Connect up the important bits */
265 bridge = awn_config_bridge_get_default ();264 desktop_agnostic_config_client_bind (priv->client,
266 awn_config_bridge_bind (bridge, priv->client, 265 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
267 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "show_all_windows", 266 "show_all_windows",
268 object, "show_all_windows");267 object, "show_all_windows", TRUE,
269 awn_config_bridge_bind (bridge, priv->client, 268 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
270 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "only_show_launchers", 269 NULL);
271 object, "only_show_launchers");270 desktop_agnostic_config_client_bind (priv->client,
272 awn_config_bridge_bind_list (bridge, priv->client, 271 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
273 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "launcher_paths",272 "only_show_launchers",
274 AWN_CONFIG_CLIENT_LIST_TYPE_STRING,273 object, "only_show_launchers", TRUE,
275 object, "launcher_paths");274 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
276 awn_config_bridge_bind (bridge, priv->client, 275 NULL);
277 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "drag_and_drop",276 desktop_agnostic_config_client_bind (priv->client,
278 object, "drag_and_drop");277 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
279 awn_config_bridge_bind (bridge, priv->client, 278 "launcher_paths",
280 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "grouping",279 object, "launcher_paths", FALSE,
281 object, "grouping"); 280 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
282 awn_config_bridge_bind (bridge, priv->client, 281 NULL);
283 AWN_CONFIG_CLIENT_DEFAULT_GROUP, "match_strength",282 desktop_agnostic_config_client_bind (priv->client,
284 object, "match_strength");283 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
284 "drag_and_drop",
285 object, "drag_and_drop", TRUE,
286 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
287 NULL);
288 desktop_agnostic_config_client_bind (priv->client,
289 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
290 "grouping",
291 object, "grouping", TRUE,
292 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
293 NULL);
294 desktop_agnostic_config_client_bind (priv->client,
295 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
296 "match_strength",
297 object, "match_strength", TRUE,
298 DESKTOP_AGNOSTIC_CONFIG_BIND_METHOD_FALLBACK,
299 NULL);
285}300}
286301
287static void302static void
@@ -294,6 +309,7 @@
294 obj_class->constructed = task_manager_constructed;309 obj_class->constructed = task_manager_constructed;
295 obj_class->set_property = task_manager_set_property;310 obj_class->set_property = task_manager_set_property;
296 obj_class->get_property = task_manager_get_property;311 obj_class->get_property = task_manager_get_property;
312 obj_class->dispose = task_manager_dispose;
297313
298 app_class->orient_changed = task_manager_orient_changed;314 app_class->orient_changed = task_manager_orient_changed;
299 app_class->size_changed = task_manager_size_changed;315 app_class->size_changed = task_manager_size_changed;
@@ -313,10 +329,11 @@
313 G_PARAM_CONSTRUCT | G_PARAM_READWRITE);329 G_PARAM_CONSTRUCT | G_PARAM_READWRITE);
314 g_object_class_install_property (obj_class, PROP_ONLY_SHOW_LAUNCHERS, pspec);330 g_object_class_install_property (obj_class, PROP_ONLY_SHOW_LAUNCHERS, pspec);
315331
316 pspec = g_param_spec_pointer ("launcher_paths",332 pspec = g_param_spec_boxed ("launcher-paths",
317 "launcher-paths",333 "launcher paths",
318 "List of paths to launcher desktop files",334 "List of paths to launcher desktop files",
319 G_PARAM_READWRITE);335 G_TYPE_VALUE_ARRAY,
336 G_PARAM_READWRITE);
320 g_object_class_install_property (obj_class, PROP_LAUNCHER_PATHS, pspec);337 g_object_class_install_property (obj_class, PROP_LAUNCHER_PATHS, pspec);
321338
322 pspec = g_param_spec_boolean ("drag_and_drop",339 pspec = g_param_spec_boolean ("drag_and_drop",
@@ -446,6 +463,20 @@
446 task_drag_indicator_refresh (priv->drag_indicator);463 task_drag_indicator_refresh (priv->drag_indicator);
447}464}
448465
466static void
467task_manager_dispose (GObject *object)
468{
469 TaskManagerPrivate *priv;
470
471 priv = TASK_MANAGER_GET_PRIVATE (object);
472
473 desktop_agnostic_config_client_unbind_all_for_object (priv->client,
474 object,
475 NULL);
476
477 G_OBJECT_CLASS (task_manager_parent_class)->dispose (object);
478}
479
449/*480/*
450 * WNCK_SCREEN CALLBACKS481 * WNCK_SCREEN CALLBACKS
451 */482 */
@@ -803,11 +834,13 @@
803#ifdef DEBUG834#ifdef DEBUG
804 g_debug ("%s: regex matched full path = %s",__func__,full_path);835 g_debug ("%s: regex matched full path = %s",__func__,full_path);
805#endif 836#endif
806 AwnDesktopItem * desktop = awn_desktop_item_new (full_path);837 // TODO handle GErrors
838 DesktopAgnosticVFSFile *file = desktop_agnostic_vfs_file_new_for_path (full_path, NULL);
839 DesktopAgnosticFDODesktopEntry * desktop = desktop_agnostic_fdo_desktop_entry_new_for_file (file, NULL);
807 if (desktop)840 if (desktop)
808 {841 {
809 gchar * exec = awn_desktop_item_get_exec (desktop);842 gchar * exec = desktop_agnostic_fdo_desktop_entry_get_string (desktop, "Exec");
810 awn_desktop_item_free (desktop);843 g_object_unref (desktop);
811#ifdef DEBUG844#ifdef DEBUG
812 g_debug ("%s: exec = %s",__func__,exec);845 g_debug ("%s: exec = %s",__func__,exec);
813 g_debug ("%s: cmd = %s",__func__,cmd); 846 g_debug ("%s: cmd = %s",__func__,cmd);
@@ -832,7 +865,8 @@
832 }865 }
833 g_free (exec); 866 g_free (exec);
834 } 867 }
835 } 868 }
869 g_object_unref (file);
836 g_free (full_path);870 g_free (full_path);
837 }871 }
838 }872 }
@@ -1181,27 +1215,20 @@
1181task_manager_append_launcher(TaskManager *manager, const gchar * launcher_path)1215task_manager_append_launcher(TaskManager *manager, const gchar * launcher_path)
1182{1216{
1183 TaskManagerPrivate *priv;1217 TaskManagerPrivate *priv;
1184 GSList * launcher_paths;1218 GValueArray *launcher_paths;
1219 GValue val = {0,};
1185 1220
1186 g_return_if_fail (TASK_IS_MANAGER (manager));1221 g_return_if_fail (TASK_IS_MANAGER (manager));
1187 priv = manager->priv;1222 priv = manager->priv;
11881223
1189 /*1224 g_object_get (G_OBJECT (manager), "launcher_paths", &launcher_paths, NULL);
1190 directly editing priv->launcher_paths does not work... so retrieve,1225 g_value_init (&val, G_TYPE_STRING);
1191 modify, and set1226 g_value_set_string (&val, launcher_path);
1192 TODO once lda is merged have another look.1227 launcher_paths = g_value_array_append (launcher_paths, &val);
1193 */1228 g_object_set (G_OBJECT (manager), "launcher_paths", launcher_paths, NULL);
1194 launcher_paths = awn_config_client_get_list (priv->client,1229 g_value_unset (&val);
1195 AWN_CONFIG_CLIENT_DEFAULT_GROUP,1230 task_manager_refresh_launcher_paths (manager, launcher_paths);
1196 "launcher_paths",1231 g_value_array_free (launcher_paths);
1197 AWN_CONFIG_CLIENT_LIST_TYPE_STRING,
1198 NULL);
1199 launcher_paths = g_slist_append (launcher_paths,g_strdup(launcher_path));
1200 awn_config_client_set_list (priv->client,AWN_CONFIG_CLIENT_DEFAULT_GROUP,
1201 "launcher_paths",AWN_CONFIG_CLIENT_LIST_TYPE_STRING,
1202 launcher_paths,NULL);
1203 task_manager_refresh_launcher_paths (manager,launcher_paths);
1204
1205}1232}
12061233
1207/**1234/**
@@ -1210,93 +1237,111 @@
1210 * that aren't already on the bar.1237 * that aren't already on the bar.
1211 * State: partial - TODO: refresh of a list1238 * State: partial - TODO: refresh of a list
1212 */1239 */
1213static void 1240static void
1214task_manager_refresh_launcher_paths (TaskManager *manager,1241task_manager_refresh_launcher_paths (TaskManager *manager,
1215 GSList *list)1242 GValueArray *list)
1216{1243{
1217 TaskManagerPrivate *priv;1244 TaskManagerPrivate *priv;
1218 GSList *d;
1219 GSList *i;
12201245
1221 g_return_if_fail (TASK_IS_MANAGER (manager));1246 g_return_if_fail (TASK_IS_MANAGER (manager));
1222 priv = manager->priv;1247 priv = manager->priv;
1223 1248
1224 /* FIXME: I guess we should add something to check whether the user has1249 /* FIXME: I guess we should add something to check whether the user has
1225 * removed a launcher. Make sure we don't remove a launcher which has a 1250 * removed a launcher. Make sure we don't remove a launcher which has a
1226 * window set, wait till the window is closed1251 * window set, wait till the window is closed
1227 *1252 *
1228 * FIXME: This approach just is not going to work..1253 * FIXME: This approach just is not going to work..
1229 * IMO we should do something similar to 1254 * IMO we should do something similar to
1230 * awn_applet_manager_refresh_applets() in awn-applet-manager.c1255 * awn_applet_manager_refresh_applets() in awn-applet-manager.c
1231 */1256 */
1232 1257
1233 for (d = list; d; d = d->next)1258 for (guint idx = 0; idx < list->n_values; idx++)
1234 { 1259 {
1260 gchar *path;
1235 gboolean found;1261 gboolean found;
1262
1263 path = g_value_dup_string (g_value_array_get_nth (list, idx));
1236 found = FALSE;1264 found = FALSE;
1237 for (i = priv->icons; i ;i = i->next)1265
1266 for (GSList *icon_iter = priv->icons;
1267 icon_iter != NULL;
1268 icon_iter = icon_iter->next)
1238 {1269 {
1239 TaskIcon * icon = i->data;1270 GSList *items = task_icon_get_items (TASK_ICON (icon_iter->data));
1240 GSList * items = task_icon_get_items (icon);1271
1241 GSList * item_iter;1272 for (GSList *item_iter = items;
1242 for (item_iter = items; item_iter; item_iter = item_iter->next)1273 item_iter != NULL;
1274 item_iter = item_iter->next)
1243 {1275 {
1244 TaskItem * item = item_iter->data;1276 TaskItem *item = item_iter->data;
1245 1277
1246 if ( TASK_IS_LAUNCHER (item) )1278 if (TASK_IS_LAUNCHER (item) &&
1279 g_strcmp0 (task_launcher_get_desktop_path (TASK_LAUNCHER (item)),
1280 path) == 0)
1247 {1281 {
1248 if (g_strcmp0 (task_launcher_get_desktop_path(TASK_LAUNCHER(item)),d->data)==0)1282 found = TRUE;
1249 {1283 break;
1250 found = TRUE;
1251 }
1252 }1284 }
1253 }1285 }
1286 if (found)
1287 {
1288 break;
1289 }
1254 }1290 }
1255 if (!found)1291 if (!found)
1256 {1292 {
1257 TaskItem *launcher = NULL;1293 TaskItem *launcher = NULL;
1258 GtkWidget *icon;1294 GtkWidget *icon;
1259 1295
1260 launcher = task_launcher_new_for_desktop_file (d->data);1296 launcher = task_launcher_new_for_desktop_file (path);
1261 if (launcher)1297 if (launcher)
1262 {1298 {
1263 icon = task_icon_new (AWN_APPLET (manager));1299 icon = task_icon_new (AWN_APPLET (manager));
1264 task_icon_append_item (TASK_ICON (icon), launcher);1300 task_icon_append_item (TASK_ICON (icon), launcher);
1265 gtk_container_add (GTK_CONTAINER (priv->box), icon);1301 gtk_container_add (GTK_CONTAINER (priv->box), icon);
1266 gtk_box_reorder_child (GTK_BOX (priv->box), icon, g_slist_position (list,d));1302 gtk_box_reorder_child (GTK_BOX (priv->box), icon, idx);
1267 priv->icons = g_slist_insert (priv->icons, icon, g_slist_position (list,d));1303 priv->icons = g_slist_insert (priv->icons, icon, idx);
12681304
1269 g_object_weak_ref (G_OBJECT (icon), (GWeakNotify)icon_closed, manager);1305 g_object_weak_ref (G_OBJECT (icon), (GWeakNotify)icon_closed, manager);
1270 g_signal_connect_swapped (icon, 1306 g_signal_connect_swapped (icon,
1271 "visible-changed",1307 "visible-changed",
1272 G_CALLBACK (on_icon_visible_changed), 1308 G_CALLBACK (on_icon_visible_changed),
1273 manager);1309 manager);
1274 g_signal_connect_swapped (awn_overlayable_get_effects (AWN_OVERLAYABLE (icon)), 1310 g_signal_connect_swapped (awn_overlayable_get_effects (AWN_OVERLAYABLE (icon)),
1275 "animation-end", 1311 "animation-end",
1276 G_CALLBACK (on_icon_effects_ends), 1312 G_CALLBACK (on_icon_effects_ends),
1277 icon);1313 icon);
1278 1314
1279 update_icon_visible (manager, TASK_ICON (icon));1315 update_icon_visible (manager, TASK_ICON (icon));
12801316
1281 /* reordening through D&D */1317 /* reordening through D&D */
1282 if(priv->drag_and_drop)1318 if (priv->drag_and_drop)
1283 _drag_add_signals(manager, icon); 1319 {
1320 _drag_add_signals(manager, icon);
1321 }
1284 }1322 }
1285 else1323 else
1286 {1324 {
1287 g_debug ("%s: Bad desktop file '%s'",__func__,(gchar *)d->data);1325 g_debug ("%s: Bad desktop file '%s'", __func__, path);
1288 }1326 }
1289 }1327 }
1328 g_free (path);
1290 }1329 }
1291#if 01330#if 0
1292 for (d = list; d; d = d->next)1331 for (guint idx = 0; idx < list->n_values; idx++)
1293 {1332 {
1294 GtkWidget *icon;1333 gchar *path;
1295 TaskItem *launcher = NULL;1334 TaskItem *launcher = NULL;
12961335 GtkWidget *icon;
1297 launcher = task_launcher_new_for_desktop_file (d->data);1336
12981337 path = g_value_dup_string (g_value_array_get_nth (list, idx));
1299 if (!launcher) continue;1338
1339 launcher = task_launcher_new_for_desktop_file (path);
1340
1341 if (!launcher)
1342 {
1343 continue;
1344 }
1300 /*Nasty... but can't just disable yet*/1345 /*Nasty... but can't just disable yet*/
1301 icon = task_icon_new (AWN_APPLET (manager));1346 icon = task_icon_new (AWN_APPLET (manager));
1302 task_icon_append_item (TASK_ICON (icon), launcher);1347 task_icon_append_item (TASK_ICON (icon), launcher);
@@ -1317,13 +1362,12 @@
1317 update_icon_visible (manager, TASK_ICON (icon));1362 update_icon_visible (manager, TASK_ICON (icon));
13181363
1319 /* reordening through D&D */1364 /* reordening through D&D */
1320 if(priv->drag_and_drop)1365 if (priv->drag_and_drop)
1366 {
1321 _drag_add_signals(manager, icon);1367 _drag_add_signals(manager, icon);
1368 }
1322 }1369 }
1323#endif 1370#endif
1324 for (d = list; d; d = d->next)
1325 g_free (d->data);
1326 g_slist_free (list);
1327}1371}
13281372
1329static void1373static void
@@ -1822,12 +1866,18 @@
1822 }1866 }
1823 launchers = g_slist_reverse(launchers);1867 launchers = g_slist_reverse(launchers);
18241868
1825 awn_config_client_set_list (priv->client, 1869 GValue *val;
1826 AWN_CONFIG_CLIENT_DEFAULT_GROUP, 1870
1827 "launcher_paths", 1871 val = g_value_init (val, G_TYPE_BOXED);
1828 AWN_CONFIG_CLIENT_LIST_TYPE_STRING, 1872 g_value_set_boxed (val, launchers);
1829 launchers, 1873
1830 &err);1874 desktop_agnostic_config_client_set_value (priv->client,
1875 DESKTOP_AGNOSTIC_CONFIG_GROUP_DEFAULT,
1876 "launcher_paths",
1877 val, &err);
1878
1879 g_value_unset (val);
1880
1831 for (d = launchers; d; d = d->next)1881 for (d = launchers; d; d = d->next)
1832 g_free (d->data);1882 g_free (d->data);
1833 g_slist_free (launchers);1883 g_slist_free (launchers);
18341884
=== modified file 'applets/taskmanager/task-settings.c'
--- applets/taskmanager/task-settings.c 2009-04-18 08:54:34 +0000
+++ applets/taskmanager/task-settings.c 2009-08-06 19:36:12 +0000
@@ -17,153 +17,61 @@
17 *17 *
18 */18 */
1919
20#include <assert.h>20#ifdef HAVE_CONFIG_H
21#include "config.h"
22#endif
23
21#include "task-settings.h"24#include "task-settings.h"
2225
23#include "config.h"
24
25/* globals */
26static TaskSettings *settings = NULL;
27static AwnConfigClient *client = NULL;
28
29/* prototypes */26/* prototypes */
3027
31/*28static void
32static void awn_load_bool (AwnConfigClient *lclient, 29cfg_notify_int (const gchar *group, const gchar *key, const GValue *value,
33 const gchar *group,30 gpointer user_data)
34 const gchar *key, 31{
35 gboolean *data, 32 gint* int_value = (gint*)user_data;
36 gboolean def);33 *int_value = g_value_get_int (value);
37static void awn_load_float (AwnConfigClient *lclient, 34}
38 const gchar *group,35
39 const gchar *key, 36static void
40 gfloat *data, 37cfg_load_int (DesktopAgnosticConfigClient *cfg,
41 gfloat def);38 const gchar *group,
42 */39 const gchar *key,
43static void awn_load_int (AwnConfigClient *lclient, 40 gint *data)
44 const gchar *group,41{
45 const gchar *key, 42 /* FIXME handle errors */
46 gint *data, 43 *data = desktop_agnostic_config_client_get_int (cfg, group, key, NULL);
47 gint def);44 desktop_agnostic_config_client_notify_add (cfg, group, key,
4845 cfg_notify_int, data, NULL);
49/*46}
50static void awn_notify_bool (AwnConfigClientNotifyEntry *entry, 47
51 gboolean *data);48/**
52static void awn_notify_float (AwnConfigClientNotifyEntry *entry, 49 * task_settings_get_default:
53 gfloat *data);50 *
54 */51 * Returns: A singleton
55static void awn_notify_int (AwnConfigClientNotifyEntry *entry, 52 *
56 gint *data);53 * Retrieves a structure that holds various values from the panel useful
5754 * for the applet.
55 */
58TaskSettings *56TaskSettings *
59task_settings_get_default (void)57task_settings_get_default (void)
60{58{
61 TaskSettings *s;59 static TaskSettings *settings = NULL;
6260 static DesktopAgnosticConfigClient *client = NULL;
63 if (settings)61
64 return settings;62 if (!settings)
65 63 {
66 s = g_new (TaskSettings, 1);64 settings = g_new (TaskSettings, 1);
6765
68 settings = s;66 /* FIXME handle error */
6967 client = awn_config_get_default (AWN_PANEL_ID_DEFAULT, NULL);
70 client = awn_config_client_new();68
7169 /* Bar settings */
72 /* Bar settings */70
73 awn_config_client_ensure_group(client, "panel");71 cfg_load_int(client, "panel", "size", &(settings->panel_size));
7472 cfg_load_int(client, "panel", "orient", &(settings->orient));
75 awn_load_int(client, "panel", "size", &s->panel_size, 48);73 cfg_load_int(client, "panel", "offset", &(settings->offset));
76 awn_load_int(client, "panel", "orient", &s->orient, 0);74 }
77 awn_load_int(client, "panel", "offset", &s->offset, 0);75
78 76 return settings;
79 return s;
80}
81
82/*
83static void
84awn_notify_bool (AwnConfigClientNotifyEntry *entry, gboolean* data)
85{
86 *data = entry->value.bool_val;
87}
88
89static void
90awn_notify_float (AwnConfigClientNotifyEntry *entry, gfloat* data)
91{
92 *data = entry->value.float_val;
93}
94*/
95static void
96awn_notify_int (AwnConfigClientNotifyEntry *entry, gint* data)
97{
98 *data = entry->value.int_val;
99}
100
101/*
102static void
103awn_load_bool (AwnConfigClient *lclient,
104 const gchar *group,
105 const gchar *key,
106 gboolean *data,
107 gboolean def)
108{
109 if (awn_config_client_entry_exists(lclient, group, key))
110 {
111 *data = awn_config_client_get_bool(lclient, group, key, NULL);
112 }
113 else
114 {
115 g_print("%s unset, setting now\n", key);
116 awn_config_client_set_bool(lclient, group, key, def, NULL);
117 *data = def;
118 }
119
120 awn_config_client_notify_add(lclient, group, key,
121 (AwnConfigClientNotifyFunc)awn_notify_bool,
122 data);
123}
124
125static void
126awn_load_float (AwnConfigClient *lclient,
127 const gchar *group,
128 const gchar *key,
129 gfloat *data,
130 gfloat def)
131{
132 if (awn_config_client_entry_exists(lclient, group, key))
133 {
134 *data = awn_config_client_get_float(lclient, group, key, NULL);
135 }
136 else
137 {
138 g_print("%s unset, setting now\n", key);
139 awn_config_client_set_float(lclient, group, key, def, NULL);
140 *data = def;
141 }
142
143 awn_config_client_notify_add (lclient, group, key,
144 (AwnConfigClientNotifyFunc)awn_notify_float,
145 data);
146}
147*/
148static void
149awn_load_int (AwnConfigClient *lclient,
150 const gchar *group,
151 const gchar *key,
152 gint *data,
153 gint def)
154{
155 if (awn_config_client_entry_exists(lclient, group, key))
156 {
157 *data = awn_config_client_get_int(lclient, group, key, NULL);
158 }
159 else
160 {
161 g_print("%s unset, setting now\n", key);
162 awn_config_client_set_int(lclient, group, key, def, NULL);
163 *data = def;
164 }
165
166 awn_config_client_notify_add (lclient, group, key,
167 (AwnConfigClientNotifyFunc)awn_notify_int,
168 data);
169}77}
17078
=== modified file 'applets/taskmanager/util.c'
--- applets/taskmanager/util.c 2009-08-06 04:36:35 +0000
+++ applets/taskmanager/util.c 2009-08-06 19:54:39 +0000
@@ -112,7 +112,7 @@
112 Other matching algororithms are NOT used if something is special cased.112 Other matching algororithms are NOT used if something is special cased.
113*/113*/
114gchar *114gchar *
115get_special_id_from_desktop (AwnDesktopItem * item)115get_special_id_from_desktop (DesktopAgnosticFDODesktopEntry * entry)
116{116{
117 /*117 /*
118 Exec,Name,filename, special_id. If all in the first 3 match then the 118 Exec,Name,filename, special_id. If all in the first 3 match then the
@@ -128,7 +128,7 @@
128 gboolean match = TRUE;128 gboolean match = TRUE;
129 if (iter->exec)129 if (iter->exec)
130 {130 {
131 gchar * exec = awn_desktop_item_get_exec (item);131 gchar * exec = desktop_agnostic_fdo_desktop_entry_get_string (entry, "Exec");
132 match = g_regex_match_simple(iter->exec, exec,0,0);132 match = g_regex_match_simple(iter->exec, exec,0,0);
133 g_free (exec);133 g_free (exec);
134 if (!match)134 if (!match)
@@ -136,7 +136,7 @@
136 }136 }
137 if (iter->name)137 if (iter->name)
138 {138 {
139 gchar * name = awn_desktop_item_get_name (item);139 gchar * name = desktop_agnostic_fdo_desktop_entry_get_name (entry);
140 match = g_regex_match_simple(iter->name, name,0,0);140 match = g_regex_match_simple(iter->name, name,0,0);
141 g_free (name);141 g_free (name);
142 if (!match)142 if (!match)
@@ -144,8 +144,10 @@
144 }144 }
145 if (iter->filename)145 if (iter->filename)
146 {146 {
147 const gchar * filename = awn_desktop_item_get_filename (item);147 DesktopAgnosticVFSFile *file = desktop_agnostic_fdo_desktop_entry_get_file (entry);
148 gchar *filename = desktop_agnostic_vfs_file_get_path (file);
148 match = g_regex_match_simple(iter->filename, filename,0,0);149 match = g_regex_match_simple(iter->filename, filename,0,0);
150 g_free (filename);
149 if (!match)151 if (!match)
150 continue;152 continue;
151 }153 }
@@ -277,4 +279,4 @@
277 }279 }
278 g_strfreev (cmd_argv); 280 g_strfreev (cmd_argv);
279 return full_cmd;281 return full_cmd;
280}
281\ No newline at end of file282\ No newline at end of file
283}
282284
=== modified file 'applets/taskmanager/util.h'
--- applets/taskmanager/util.h 2009-07-29 01:38:12 +0000
+++ applets/taskmanager/util.h 2009-08-06 19:54:39 +0000
@@ -18,8 +18,9 @@
18#define __TASK_MANAGER_UTIL_H__18#define __TASK_MANAGER_UTIL_H__
1919
20#include <libawn/libawn.h>20#include <libawn/libawn.h>
21#include <libdesktop-agnostic/fdo.h>
2122
22gchar * get_special_id_from_desktop (AwnDesktopItem * item);23gchar * get_special_id_from_desktop (DesktopAgnosticFDODesktopEntry *entry);
2324
24gchar * get_special_id_from_window_data (gchar * cmd, gchar *res_name, 25gchar * get_special_id_from_window_data (gchar * cmd, gchar *res_name,
25 gchar * class_name,const gchar *title);26 gchar * class_name,const gchar *title);
2627
=== modified file 'awn-applet-activation/main.c'
--- awn-applet-activation/main.c 2009-07-08 21:17:59 +0000
+++ awn-applet-activation/main.c 2009-08-06 19:54:39 +0000
@@ -26,9 +26,8 @@
26#include <errno.h>26#include <errno.h>
2727
28#include <libawn/awn-defines.h>28#include <libawn/awn-defines.h>
29#include <libawn/awn-desktop-item.h>
30#include <libawn/awn-applet.h>29#include <libawn/awn-applet.h>
31#include <libawn/awn-vfs.h>30#include <libdesktop-agnostic/fdo.h>
3231
33/* Forwards */32/* Forwards */
34GtkWidget *33GtkWidget *
@@ -99,7 +98,8 @@
99{98{
100 GError *error = NULL;99 GError *error = NULL;
101 GOptionContext *context;100 GOptionContext *context;
102 AwnDesktopItem *item = NULL;101 DesktopAgnosticVFSFile *desktop_file = NULL;
102 DesktopAgnosticFDODesktopEntry *entry = NULL;
103 GtkWidget *applet = NULL;103 GtkWidget *applet = NULL;
104 const gchar *exec;104 const gchar *exec;
105 const gchar *name;105 const gchar *name;
@@ -121,7 +121,13 @@
121121
122 if (!g_thread_supported()) g_thread_init(NULL);122 if (!g_thread_supported()) g_thread_init(NULL);
123123
124 awn_vfs_init();124 desktop_agnostic_vfs_init (&error);
125 if (error)
126 {
127 g_critical ("Error initializing VFS subsystem: %s", error->message);
128 g_error_free (error);
129 return EXIT_FAILURE;
130 }
125131
126 gtk_init(&argc, &argv);132 gtk_init(&argc, &argv);
127133
@@ -132,48 +138,62 @@
132 }138 }
133139
134 /* Try and load the desktop file */140 /* Try and load the desktop file */
135 item = awn_desktop_item_new(path);141 desktop_file = desktop_agnostic_vfs_file_new_for_path (path, &error);
136142
137 if (item == NULL)143 if (error)
138 {144 {
139 g_warning("This desktop file does not exist %s\n", path);145 g_critical ("Error: %s", error->message);
146 g_error_free (error);
147 return 1;
148 }
149
150 if (desktop_file == NULL || !desktop_agnostic_vfs_file_exists (desktop_file))
151 {
152 g_warning ("This desktop file '%s' does not exist.", path);
153 return 1;
154 }
155
156 entry = desktop_agnostic_fdo_desktop_entry_new_for_file (desktop_file, &error);
157
158 if (error)
159 {
160 g_critical ("Error: %s", error->message);
161 g_error_free (error);
162 return 1;
163 }
164
165 if (entry == NULL)
166 {
167 g_warning ("This desktop file '%s' does not exist.", path);
140 return 1;168 return 1;
141 }169 }
142170
143 /* Now we have the file, lets see if we can171 /* Now we have the file, lets see if we can
144 a) load the dynamic library it points to172 a) load the dynamic library it points to
145 b) Find the correct function within that library */173 b) Find the correct function within that library */
146 exec = awn_desktop_item_get_exec(item);174 exec = desktop_agnostic_fdo_desktop_entry_get_string (entry, "Exec");
147175
148 if (exec == NULL)176 if (exec == NULL)
149 {177 {
150 g_warning("No exec path found in desktop file %s\n", path);178 g_warning ("No Exec key found in desktop file '%s', exiting.", path);
151 return 1;179 return 1;
152 }180 }
153181
154 name = awn_desktop_item_get_name(item);182 name = desktop_agnostic_fdo_desktop_entry_get_name (entry);
155183
156 /* Check if this is a Python applet */184 /* Check if this is a Python applet */
157 type = awn_desktop_item_get_string(item, "X-AWN-AppletType");185 type = desktop_agnostic_fdo_desktop_entry_get_string (entry, "X-AWN-AppletType");
158186
159 if (!type)187 if (!type)
160 {188 {
161 /* FIXME we'll maintain this for a bit until the .desktop files are fixed */189 g_warning ("No X-AWN-AppletType key found in desktop file '%s', exiting.", path);
162 type = awn_desktop_item_get_item_type(item);190 return 1;
163
164 if (type)
165 {
166 g_warning("Please inform the developer(s) of the applet '%s' that the .desktop file associated with their applet need to be updated per the Applet Development Guidelines on the AWN Wiki.", name);
167 }
168 }191 }
169192
170 if (type)193 if (strcmp(type, "Python") == 0)
171 {194 {
172 if (strcmp(type, "Python") == 0)195 launch_python(path, exec, uid, window, panel_id);
173 {196 return 0;
174 launch_python(path, exec, uid, window, panel_id);
175 return 0;
176 }
177 }197 }
178198
179 /* Extract canonical-name from exec */199 /* Extract canonical-name from exec */
@@ -195,7 +215,6 @@
195 g_warning ("Could not create applet\n");215 g_warning ("Could not create applet\n");
196 return 1;216 return 1;
197 }217 }
198 name = awn_desktop_item_get_name (item);
199218
200 if (name != NULL)219 if (name != NULL)
201 {220 {
@@ -214,6 +233,14 @@
214233
215 gtk_main();234 gtk_main();
216235
236 desktop_agnostic_vfs_shutdown (&error);
237 if (error)
238 {
239 g_critical ("Error shutting down VFS subsystem: %s", error->message);
240 g_error_free (error);
241 return EXIT_FAILURE;
242 }
243
217 return 0;244 return 0;
218}245}
219246
220247
=== modified file 'awn.pc.in'
--- awn.pc.in 2008-08-11 20:29:13 +0000
+++ awn.pc.in 2009-07-08 01:07:01 +0000
@@ -2,7 +2,6 @@
2exec_prefix=${prefix}2exec_prefix=${prefix}
3libdir=${exec_prefix}/lib3libdir=${exec_prefix}/lib
4includedir=${prefix}/include4includedir=${prefix}/include
5config_backend=@CFG_BACKEND_NAME@
6vapidir=@datarootdir@/vala/vapi5vapidir=@datarootdir@/vala/vapi
76
8Name: libawn7Name: libawn
98
=== modified file 'bindings/python/Makefile.am'
--- bindings/python/Makefile.am 2009-07-13 19:27:22 +0000
+++ bindings/python/Makefile.am 2009-08-06 20:35:34 +0000
@@ -38,6 +38,7 @@
38 $(PYTHON_EXTRA_LDFLAGS) \38 $(PYTHON_EXTRA_LDFLAGS) \
39 $(PYGTK_LIBS) \39 $(PYGTK_LIBS) \
40 $(PYCAIRO_LIBS) \40 $(PYCAIRO_LIBS) \
41 $(AWN_LIBS) \
41 $(top_builddir)/libawn/libawn.la \42 $(top_builddir)/libawn/libawn.la \
42 $(NULL)43 $(NULL)
4344
@@ -54,6 +55,8 @@
54 --py_ssize_t-clean \55 --py_ssize_t-clean \
55 --register $(PYGTK_DEFSDIR)/gdk-types.defs \56 --register $(PYGTK_DEFSDIR)/gdk-types.defs \
56 --register $(PYGTK_DEFSDIR)/gtk-types.defs \57 --register $(PYGTK_DEFSDIR)/gtk-types.defs \
58 --register $(LDA_DEFSDIR)/desktopagnostic.defs \
59 --register $(LDA_DEFSDIR)/desktopagnostic_config.defs \
57 --override $(srcdir)/$*.override \60 --override $(srcdir)/$*.override \
58 --prefix py$* $<) > gen-$*.c \61 --prefix py$* $<) > gen-$*.c \
59 && cp -f gen-$*.c $*.c \62 && cp -f gen-$*.c $*.c \
6063
=== modified file 'bindings/python/awn.defs'
--- bindings/python/awn.defs 2009-07-14 20:40:48 +0000
+++ bindings/python/awn.defs 2009-08-06 20:35:34 +0000
@@ -129,21 +129,6 @@
129 (gtype-id "AWN_TYPE_TOOLTIP")129 (gtype-id "AWN_TYPE_TOOLTIP")
130)130)
131131
132;; Boxed types ...
133(define-boxed Config
134 (in-module "Awn")
135 (c-name "AwnConfigClient")
136 (gtype-id "AWN_TYPE_CONFIG_CLIENT")
137)
138
139(define-boxed DesktopItem
140 (in-module "Awn")
141 (c-name "AwnDesktopItem")
142 (gtype-id "AWN_TYPE_DESKTOP_ITEM")
143 (copy-func "awn_desktop_item_copy")
144 (release-func "awn_desktop_item_free")
145)
146
147;; Enumerations and flags ...132;; Enumerations and flags ...
148133
149(define-flags CairoRoundCorners134(define-flags CairoRoundCorners
@@ -215,35 +200,6 @@
215 )200 )
216)201)
217202
218(define-enum ConfigListType
219 (in-module "Awn")
220 (c-name "AwnConfigListType")
221 (gtype-id "AWN_TYPE_CONFIG_LIST_TYPE")
222 (values
223 '("boolean" "AWN_CONFIG_LIST_TYPE_BOOL")
224 '("float" "AWN_CONFIG_LIST_TYPE_FLOAT")
225 '("integer" "AWN_CONFIG_LIST_TYPE_INT")
226 '("string" "AWN_CONFIG_LIST_TYPE_STRING")
227 )
228)
229
230(define-enum ConfigValueType
231 (in-module "Awn")
232 (c-name "AwnConfigValueType")
233 (gtype-id "AWN_TYPE_CONFIG_VALUE_TYPE")
234 (values
235 '("null" "AWN_CONFIG_VALUE_TYPE_NULL")
236 '("boolean" "AWN_CONFIG_VALUE_TYPE_BOOL")
237 '("float" "AWN_CONFIG_VALUE_TYPE_FLOAT")
238 '("integer" "AWN_CONFIG_VALUE_TYPE_INT")
239 '("string" "AWN_CONFIG_VALUE_TYPE_STRING")
240 '("list_boolean" "AWN_CONFIG_VALUE_TYPE_LIST_BOOL")
241 '("list_float" "AWN_CONFIG_VALUE_TYPE_LIST_FLOAT")
242 '("list_integer" "AWN_CONFIG_VALUE_TYPE_LIST_INT")
243 '("list_string" "AWN_CONFIG_VALUE_TYPE_LIST_STRING")
244 )
245)
246
247;; From awn-dialog.h203;; From awn-dialog.h
248204
249(define-function dialog_new205(define-function dialog_new
@@ -256,209 +212,6 @@
256 )212 )
257)213)
258214
259;; From awn-config-client.h
260
261(define-function config_client_new
262 (c-name "awn_config_client_new")
263 (is-constructor-of "AwnConfigClient")
264 (return-type "AwnConfigClient*")
265)
266
267(define-method clear
268 (of-object "AwnConfigClient")
269 (c-name "awn_config_client_clear")
270 (return-type "none")
271 (parameters
272 '("GError**" "opt_error")
273 )
274)
275
276(define-method ensure_group
277 (of-object "AwnConfigClient")
278 (c-name "awn_config_client_ensure_group")
279 (return-type "none")
280 (parameters
281 '("const-gchar*" "group")
282 )
283)
284
285(define-method notify_add
286 (of-object "AwnConfigClient")
287 (c-name "awn_config_client_notify_add")
288 (return-type "none")
289 (parameters
290 '("const-gchar*" "group")
291 '("const-gchar*" "key")
292 '("AwnConfigClientNotifyFunc" "callback")
293 '("gpointer" "data")
294 )
295)
296
297(define-method exists
298 (of-object "AwnConfigClient")
299 (c-name "awn_config_client_entry_exists")
300 (return-type "gboolean")
301 (parameters
302 '("const-gchar*" "group")
303 '("const-gchar*" "key")
304 )
305)
306
307(define-method get_value_type
308 (of-object "AwnConfigClient")
309 (c-name "awn_config_client_get_value_type")
310 (return-type "AwnConfigValueType")
311 (parameters
312 '("const-gchar*" "group")
313 '("const-gchar*" "key")
314 '("GError**" "opt_error")
315 )
316)
317
318(define-method set_bool
319 (of-object "AwnConfigClient")
320 (c-name "awn_config_client_set_bool")
321 (return-type "none")
322 (parameters
323 '("const-gchar*" "group")
324 '("const-gchar*" "key")
325 '("gboolean" "the_bool")
326 '("GError**" "opt_error")
327 )
328)
329
330(define-method set_int
331 (of-object "AwnConfigClient")
332 (c-name "awn_config_client_set_int")
333 (return-type "none")
334 (parameters
335 '("const-gchar*" "group")
336 '("const-gchar*" "key")
337 '("gint" "the_int")
338 '("GError**" "opt_error")
339 )
340)
341
342(define-method set_string
343 (of-object "AwnConfigClient")
344 (c-name "awn_config_client_set_string")
345 (return-type "none")
346 (parameters
347 '("const-gchar*" "group")
348 '("const-gchar*" "key")
349 '("const-gchar*" "the_string")
350 '("GError**" "opt_error")
351 )
352)
353
354(define-method set_float
355 (of-object "AwnConfigClient")
356 (c-name "awn_config_client_set_float")
357 (return-type "none")
358 (parameters
359 '("const-gchar*" "group")
360 '("const-gchar*" "key")
361 '("gdouble" "the_float")
362 '("GError**" "opt_error")
363 )
364)
365
366(define-method set_list
367 (of-object "AwnConfigClient")
368 (c-name "awn_config_client_set_list")
369 (return-type "none")
370 (parameters
371 '("const-gchar*" "group")
372 '("const-gchar*" "key")
373 '("GConfValueType" "list_type")
374 '("GSList*" "list")
375 '("GError**" "opt_error")
376 )
377)
378
379(define-method get_bool
380 (of-object "AwnConfigClient")
381 (c-name "awn_config_client_get_bool")
382 (return-type "gboolean")
383 (parameters
384 '("const-gchar*" "group")
385 '("const-gchar*" "key")
386 '("GError**" "opt_error")
387 )
388)
389
390(define-method get_int
391 (of-object "AwnConfigClient")
392 (c-name "awn_config_client_get_int")
393 (return-type "gint")
394 (parameters
395 '("const-gchar*" "group")
396 '("const-gchar*" "key")
397 '("GError**" "opt_error")
398 )
399)
400
401(define-method get_string
402 (of-object "AwnConfigClient")
403 (c-name "awn_config_client_get_string")
404 (return-type "gchar*")
405 (parameters
406 '("const-gchar*" "group")
407 '("const-gchar*" "key")
408 '("GError**" "opt_error")
409 )
410)
411
412(define-method get_float
413 (of-object "AwnConfigClient")
414 (c-name "awn_config_client_get_float")
415 (return-type "gfloat")
416 (parameters
417 '("const-gchar*" "group")
418 '("const-gchar*" "key")
419 '("GError**" "opt_error")
420 )
421)
422
423(define-method get_list
424 (of-object "AwnConfigClient")
425 (c-name "awn_config_client_get_list")
426 (return-type "GSList*")
427 (parameters
428 '("const-gchar*" "group")
429 '("const-gchar*" "key")
430 '("AwnConfigListType" "list_type")
431 '("GError**" "opt_error")
432 )
433)
434
435(define-function config_key_lock_open
436 (c-name "awn_config_client_key_lock_open")
437 (return-type "int")
438 (parameters
439 '("const-gchar*" "group")
440 '("const-gchar*" "key")
441 )
442)
443
444(define-function config_key_lock
445 (c-name "awn_config_client_key_lock")
446 (return-type "none")
447 (parameters
448 '("int" "fd")
449 '("int" "operation")
450 )
451)
452
453(define-function config_key_lock_close
454 (c-name "awn_config_client_key_lock_close")
455 (return-type "none")
456 (parameters
457 '("int" "fd")
458 )
459)
460
461
462;; From awn-alignment.h215;; From awn-alignment.h
463216
464(define-function awn_alignment_new_for_applet217(define-function awn_alignment_new_for_applet
@@ -776,162 +529,73 @@
776 )529 )
777)530)
778531
532(define-function awn_cairo_set_source_color
533 (c-name "awn_cairo_set_source_color")
534 (return-type "none")
535 (parameters
536 '("cairo_t*" "cr")
537 '("DesktopAgnosticColor*" "color")
538 )
539)
540
541(define-function awn_cairo_set_source_color_with_alpha_multiplier
542 (c-name "awn_cairo_set_source_color_with_alpha_multiplier")
543 (return-type "none")
544 (parameters
545 '("cairo_t*" "cr")
546 '("DesktopAgnosticColor*" "color")
547 '("gdouble" "multiplier")
548 )
549)
550
551(define-function awn_cairo_set_source_color_with_multipliers
552 (c-name "awn_cairo_set_source_color_with_multipliers")
553 (return-type "none")
554 (parameters
555 '("cairo_t*" "cr")
556 '("DesktopAgnosticColor*" "color")
557 '("gdouble" "color_multiplier")
558 '("gdouble" "alpha_multiplier")
559 )
560)
561
562
563;; From awn-config.h
564
565(define-function awn_config_get_default
566 (c-name "awn_config_get_default")
567 (return-type "DesktopAgnosticConfigClient*")
568 (parameters
569 '("gint" "panel_id")
570 '("GError**" "error")
571 )
572)
573
574(define-function awn_config_get_default_for_applet
575 (c-name "awn_config_get_default_for_applet")
576 (return-type "DesktopAgnosticConfigClient*")
577 (parameters
578 '("AwnApplet*" "applet")
579 '("GError**" "error")
580 )
581)
582
583(define-function awn_config_get_default_for_applet_by_info
584 (c-name "awn_config_get_default_for_applet_by_info")
585 (return-type "DesktopAgnosticConfigClient*")
586 (parameters
587 '("const-gchar*" "name")
588 '("const-gchar*" "uid")
589 '("GError**" "error")
590 )
591)
592
779593
780594
781;; From awn-defines.h595;; From awn-defines.h
782596
783597
784598
785;; From awn-desktop-item.h
786
787(define-function awn_desktop_item_get_type
788 (c-name "awn_desktop_item_get_type")
789 (return-type "GType")
790)
791
792(define-function awn_desktop_item_new
793 (c-name "awn_desktop_item_new")
794 (is-constructor-of "AwnDesktopItem")
795 (return-type "AwnDesktopItem*")
796 (parameters
797 '("gchar*" "filename")
798 )
799)
800
801(define-method get_filename
802 (c-name "awn_desktop_item_get_filename")
803 (of-object "AwnDesktopItem")
804 (return-type "const-gchar*")
805)
806
807(define-method get_item_type
808 (c-name "awn_desktop_item_get_item_type")
809 (of-object "AwnDesktopItem")
810 (return-type "gchar*")
811)
812
813(define-method set_item_type
814 (c-name "awn_desktop_item_set_item_type")
815 (of-object "AwnDesktopItem")
816 (return-type "none")
817 (parameters
818 '("gchar*" "item_type")
819 )
820)
821
822(define-method get_icon
823 (c-name "awn_desktop_item_get_icon")
824 (of-object "AwnDesktopItem")
825 (return-type "GdkPixbuf*")
826 (parameters
827 '("guint" "size")
828 )
829)
830
831(define-method set_icon
832 (c-name "awn_desktop_item_set_icon_name")
833 (of-object "AwnDesktopItem")
834 (return-type "none")
835 (parameters
836 '("gchar*" "icon")
837 )
838)
839
840(define-method get_name
841 (c-name "awn_desktop_item_get_name")
842 (of-object "AwnDesktopItem")
843 (return-type "gchar*")
844)
845
846(define-method set_name
847 (c-name "awn_desktop_item_set_name")
848 (of-object "AwnDesktopItem")
849 (return-type "none")
850 (parameters
851 '("gchar*" "name")
852 )
853)
854
855(define-method get_exec
856 (c-name "awn_desktop_item_get_exec")
857 (of-object "AwnDesktopItem")
858 (return-type "gchar*")
859)
860
861(define-method set_exec
862 (c-name "awn_desktop_item_set_exec")
863 (of-object "AwnDesktopItem")
864 (return-type "none")
865 (parameters
866 '("gchar*" "exec")
867 )
868)
869
870(define-method get_string
871 (c-name "awn_desktop_item_get_string")
872 (of-object "AwnDesktopItem")
873 (return-type "gchar*")
874 (parameters
875 '("gchar*" "key")
876 )
877)
878
879(define-method set_string
880 (c-name "awn_desktop_item_set_string")
881 (of-object "AwnDesktopItem")
882 (return-type "none")
883 (parameters
884 '("gchar*" "key")
885 '("gchar*" "value")
886 )
887)
888
889(define-method get_localestring
890 (c-name "awn_desktop_item_get_localestring")
891 (of-object "AwnDesktopItem")
892 (return-type "gchar*")
893 (parameters
894 '("gchar*" "key")
895 )
896)
897
898(define-method set_localestring
899 (c-name "awn_desktop_item_set_localestring")
900 (of-object "AwnDesktopItem")
901 (return-type "none")
902 (parameters
903 '("gchar*" "key")
904 '("gchar*" "locale")
905 '("gchar*" "value")
906 )
907)
908
909(define-method exists
910 (c-name "awn_desktop_item_exists")
911 (of-object "AwnDesktopItem")
912 (return-type "gboolean")
913)
914
915(define-method launch
916 (c-name "awn_desktop_item_launch")
917 (of-object "AwnDesktopItem")
918 (return-type "gint")
919 (parameters
920 '("GSList*" "documents")
921 '("GError**" "err")
922 )
923)
924
925(define-method save
926 (c-name "awn_desktop_item_save")
927 (of-object "AwnDesktopItem")
928 (return-type "none")
929 (parameters
930 '("gchar*" "new_filename")
931 '("GError**" "err")
932 )
933)
934
935;; From awn-effects.h599;; From awn-effects.h
936600
937(define-function awn_effects_get_type601(define-function awn_effects_get_type
@@ -1401,7 +1065,7 @@
1401 (c-name "awn_tooltip_set_font_color")1065 (c-name "awn_tooltip_set_font_color")
1402 (return-type "none")1066 (return-type "none")
1403 (parameters1067 (parameters
1404 '("const-gchar*" "font_color")1068 '("DesktopAgnosticColor*" "font_color")
1405 )1069 )
1406)1070)
14071071
@@ -1410,7 +1074,7 @@
1410 (c-name "awn_tooltip_set_background_color")1074 (c-name "awn_tooltip_set_background_color")
1411 (return-type "none")1075 (return-type "none")
1412 (parameters1076 (parameters
1413 '("const-gchar*" "bg_color")1077 '("DesktopAgnosticColor*" "bg_color")
1414 )1078 )
1415)1079)
14161080
@@ -1572,8 +1236,6 @@
1572 )1236 )
1573)1237)
15741238
1575;; From awn-vfs.h
1576
1577(define-function vfs_init1239(define-function vfs_init
1578 (c-name "awn_vfs_init")1240 (c-name "awn_vfs_init")
1579 (return-type "none")1241 (return-type "none")
15801242
=== modified file 'bindings/python/awn.override'
--- bindings/python/awn.override 2009-07-14 20:40:48 +0000
+++ bindings/python/awn.override 2009-08-06 20:35:34 +0000
@@ -6,82 +6,27 @@
6#include <pygobject.h>6#include <pygobject.h>
7#include <pycairo.h>7#include <pycairo.h>
8#include <pygtk/pygtk.h>8#include <pygtk/pygtk.h>
9#ifdef USE_GCONF
10#include <gconf/gconf-value.h>
11#endif
12#include <libawn/awn-enum-types.h>9#include <libawn/awn-enum-types.h>
13#include <libawn/libawn.h>10#include <libawn/libawn.h>
1411
15extern Pycairo_CAPI_t *Pycairo_CAPI;12extern Pycairo_CAPI_t *Pycairo_CAPI;
1613
17static GSList *14/* Some hacking to get GdkRegion to work. */
18_pysequence_to_gslist (PyObject *seq, AwnConfigListType list_type)15#ifndef PYGDK_TYPE_REGION
16GType pygdk_region_get_type (void) G_GNUC_CONST;
17#define PYGDK_TYPE_REGION (pygdk_region_get_type ())
18GType
19pygdk_region_get_type (void)
19{20{
20 GSList *list = NULL;21 static GType our_type = 0;
2122
22 int i;23 if (our_type == 0)
23 int len = PySequence_Length (seq);24 /* GdkRegion is already taken by pygtk in its boxing of GdkRegion. */
24 for (i = 0; i < len; i++) {25 our_type = g_type_from_name("GdkRegion");
25 PyObject *item = PySequence_GetItem (seq, i);26 return our_type;
26 Py_DECREF(item);27}
27 switch (list_type) {28#endif /* GDK_TYPE_REGION */
28 case AWN_CONFIG_CLIENT_LIST_TYPE_BOOL: {29
29 gboolean *data = g_malloc (sizeof (gboolean));
30 *data = (gboolean)PyInt_AsLong (item);
31 list = g_slist_append (list, data);
32 break;
33 } case AWN_CONFIG_CLIENT_LIST_TYPE_FLOAT: {
34 gdouble *data = g_malloc (sizeof (gdouble));
35 *data = (gdouble)PyFloat_AsDouble (item);
36 list = g_slist_append (list, data);
37 break;
38 } case AWN_CONFIG_CLIENT_LIST_TYPE_INT: {
39 gint *data = g_malloc (sizeof (gint));
40 *data = (gint)PyInt_AsLong (item);
41 list = g_slist_append (list, data);
42 break;
43 } case AWN_CONFIG_CLIENT_LIST_TYPE_STRING: {
44 gchar *data = g_strdup (PyString_AsString (item));
45 list = g_slist_append (list, data);
46 break;
47 }
48 }
49 }
50 return list;
51}
52static PyObject *
53_gslist_to_pylist (GSList *list, AwnConfigListType list_type) {
54 PyObject *py_list;
55 guint i;
56 gsize slist_len = g_slist_length (list);
57 py_list = PyList_New ((Py_ssize_t)slist_len);
58
59 for (i = 0; i < slist_len; i++) {
60 PyObject *py_data = NULL;
61 gpointer data = g_slist_nth_data (list, i);
62 if (data) {
63 switch (list_type) {
64 case AWN_CONFIG_CLIENT_LIST_TYPE_BOOL:
65 py_data = PyBool_FromLong (*((gboolean*)data));
66 break;
67 case AWN_CONFIG_CLIENT_LIST_TYPE_FLOAT:
68 py_data = PyFloat_FromDouble (*((gdouble*)data));
69 break;
70 case AWN_CONFIG_CLIENT_LIST_TYPE_INT:
71 py_data = PyInt_FromLong (*((gint*)data));
72 break;
73 case AWN_CONFIG_CLIENT_LIST_TYPE_STRING:
74 py_data = PyString_FromString ((gchar*)data);
75 break;
76 }
77 if (PyList_SetItem (py_list, i, py_data) == -1) {
78 PyErr_SetString (PyExc_ValueError, "Could not populate the list with the configuration value.");
79 return NULL;
80 }
81 }
82 }
83 return py_list;
84}
85static gchar**30static gchar**
86_pysequence_to_gchar_array (PyObject *py_seq)31_pysequence_to_gchar_array (PyObject *py_seq)
87{32{
@@ -118,6 +63,7 @@
118modulename awn63modulename awn
119%%64%%
120import gobject.GObject as PyGObject_Type65import gobject.GObject as PyGObject_Type
66import desktopagnostic.Color as PyDesktopAgnosticColor_Type
121import gtk.Alignment as PyGtkAlignment_Type67import gtk.Alignment as PyGtkAlignment_Type
122import gtk.Dialog as PyGtkDialog_Type68import gtk.Dialog as PyGtkDialog_Type
123import gtk.EventBox as PyGtkEventBox_Type69import gtk.EventBox as PyGtkEventBox_Type
@@ -137,101 +83,6 @@
137ignore-glob83ignore-glob
138 *_get_type84 *_get_type
139%%85%%
140override awn_config_client_new kwargs
141static int
142_wrap_awn_config_client_new (PyGBoxed *self, PyObject *args, PyObject *kwargs)
143{
144 static char *kwlist[] = { "name", "uid", NULL };
145 gchar *name = NULL;
146 PyObject *py_uid = NULL;
147 gchar *uid = NULL;
148
149 if (!PyArg_ParseTupleAndKeywords (args, kwargs,"|sO:AwnConfigClient.__init__", kwlist, &name, &py_uid)) {
150 return -1;
151 }
152 self->gtype = AWN_TYPE_CONFIG_CLIENT;
153 self->free_on_dealloc = FALSE;
154 if (name) {
155 if (!py_uid) {
156 PyErr_SetString (PyExc_ValueError, "The uid argument needs to be defined if the name argument is defined");
157 return -1;
158 }
159 if (PyString_Check (py_uid)) {
160 uid = PyString_AsString (py_uid);
161 } else if (py_uid != Py_None) {
162 PyErr_SetString (PyExc_TypeError, "The uid argument must be either a string or None");
163 return -1;
164 }
165 self->boxed = awn_config_client_new_for_applet (name, uid);
166 } else {
167 self->boxed = awn_config_client_new ();
168 }
169
170 if (!self->boxed) {
171 PyErr_SetString (PyExc_RuntimeError, "could not create AwnConfigClient object");
172 return -1;
173 }
174 self->free_on_dealloc = TRUE;
175 return 0;
176}
177%%
178override awn_config_client_get_list kwargs
179static PyObject *
180_wrap_awn_config_client_get_list (PyGBoxed *self, PyObject *args, PyObject *kwargs)
181{
182 static char *kwlist[] = { "group", "key", "list_type", NULL };
183 char *group, *key;
184 AwnConfigListType list_type;
185 GSList *ret = NULL;
186 GError *opt_error = NULL;
187
188 if (!PyArg_ParseTupleAndKeywords (args, kwargs, "ssi:AwnConfigClient.get_list", kwlist, &group, &key, &list_type)) {
189 return NULL;
190 }
191
192 ret = awn_config_client_get_list (pyg_boxed_get (self, AwnConfigClient), group, key, list_type, &opt_error);
193
194 if (pyg_error_check (&opt_error)) {
195 return NULL;
196 }
197
198 return _gslist_to_pylist (ret, list_type);
199}
200%%
201override awn_config_client_set_list kwargs
202static PyObject *
203_wrap_awn_config_client_set_list (PyGBoxed *self, PyObject *args, PyObject *kwargs)
204{
205 static char *kwlist[] = { "group", "key", "list_type", "value", NULL };
206 char *group, *key;
207 AwnConfigListType list_type;
208 PyObject *py_list;
209 GSList *the_list = NULL;
210 GError *opt_error = NULL;
211
212 if (!PyArg_ParseTupleAndKeywords (args, kwargs, "ssiO:AwnConfigClient.set_list", kwlist, &group, &key, &list_type, &py_list)) {
213 return NULL;
214 }
215
216 if (!PyList_Check (py_list) && !PyTuple_Check (py_list)) {
217 PyErr_SetString (PyExc_TypeError, "Fourth argument not a tuple or list");
218 return NULL;
219 }
220 the_list = _pysequence_to_gslist (py_list, list_type);
221
222 awn_config_client_set_list (pyg_boxed_get (self, AwnConfigClient), group, key, list_type, the_list, &opt_error);
223
224 g_slist_foreach (the_list, (GFunc)g_free, NULL);
225 g_slist_free (the_list);
226
227 if (pyg_error_check (&opt_error)) {
228 return NULL;
229 }
230
231 Py_INCREF (Py_None);
232 return Py_None;
233}
234%%
235override awn_applet_simple_set_temp_icon kwargs86override awn_applet_simple_set_temp_icon kwargs
236static PyObject *87static PyObject *
237_wrap_awn_applet_simple_set_temp_icon (PyGObject *self, PyObject *args, PyObject *kwargs)88_wrap_awn_applet_simple_set_temp_icon (PyGObject *self, PyObject *args, PyObject *kwargs)
@@ -239,207 +90,6 @@
239 return _wrap_awn_applet_simple_set_icon (self, args, kwargs);90 return _wrap_awn_applet_simple_set_icon (self, args, kwargs);
240}91}
241%%92%%
242override awn_config_client_notify_add kwargs
243/* Borrowed from gnome-python/trunk/gconf/gconf.override, r585 */
244void
245pyawn_config_client_notify_add (AwnConfigClientNotifyEntry *entry, PyObject *tuple)
246{
247 PyObject *func;
248 PyObject *userdata = NULL;
249 PyObject *notify_entry;
250 PyObject *value;
251 PyObject *ret;
252 PyGILState_STATE state;
253
254 state = pyg_gil_state_ensure ();
255
256 g_assert (PyTuple_Check (tuple));
257 func = PyTuple_GetItem (tuple, 0);
258 userdata = PyTuple_GetItem (tuple, 1);
259
260 /* build the AwnConfigClientNotifyEntry python equivalent manually, as a dictionary */
261 notify_entry = PyDict_New ();
262 PyDict_SetItemString (notify_entry, "client", pyg_boxed_new (AWN_TYPE_CONFIG_CLIENT, entry->client, TRUE, TRUE));
263 PyDict_SetItemString (notify_entry, "group", PyString_FromString (entry->group));
264 PyDict_SetItemString (notify_entry, "key", PyString_FromString (entry->key));
265 switch (awn_config_client_get_value_type (entry->client, entry->group, entry->key, NULL)) {
266 case AWN_CONFIG_VALUE_TYPE_BOOL:
267 value = PyBool_FromLong (entry->value.bool_val);
268 break;
269 case AWN_CONFIG_VALUE_TYPE_FLOAT:
270 value = PyFloat_FromDouble (entry->value.float_val);
271 break;
272 case AWN_CONFIG_VALUE_TYPE_INT:
273 value = PyInt_FromLong (entry->value.int_val);
274 break;
275 case AWN_CONFIG_VALUE_TYPE_STRING:
276 value = PyString_FromString (entry->value.str_val);
277 break;
278 case AWN_CONFIG_VALUE_TYPE_LIST_BOOL:
279 value = _gslist_to_pylist (entry->value.list_val, AWN_CONFIG_CLIENT_LIST_TYPE_BOOL);
280 break;
281 case AWN_CONFIG_VALUE_TYPE_LIST_FLOAT:
282 value = _gslist_to_pylist (entry->value.list_val, AWN_CONFIG_CLIENT_LIST_TYPE_FLOAT);
283 break;
284 case AWN_CONFIG_VALUE_TYPE_LIST_INT:
285 value = _gslist_to_pylist (entry->value.list_val, AWN_CONFIG_CLIENT_LIST_TYPE_INT);
286 break;
287 case AWN_CONFIG_VALUE_TYPE_LIST_STRING:
288 value = _gslist_to_pylist (entry->value.list_val, AWN_CONFIG_CLIENT_LIST_TYPE_STRING);
289 break;
290 default:
291 PyErr_Format (PyExc_ValueError, "Could not determine the value type of the configuration key '[%s]%s'.", entry->group, entry->key);
292 return;
293 break;
294 }
295 PyDict_SetItemString (notify_entry, "value", value);
296
297 if (!userdata) {
298 ret = PyObject_CallFunction (func, "N", notify_entry);
299 } else {
300 ret = PyObject_CallFunction (func, "NO", notify_entry, userdata);
301 }
302
303 if (ret == NULL) {
304 PyErr_Print ();
305 } else {
306 Py_DECREF (ret);
307 }
308
309 pyg_gil_state_release (state);
310}
311
312static PyObject *
313_wrap_awn_config_client_notify_add (PyGBoxed *self, PyObject *args, PyObject *kwargs)
314{
315 static char *kwlist[] = { "group", "key", "func", "user_data", NULL };
316 gchar *group;
317 gchar *key;
318 PyObject *callback;
319 PyObject *extra = NULL;
320 PyObject *data;
321
322 if (!PyArg_ParseTupleAndKeywords (args, kwargs,
323 "ssO|O:AwnConfigClient.notify_add",
324 kwlist, &group, &key,
325 &callback, &extra)) {
326 return NULL;
327 }
328
329 if (!PyCallable_Check (callback)) {
330 PyErr_SetString (PyExc_TypeError, "Third argument not callable");
331 return NULL;
332 }
333
334 if (extra) {
335 Py_INCREF (extra);
336 } else {
337 extra = PyTuple_New (0);
338 }
339
340 data = Py_BuildValue ("(ON)", callback, extra);
341
342 awn_config_client_notify_add (pyg_boxed_get(self, AwnConfigClient),
343 group, key,
344 (AwnConfigClientNotifyFunc)pyawn_config_client_notify_add,
345 data);
346
347 Py_INCREF (Py_None);
348 return Py_None;
349}
350%%
351override awn_desktop_item_launch kwargs
352static PyObject *
353_wrap_awn_desktop_item_launch (PyGBoxed *self, PyObject *args, PyObject *kwargs)
354{
355 static char *kwlist[] = { "documents", NULL };
356 PyObject *py_documents = NULL;
357 GSList *documents = NULL;
358 GError *opt_error = NULL;
359 gint pid;
360
361 if (!PyArg_ParseTupleAndKeywords (args, kwargs, "|O:AwnDesktopItem.launch", kwlist, &py_documents)) {
362 return NULL;
363 }
364
365 if (py_documents) {
366 if (PyList_Check (py_documents) || PyTuple_Check (py_documents)) {
367 /* abuse the utility function */
368 documents = _pysequence_to_gslist (py_documents, AWN_CONFIG_CLIENT_LIST_TYPE_STRING);
369 } else if (PyString_Check (py_documents)) {
370 /* only one argument */
371 documents = g_slist_append (documents, PyString_AsString (py_documents));
372 } else {
373 PyErr_SetString (PyExc_TypeError, "Argument is not a sequence");
374 return NULL;
375 }
376 }
377
378 pid = awn_desktop_item_launch (pyg_boxed_get (self, AwnDesktopItem), documents, &opt_error);
379
380 if (pyg_error_check (&opt_error)) {
381 return NULL;
382 }
383
384 return PyInt_FromLong (pid);
385}
386%%
387override awn_config_client_key_lock_open kwargs
388static PyObject *
389_wrap_awn_config_client_key_lock_open(PyObject *self, PyObject *args, PyObject *kwargs)
390{
391 static char *kwlist[] = { "group", "key", NULL };
392 char *group, *key;
393 int ret;
394
395 if (!PyArg_ParseTupleAndKeywords (args, kwargs,"ss:AwnConfigClient.lock_open", kwlist, &group, &key))
396 return NULL;
397
398 ret = awn_config_client_key_lock_open (group, key);
399
400 return PyInt_FromLong (ret);
401}
402%%
403override awn_config_client_key_lock kwargs
404static PyObject *
405_wrap_awn_config_client_key_lock (PyObject *self, PyObject *args, PyObject *kwargs)
406{
407 static char *kwlist[] = { "fd", "operation", NULL };
408 int fd, operation, ret;
409
410 if (!PyArg_ParseTupleAndKeywords (args, kwargs,"ii:AwnConfigClient.lock", kwlist, &fd, &operation))
411 return NULL;
412
413 ret = awn_config_client_key_lock (fd, operation);
414
415 if (ret != 0) {
416 return PyErr_SetFromErrno(PyExc_IOError);
417 }
418
419 Py_INCREF(Py_None);
420 return Py_None;
421}
422%%
423override awn_config_client_key_lock_close kwargs
424static PyObject *
425_wrap_awn_config_client_key_lock_close (PyObject *self, PyObject *args, PyObject *kwargs)
426{
427 static char *kwlist[] = { "fd", NULL };
428 int fd, ret;
429
430 if (!PyArg_ParseTupleAndKeywords (args, kwargs,"i:AwnConfigClient.lock_close", kwlist, &fd))
431 return NULL;
432
433 ret = awn_config_client_key_lock_close (fd);
434
435 if (ret != 0) {
436 return PyErr_SetFromErrno(PyExc_IOError);
437 }
438
439 Py_INCREF(Py_None);
440 return Py_None;
441}
442%%
443override awn_applet_simple_set_awn_icons kwargs93override awn_applet_simple_set_awn_icons kwargs
444static PyObject *94static PyObject *
445_wrap_awn_applet_simple_set_awn_icons (PyObject *self, PyObject *args, PyObject *kwargs)95_wrap_awn_applet_simple_set_awn_icons (PyObject *self, PyObject *args, PyObject *kwargs)
44696
=== modified file 'bindings/python/awnmodule.c'
--- bindings/python/awnmodule.c 2009-06-23 15:09:15 +0000
+++ bindings/python/awnmodule.c 2009-07-15 01:05:32 +0000
@@ -24,11 +24,6 @@
24#include <pygobject.h>24#include <pygobject.h>
25#include <cairo/cairo.h>25#include <cairo/cairo.h>
26#include <pycairo.h>26#include <pycairo.h>
27#ifdef USE_GCONF
28#include <gconf/gconf.h>
29#include <gconf/gconf-client.h>
30#include <gconf/gconf-value.h>
31#endif
32#include <gtk/gtk.h>27#include <gtk/gtk.h>
33#include <libawn/awn-applet.h>28#include <libawn/awn-applet.h>
34#include <libawn/awn-applet-simple.h>29#include <libawn/awn-applet-simple.h>
3530
=== modified file 'configure.in'
--- configure.in 2009-07-16 15:04:17 +0000
+++ configure.in 2009-08-06 20:35:34 +0000
@@ -16,7 +16,7 @@
16m4_define(pycairo_required_version, 1.0.2) dnl or 1.1.716m4_define(pycairo_required_version, 1.0.2) dnl or 1.1.7
17m4_define(pygtk_required_version, 2.12.0)17m4_define(pygtk_required_version, 2.12.0)
1818
19AM_INIT_AUTOMAKE([1.8])19AM_INIT_AUTOMAKE([1.8 -Wno-portability])
20AM_MAINTAINER_MODE20AM_MAINTAINER_MODE
2121
22AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])22AC_SUBST([ACLOCAL_AMFLAGS], ["\${ACLOCAL_FLAGS}"])
@@ -57,6 +57,11 @@
57AC_SUBST(PYGTK_DEFSDIR)57AC_SUBST(PYGTK_DEFSDIR)
58AC_MSG_RESULT($PYGTK_DEFSDIR)58AC_MSG_RESULT($PYGTK_DEFSDIR)
5959
60AC_MSG_CHECKING(for libdesktop-agnostic Python definitions directory)
61LDA_DEFSDIR=`$PKG_CONFIG --variable=defsdir desktop-agnostic`
62AC_SUBST(LDA_DEFSDIR)
63AC_MSG_RESULT($LDA_DEFSDIR)
64
60PKG_CHECK_MODULES(PYCAIRO, pycairo >= pycairo_required_version)65PKG_CHECK_MODULES(PYCAIRO, pycairo >= pycairo_required_version)
61AC_SUBST(PYCAIRO_CFLAGS)66AC_SUBST(PYCAIRO_CFLAGS)
62AC_SUBST(PYCAIRO_LIBS)67AC_SUBST(PYCAIRO_LIBS)
@@ -131,35 +136,7 @@
131136
132AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, glib-genmarshal)137AC_PATH_PROG(GLIB_GENMARSHAL, glib-genmarshal, glib-genmarshal)
133138
134dnl ==============================================139LIBRARY_MODULES="glib-2.0 >= $MIN_GLIB_VERSION gthread-2.0 gobject-2.0 gtk+-2.0 >= $MIN_GTK_VERSION gdk-2.0 >= $MIN_GTK_VERSION dbus-glib-1 desktop-agnostic"
135dnl Configuration backend
136dnl ==============================================
137AC_MSG_CHECKING([for config backend support])
138AC_ARG_WITH(gconf,
139 AS_HELP_STRING([--with-gconf],
140 [Use GConf to store configuration information]),
141 [if test "$with_gconf" == "no"; then
142 # use Glib's GKeyFile - it's already pulled in.
143 CFG_MODULE=""
144 CFG_BACKEND_NAME="GKeyFile"
145 GCONF_SCHEMA_INSTALL_SOURCE="/dev/null"
146 GCONF_SCHEMA_FILE_DIR="/dev/null"
147 AC_MSG_RESULT([GKeyFile (part of Glib)])
148 fi])
149if test "$with_gconf" != "no"; then
150 CFG_MODULE="gconf-2.0"
151 CFG_BACKEND_NAME="GConf"
152 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
153 if test x"$GCONFTOOL" = xno; then
154 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
155 fi
156 AC_DEFINE([USE_GCONF], 1, [Use GConf to store configuration information])
157 AC_MSG_RESULT([GConf])
158fi
159AC_SUBST(CFG_BACKEND_NAME)
160AM_CONDITIONAL(USE_GCONF, test "$with_gconf" != "no")
161
162LIBRARY_MODULES="glib-2.0 >= $MIN_GLIB_VERSION gthread-2.0 gobject-2.0 gtk+-2.0 >= $MIN_GTK_VERSION gdk-2.0 >= $MIN_GTK_VERSION dbus-glib-1 gio-2.0 $CFG_MODULE desktop-agnostic"
163DOCK_MODULES="x11 xproto xcomposite xrender"140DOCK_MODULES="x11 xproto xcomposite xrender"
164TASKMANAGER_MODULES="libwnck-1.0 >= $MIN_WNCK_VERSION x11 libgtop-2.0"141TASKMANAGER_MODULES="libwnck-1.0 >= $MIN_WNCK_VERSION x11 libgtop-2.0"
165AC_SUBST(LIBRARY_MODULES)142AC_SUBST(LIBRARY_MODULES)
@@ -168,14 +145,8 @@
168PKG_CHECK_MODULES(DOCK, [$DOCK_MODULES])145PKG_CHECK_MODULES(DOCK, [$DOCK_MODULES])
169PKG_CHECK_MODULES(TASKMANAGER, [$LIBRARY_MODULES $TASKMANAGER_MODULES])146PKG_CHECK_MODULES(TASKMANAGER, [$LIBRARY_MODULES $TASKMANAGER_MODULES])
170147
171dnl =============================================148LDA_BINDIR="`$PKG_CONFIG --variable=exec_prefix desktop-agnostic`/bin"
172dnl Startup notification check (eggdesktopfile)149AC_SUBST(LDA_BINDIR)
173dnl =============================================
174
175old_LIBS="$LIBS"
176LIBS="$LIBS $AWN_LIBS"
177AC_CHECK_FUNCS(gdk_x11_display_broadcast_startup_message)
178LIBS="$old_LIBS"
179150
180dnl ==============================================151dnl ==============================================
181dnl DBus152dnl DBus
@@ -188,6 +159,12 @@
188dnl GConf159dnl GConf
189dnl ==============================================160dnl ==============================================
190AM_GCONF_SOURCE_2161AM_GCONF_SOURCE_2
162if test "$enable_schemas_install" != "no"; then
163 AC_PATH_PROG(GCONFTOOL, gconftool-2, no)
164 if test x"$GCONFTOOL" = xno; then
165 AC_MSG_ERROR([gconftool-2 executable not found in your path - should be installed with GConf])
166 fi
167fi
191168
192dnl ==============================================169dnl ==============================================
193dnl Miscellaneous170dnl Miscellaneous
@@ -233,12 +210,11 @@
233data/Makefile210data/Makefile
234data/active/Makefile211data/active/Makefile
235data/avant-window-navigator.desktop.in212data/avant-window-navigator.desktop.in
236data/awn.schema-ini213data/avant-window-navigator.schema-ini
237doc/Makefile214doc/Makefile
238doc/reference/Makefile215doc/reference/Makefile
239libawn/Makefile216libawn/Makefile
240libawn/anims/Makefile217libawn/anims/Makefile
241libawn/egg/Makefile
242po/Makefile.in218po/Makefile.in
243shave/shave219shave/shave
244shave/shave-libtool220shave/shave-libtool
@@ -255,8 +231,6 @@
255echo ""231echo ""
256echo " prefix: ${prefix}"232echo " prefix: ${prefix}"
257echo ""233echo ""
258echo " Configuration Backend: $CFG_BACKEND_NAME"
259echo ""
260echo " Vala Support: ${with_vala}"234echo " Vala Support: ${with_vala}"
261echo ""235echo ""
262echo " Documentation: ${enable_gtk_doc}"236echo " Documentation: ${enable_gtk_doc}"
263237
=== modified file 'data/Makefile.am'
--- data/Makefile.am 2009-07-06 22:12:25 +0000
+++ data/Makefile.am 2009-08-05 07:18:27 +0000
@@ -2,6 +2,8 @@
22
3APP_ICON_NAME = avant-window-navigator3APP_ICON_NAME = avant-window-navigator
4include $(top_srcdir)/Makefile.app-icons4include $(top_srcdir)/Makefile.app-icons
5include $(top_srcdir)/Makefile.shave
6include $(top_srcdir)/Makefile.schemas
57
6# desktop file8# desktop file
79
@@ -39,29 +41,9 @@
3941
40# config-related42# config-related
4143
42if USE_GCONF44schema_DATA = avant-window-navigator.schema-ini
43schemasdir = @GCONF_SCHEMA_FILE_DIR@45
44schemas_in_files = awn.schemas.in46dist_bin_SCRIPTS = awn-applets-migration
45schemas_DATA = $(schemas_in_files:.schemas.in=.schemas)
46
47awn.schemas.in: awn.schema-ini
48 $(top_srcdir)/data/awn-schema-to-gconf $< $@
49
50@INTLTOOL_SCHEMAS_RULE@
51
52if GCONF_SCHEMAS_INSTALL
53install-gconf-schemas: $(schemas_DATA)
54 GCONF_CONFIG_SOURCE=$(GCONF_SCHEMA_CONFIG_SOURCE) $(GCONFTOOL) --makefile-install-rule $(schemas_DATA)
55else
56install-gconf-schemas:
57endif
58else
59install-gconf-schemas:
60endif
61schemadir = $(pkgdatadir)/schemas
62schema_DATA = awn.schema-ini
63
64dist_bin_SCRIPTS = awn-schema-to-gconf awn-applets-migration
6547
66# global48# global
6749
@@ -71,6 +53,6 @@
71 rm -f $(DESTDIR)$(datadir)/icons/hicolor/24x24/apps/avant-window-navigator.png53 rm -f $(DESTDIR)$(datadir)/icons/hicolor/24x24/apps/avant-window-navigator.png
72 rm -f $(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/avant-window-navigator.png54 rm -f $(DESTDIR)$(datadir)/icons/hicolor/32x32/apps/avant-window-navigator.png
7355
74EXTRA_DIST += $(icons) $(text_DATA) $(desktop_DATA).in.in awn.schema-ini awn-themed-icon-ui.glade56EXTRA_DIST += $(icons) $(text_DATA) $(desktop_DATA).in.in avant-window-navigator.schema-ini awn-themed-icon-ui.glade
7557
76CLEANFILES = $(desktop_DATA) $(desktop_DATA).in awn.schemas awn.schemas.in58CLEANFILES = $(desktop_DATA) $(desktop_DATA).in avant-window-navigator.schemas avant-window-navigator.schemas.in
7759
=== renamed file 'data/awn.schema-ini.in' => 'data/avant-window-navigator.schema-ini.in'
--- data/awn.schema-ini.in 2009-07-27 19:35:05 +0000
+++ data/avant-window-navigator.schema-ini.in 2009-07-31 18:34:39 +0000
@@ -1,30 +1,37 @@
1# Avant Window Navigator configuration schema
2# -------------------------------------------
3# schema metadata
4[DEFAULT]
5single_instance = false
6
7# configuration options
1[panel/panel_mode]8[panel/panel_mode]
2type = bool9type = boolean
3default = False10default = false
4description = If True, maximised windows will not cover the panel.11description = If true, maximised windows will not cover the panel.
512
6[panel/expand]13[panel/expand]
7type = bool14type = boolean
8default = False15default = false
9description = If True, the panel will expand to full monitor width/height.16description = If true, the panel will expand to full monitor width/height.
1017
11[panel/orient]18[panel/orient]
12type = int19type = integer
13default = 220default = 2
14description = Orientation of Awn. (top=0, right=1, bottom=2 and left=3)21description = Orientation of Awn. (top=0, right=1, bottom=2 and left=3)
1522
16[panel/offset]23[panel/offset]
17type = int24type = integer
18default = 1025default = 10
19description = Offset of the icons from window border.26description = Offset of the icons from window border.
2027
21[panel/dialog_offset]28[panel/dialog_offset]
22type = int29type = integer
23default = 1530default = 15
24description = Offset between the icons and their dialog.31description = Offset between the icons and their dialog.
2532
26[panel/size]33[panel/size]
27type = int34type = integer
28default = 4835default = 48
29description = The user-visible size of Awn.36description = The user-visible size of Awn.
3037
@@ -44,22 +51,22 @@
44description = The active list UA Screenlets for this panel.51description = The active list UA Screenlets for this panel.
4552
46[panel/monitor_force]53[panel/monitor_force]
47type = bool54type = boolean
48default = False55default = false
49description = Force monitor geometry.56description = Force monitor geometry.
5057
51[panel/monitor_width]58[panel/monitor_width]
52type = int59type = integer
53default = 102460default = 1024
54description = The forced monitor width. Only used if monitor_force is True.61description = The forced monitor width. Only used if monitor_force is true.
5562
56[panel/monitor_height]63[panel/monitor_height]
57type = int64type = integer
58default = 76865default = 768
59description = The forced monitor height. Only used if monitor_force is True.66description = The forced monitor height. Only used if monitor_force is true.
6067
61[panel/monitor_offset]68[panel/monitor_offset]
62type = int69type = integer
63default = 070default = 0
64description = An optional offset when you have more than 1 monitors.71description = An optional offset when you have more than 1 monitors.
6572
@@ -69,17 +76,17 @@
69description = Alignment of a non-expanded panel on the monitor edge.76description = Alignment of a non-expanded panel on the monitor edge.
7077
71[panel/autohide]78[panel/autohide]
72type = int79type = integer
73default = 080default = 0
74description = Auto hides the dock when the cursor is not on the dock (shouldn't be used together with panel_mode). (none=0, keep below=1, fade out=2, see through=3)81description = Auto hides the dock when the cursor is not on the dock (shouldn't be used together with panel_mode). (none=0, keep below=1, fade out=2, see through=3)
7582
76[panel/style]83[panel/style]
77type = int84type = integer
78default = 185default = 1
79description = The style of the bar. (none=0, flat bar=1, 3d bar=2, curved bar=3, edgy=4)86description = The style of the bar. (none=0, flat bar=1, 3d bar=2, curved bar=3, edgy=4)
8087
81[panel/clickthrough]88[panel/clickthrough]
82type = int89type = integer
83default = 190default = 1
84description = Provides possibility to click on windows behind the panel. (0 - never click through, 1 - click through when holding CTRL, 2 - always click through and interact with panel only when holding CTRL)91description = Provides possibility to click on windows behind the panel. (0 - never click through, 1 - click through when holding CTRL, 2 - always click through and interact with panel only when holding CTRL)
8592
@@ -89,47 +96,47 @@
89description = The list of panels.96description = The list of panels.
9097
91[theme/gstep1]98[theme/gstep1]
92type = string99type = color
93default = #454545C8100default = #454545C8
94description = First gradient step color.101description = First gradient step color.
95102
96[theme/gstep2]103[theme/gstep2]
97type = string104type = color
98default = #010101BE105default = #010101BE
99description = Second gradient step color.106description = Second gradient step color.
100107
101[theme/ghistep1]108[theme/ghistep1]
102type = string109type = color
103default = #FFFFFF0B110default = #FFFFFF0B
104description = First highlight gradient step color.111description = First highlight gradient step color.
105112
106[theme/ghistep2]113[theme/ghistep2]
107type = string114type = color
108default = #FFFFFF0A115default = #FFFFFF0A
109description = Second highlight gradient step color.116description = Second highlight gradient step color.
110117
111[theme/dialog_bg]118[theme/dialog_bg]
112type = string119type = color
113default = #AAAAAAEE120default = #AAAAAAEE
114description = Background color for AwnDialog.121description = Background color for AwnDialog.
115122
116[theme/dialog_title_bg]123[theme/dialog_title_bg]
117type = string124type = color
118default = #FFFFFFFF125default = #FFFFFFFF
119description = Background color for AwnDialog's title.126description = Background color for AwnDialog's title.
120127
121[theme/icon_text_color]128[theme/icon_text_color]
122type = string129type = color
123default =130default =
124description = Icon text color. Leave empty to use gtk theme color.131description = Icon text color. Leave empty to use gtk theme color.
125132
126[theme/icon_text_outline_color]133[theme/icon_text_outline_color]
127type = string134type = color
128default =135default =
129description = Icon text outline color. Leave empty to use gtk theme color.136description = Icon text outline color. Leave empty to use gtk theme color.
130137
131[theme/icon_font_mode]138[theme/icon_font_mode]
132type = int139type = integer
133default = 0140default = 0
134description = 0 - solid, 1 - outline, 2 - outline, reversed.141description = 0 - solid, 1 - outline, 2 - outline, reversed.
135142
@@ -139,28 +146,28 @@
139description = width of icon text outline if outline mode is enabled. Suggested values 1.0 - 5.0.146description = width of icon text outline if outline mode is enabled. Suggested values 1.0 - 5.0.
140147
141[theme/border]148[theme/border]
142type = string149type = color
143default = #000000CC150default = #000000CC
144description = Main border color.151description = Main border color.
145152
146[theme/hilight]153[theme/hilight]
147type = string154type = color
148default = #FFFFFF11155default = #FFFFFF11
149description = Internal border color.156description = Internal border color.
150157
151[theme/show_sep]158[theme/show_sep]
152type = bool159type = boolean
153default = True160default = true
154description = Draw separators.161description = Draw separators.
155162
156[theme/sep_color]163[theme/sep_color]
157type = string164type = color
158default = #FFFFFF00165default = #FFFFFF00
159description = Separator color.166description = Separator color.
160167
161[theme/draw_pattern]168[theme/draw_pattern]
162type = bool169type = boolean
163default = False170default = false
164description = Enable drawing of a pattern.171description = Enable drawing of a pattern.
165172
166[theme/pattern_alpha]173[theme/pattern_alpha]
@@ -174,8 +181,8 @@
174description = The location of the pattern to draw.181description = The location of the pattern to draw.
175182
176[theme/gtk_theme_mode]183[theme/gtk_theme_mode]
177type = bool184type = boolean
178default = TRUE185default = true
179description = Whether to use colors from the current Gtk theme.186description = Whether to use colors from the current Gtk theme.
180187
181[theme/corner_radius]188[theme/corner_radius]
@@ -204,12 +211,12 @@
204description = Font name of the tooltip211description = Font name of the tooltip
205212
206[theme/tooltip_font_color]213[theme/tooltip_font_color]
207type = string214type = color
208default = #FFFFFFFF215default = #FFFFFFFF
209description = Font color of the tooltip216description = Font color of the tooltip
210217
211[theme/tooltip_bg_color]218[theme/tooltip_bg_color]
212type = string219type = color
213default = #000000B3220default = #000000B3
214description = Background color of the tooltip221description = Background color of the tooltip
215222
@@ -219,12 +226,12 @@
219description = Path to the current desktop file theme.226description = Path to the current desktop file theme.
220227
221[effects/reflection_offset]228[effects/reflection_offset]
222type = int229type = integer
223default = 0230default = 0
224description = The offset between the icon and it's reflection231description = The offset between the icon and it's reflection
225232
226[effects/icon_effect]233[effects/icon_effect]
227type = int234type = integer
228default = 0235default = 0
229description = A bitmask which stores the type of effect for each event236description = A bitmask which stores the type of effect for each event
230237
@@ -239,8 +246,8 @@
239description = Reflection alpha as a multiple of the current alpha of the icon.246description = Reflection alpha as a multiple of the current alpha of the icon.
240247
241[effects/show_shadows]248[effects/show_shadows]
242type = bool249type = boolean
243default = FALSE250default = false
244description = Show shadows for icons.251description = Show shadows for icons.
245252
246[effects/arrow_icon]253[effects/arrow_icon]
@@ -249,17 +256,17 @@
249description = Path to the png containing the arrow icon.256description = Path to the png containing the arrow icon.
250257
251[shared/dialog_focus_loss_behavior]258[shared/dialog_focus_loss_behavior]
252type = bool259type = boolean
253default = true260default = true
254description = Whether to close dialogs on loss of focus.261description = Whether to close dialogs on loss of focus.
255262
256[shared/allow_generic_config_edit]263[shared/allow_generic_config_edit]
257type = bool264type = boolean
258default = False265default = false
259description = Determines if generic configuration editor is allowed for applets that do not have a customized preferences dialog.266description = Determines if generic configuration editor is allowed for applets that do not have a customized preferences dialog.
260267
261[shared/long_press_timeout]268[shared/long_press_timeout]
262type = int269type = integer
263default = 750270default = 750
264description = Time in ms after which AwnIcon will emit long-press signal.271description = Time in ms after which AwnIcon will emit long-press signal.
265272
266273
=== removed file 'data/awn-schema-to-gconf'
--- data/awn-schema-to-gconf 2008-04-13 00:03:43 +0000
+++ data/awn-schema-to-gconf 1970-01-01 00:00:00 +0000
@@ -1,92 +0,0 @@
1#!/usr/bin/env python
2#
3# Copyright (C) 2007 Mark Lee <avant-wn@lazymalevolence.com>
4#
5# This program is free software; you can redistribute it and/or modify
6# it under the terms of the GNU General Public License as published by
7# the Free Software Foundation; either version 2 of the License, or
8# (at your option) any later version.
9#
10# This program is distributed in the hope that it will be useful,
11# but WITHOUT ANY WARRANTY; without even the implied warranty of
12# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13# GNU General Public License for more details.
14#
15# You should have received a copy of the GNU General Public License
16# along with this program; if not, write to the Free Software
17# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18#
19# Author : Mark Lee <avant-wn@lazymalevolence.com>
20
21import sys
22from ConfigParser import SafeConfigParser as ConfigParser
23try:
24 # >=dev-lang/python-2.5 cElementTree
25 from xml.etree import cElementTree as ET
26except ImportError:
27 try:
28 # >=dev-lang/python-2.5 ElementTree
29 from xml.etree import ElementTree as ET
30 except ImportError:
31 try:
32 # dev-python/lxml
33 import lxml.etree as ET
34 except ImportError:
35 try:
36 # dev-python/celementtree
37 import cElementTree as ET
38 except:
39 # dev-python/elementtree
40 from elementtree import ElementTree as ET
41
42def main(argv):
43 if len(argv) < 2:
44 sys.stderr.write('Usage: %s [input file] [output file] ([key prefix])\n')
45 sys.exit(1)
46 else:
47 in_schema = ConfigParser()
48 in_fp = file(argv[0], 'r')
49 in_schema.readfp(in_fp, argv[0])
50 in_fp.close()
51 out_schema = ET.ElementTree(ET.Element('gconfschemafile'))
52 schemalist = ET.SubElement(out_schema.getroot(), 'schemalist')
53 for key in in_schema.sections():
54 if key.startswith('DEFAULT/'):
55 real_key = key[8:]
56 else:
57 real_key = key
58 if len(argv) == 3:
59 full_key = '/apps/avant-window-navigator/applets/%s/%s' % (argv[2], real_key)
60 else:
61 full_key = '/apps/avant-window-navigator/%s' % real_key
62 schema_key = '/schemas' + full_key
63 schema_element = ET.SubElement(schemalist, 'schema')
64 ET.SubElement(schema_element, 'key').text = schema_key
65 ET.SubElement(schema_element, 'applyto').text = full_key
66 ET.SubElement(schema_element, 'owner').text = 'avant-window-navigator'
67 key_type = in_schema.get(key, 'type')
68 element_type = ET.SubElement(schema_element, 'type')
69 value = in_schema.get(key, 'default')
70 if key_type.startswith('list-'):
71 element_type.text = 'list'
72 ET.SubElement(schema_element, 'list_type').text = key_type[5:]
73 value = '[%s]' % value.replace(';', ',')
74 else:
75 element_type.text = key_type
76 ET.SubElement(schema_element, 'default').text = value
77 locale = ET.SubElement(schema_element, 'locale')
78 locale.set('name', 'C')
79 ET.SubElement(locale, 'short')
80 ET.SubElement(locale, 'long').text = in_schema.get(key, 'description')
81 for lang in [x[12:-1] for x in in_schema.options(key) if x.startswith('description[')]:
82 locale = ET.SubElement(schema_element, 'locale')
83 locale.set('name', lang)
84 ET.SubElement(locale, 'short')
85 ET.SubElement(locale, 'long').text = in_schema.get(key, 'description[%s]' % lang)
86
87 out_schema.write(argv[1], encoding='utf-8')
88
89if __name__ == '__main__':
90 main(sys.argv[1:])
91
92# vim: set ft=python et sw=4 ts=4 sts=4
930
=== modified file 'debian/awn-settings-trunk.install'
--- debian/awn-settings-trunk.install 2009-07-25 14:48:33 +0000
+++ debian/awn-settings-trunk.install 2009-08-05 07:18:27 +0000
@@ -2,6 +2,5 @@
2usr/share/icons/hicolor/*/apps/awn-settings.*2usr/share/icons/hicolor/*/apps/awn-settings.*
3usr/share/icons/hicolor/*/apps/awn-plugins.*3usr/share/icons/hicolor/*/apps/awn-plugins.*
4usr/bin/awn-launcher-editor4usr/bin/awn-launcher-editor
5usr/bin/awn-schema-to-gconf
6usr/bin/awn-settings5usr/bin/awn-settings
7usr/share/applications/awn-settings.desktop6usr/share/applications/awn-settings.desktop
87
=== modified file 'debian/control'
--- debian/control 2009-06-21 22:56:41 +0000
+++ debian/control 2009-08-05 07:18:27 +0000
@@ -20,8 +20,8 @@
20 gtk-doc-tools, 20 gtk-doc-tools,
21 doc-base,21 doc-base,
22 valac (>= 0.5.4),22 valac (>= 0.5.4),
23 python2.5 | python-lxml | python-celementtree | python-elementtree,23 automake,
24 automake24 libdesktop-agnostic-dev,
25Standards-Version: 3.7.325Standards-Version: 3.7.3
26Homepage: https://launchpad.net/avant-window-navigator/26Homepage: https://launchpad.net/avant-window-navigator/
27XS-Python-Version: >= 2.427XS-Python-Version: >= 2.4
@@ -33,6 +33,7 @@
33 ${misc:Depends},33 ${misc:Depends},
34 avant-window-navigator-data-trunk (>= ${source:Version}),34 avant-window-navigator-data-trunk (>= ${source:Version}),
35 python-awn-trunk (>= ${source:Version}),35 python-awn-trunk (>= ${source:Version}),
36 libdesktop-agnostic-vfs,
36 dbus-x11 | dbus37 dbus-x11 | dbus
37Recommends: awn-settings-trunk (>= 0.2),38Recommends: awn-settings-trunk (>= 0.2),
38Suggests: metacity (>= 2.21.5) | xcompmgr | compiz | xfwm4 (>= 4.2)39Suggests: metacity (>= 2.21.5) | xcompmgr | compiz | xfwm4 (>= 4.2)
@@ -58,7 +59,8 @@
58Section: libs59Section: libs
59Architecture: any60Architecture: any
60Depends: ${shlibs:Depends},61Depends: ${shlibs:Depends},
61 ${misc:Depends}62 ${misc:Depends},
63 libdesktop-agnostic0,
62Suggests: metacity (>= 2.21.5) | xcompmgr | compiz | xfwm4 (>= 4.2)64Suggests: metacity (>= 2.21.5) | xcompmgr | compiz | xfwm4 (>= 4.2)
63Conflicts: libawn0-bzr, libawn-bzr, libawn, libawn0, libawn0-testing65Conflicts: libawn0-bzr, libawn-bzr, libawn, libawn0, libawn0-testing
64Replaces: libawn0-bzr, libawn-bzr, libawn, libawn0, libawn0-testing66Replaces: libawn0-bzr, libawn-bzr, libawn, libawn0, libawn0-testing
@@ -83,7 +85,8 @@
83 ${shlibs:Depends},85 ${shlibs:Depends},
84 ${misc:Depends},86 ${misc:Depends},
85 libgnome2-dev,87 libgnome2-dev,
86 libgtk2.0-dev88 libgtk2.0-dev,
89 libdesktop-agnostic-dev,
87Conflicts: libawn-dev-bzr, libawn-dev, libawn-testing-dev90Conflicts: libawn-dev-bzr, libawn-dev, libawn-testing-dev
88Replaces: libawn-dev-bzr, libawn-dev, libawn-testing-dev91Replaces: libawn-dev-bzr, libawn-dev, libawn-testing-dev
89Description: library for avant-window-navigator - development files92Description: library for avant-window-navigator - development files
9093
=== modified file 'doc/reference/Makefile.am'
--- doc/reference/Makefile.am 2009-07-18 07:00:32 +0000
+++ doc/reference/Makefile.am 2009-07-18 07:24:08 +0000
@@ -54,7 +54,6 @@
54IGNORE_HFILES = \54IGNORE_HFILES = \
55 $(DOC_SOURCE_DIR)/gseal-transition.h \55 $(DOC_SOURCE_DIR)/gseal-transition.h \
56 $(DOC_SOURCE_DIR)/stamp-awn-enum-types.h \56 $(DOC_SOURCE_DIR)/stamp-awn-enum-types.h \
57 $(DOC_SOURCE_DIR)/egg/stamp-egg-enum-types.h \
58 $(DOC_SOURCE_DIR)/libawn.h \57 $(DOC_SOURCE_DIR)/libawn.h \
59 $(NULL)58 $(NULL)
6059
6160
=== modified file 'doc/reference/libawn-docs.sgml'
--- doc/reference/libawn-docs.sgml 2009-06-23 09:05:41 +0000
+++ doc/reference/libawn-docs.sgml 2009-07-27 18:33:46 +0000
@@ -15,8 +15,7 @@
15 </chapter>15 </chapter>
16 <chapter>16 <chapter>
17 <title>Base Components</title>17 <title>Base Components</title>
18 <xi:include href="xml/awn-config-bridge.xml"/>18 <xi:include href="xml/awn-config.xml"/>
19 <xi:include href="xml/awn-config-client.xml"/>
20 <xi:include href="xml/awn-dialog.xml"/>19 <xi:include href="xml/awn-dialog.xml"/>
21 <xi:include href="xml/awn-effects.xml"/>20 <xi:include href="xml/awn-effects.xml"/>
22 <xi:include href="xml/awn-tooltip.xml"/>21 <xi:include href="xml/awn-tooltip.xml"/>
2322
=== modified file 'doc/reference/libawn-sections.txt'
--- doc/reference/libawn-sections.txt 2009-07-18 06:39:39 +0000
+++ doc/reference/libawn-sections.txt 2009-07-27 07:19:38 +0000
@@ -321,24 +321,6 @@
321</SECTION>321</SECTION>
322322
323<SECTION>323<SECTION>
324<FILE>awn-config-bridge</FILE>
325AwnConfigBridgePrivate
326<TITLE>AwnConfigBridge</TITLE>
327AwnConfigBridge
328awn_config_bridge_get_default
329awn_config_bridge_bind
330awn_config_bridge_bind_list
331<SUBSECTION Standard>
332AWN_CONFIG_BRIDGE
333AWN_IS_CONFIG_BRIDGE
334AWN_TYPE_CONFIG_BRIDGE
335awn_config_bridge_get_type
336AWN_CONFIG_BRIDGE_CLASS
337AWN_IS_CONFIG_BRIDGE_CLASS
338AWN_CONFIG_BRIDGE_GET_CLASS
339</SECTION>
340
341<SECTION>
342<FILE>awn-overlay-progress-circle</FILE>324<FILE>awn-overlay-progress-circle</FILE>
343<TITLE>AwnOverlayProgressCircle</TITLE>325<TITLE>AwnOverlayProgressCircle</TITLE>
344AwnOverlayProgressCircle326AwnOverlayProgressCircle
@@ -443,10 +425,6 @@
443</SECTION>425</SECTION>
444426
445<SECTION>427<SECTION>
446<FILE>stamp-egg-enum-types</FILE>
447</SECTION>
448
449<SECTION>
450<FILE>libawn</FILE>428<FILE>libawn</FILE>
451</SECTION>429</SECTION>
452430
@@ -459,55 +437,6 @@
459</SECTION>437</SECTION>
460438
461<SECTION>439<SECTION>
462<FILE>awn-vfs</FILE>
463AwnVfsMonitor
464AwnVfsMonitorEvent
465AwnVfsMonitorType
466AwnVfsMonitorFunc
467awn_vfs_monitor_add
468awn_vfs_monitor_emit
469awn_vfs_monitor_remove
470awn_vfs_init
471awn_vfs_get_pathlist_from_string
472</SECTION>
473
474<SECTION>
475<FILE>awn-config-client</FILE>
476AwnConfigClient
477AWN_TYPE_CONFIG_CLIENT
478AWN_CONFIG_CLIENT
479AwnConfigClientNotifyFunc
480AWN_CONFIG_CLIENT_DEFAULT_GROUP
481AwnConfigValueType
482AwnConfigListType
483AwnConfigBackend
484awn_config_client_get_type
485awn_config_client_new
486awn_config_client_new_for_applet
487awn_config_client_query_backend
488awn_config_client_clear
489awn_config_client_ensure_group
490awn_config_client_notify_add
491awn_config_client_entry_exists
492awn_config_client_load_defaults_from_schema
493awn_config_client_key_lock_open
494awn_config_client_key_lock
495awn_config_client_key_lock_close
496awn_config_client_get_value_type
497awn_config_client_get_bool
498awn_config_client_set_bool
499awn_config_client_get_float
500awn_config_client_set_float
501awn_config_client_get_int
502awn_config_client_set_int
503awn_config_client_get_string
504awn_config_client_set_string
505awn_config_client_get_list
506awn_config_client_set_list
507awn_config_client_free
508</SECTION>
509
510<SECTION>
511<FILE>awn-enum-types</FILE>440<FILE>awn-enum-types</FILE>
512awn_orientation_get_type441awn_orientation_get_type
513AWN_TYPE_ORIENTATION442AWN_TYPE_ORIENTATION
@@ -519,20 +448,10 @@
519AWN_TYPE_PATH_TYPE448AWN_TYPE_PATH_TYPE
520awn_cairo_round_corners_get_type449awn_cairo_round_corners_get_type
521AWN_TYPE_CAIRO_ROUND_CORNERS450AWN_TYPE_CAIRO_ROUND_CORNERS
522awn_config_value_type_get_type
523AWN_TYPE_CONFIG_VALUE_TYPE
524awn_config_list_type_get_type
525AWN_TYPE_CONFIG_LIST_TYPE
526awn_config_backend_get_type
527AWN_TYPE_CONFIG_BACKEND
528awn_effect_get_type451awn_effect_get_type
529AWN_TYPE_EFFECT452AWN_TYPE_EFFECT
530awn_overlay_align_get_type453awn_overlay_align_get_type
531AWN_TYPE_OVERLAY_ALIGN454AWN_TYPE_OVERLAY_ALIGN
532awn_vfs_monitor_event_get_type
533AWN_TYPE_VFS_MONITOR_EVENT
534awn_vfs_monitor_type_get_type
535AWN_TYPE_VFS_MONITOR_TYPE
536</SECTION>455</SECTION>
537456
538<SECTION>457<SECTION>
@@ -563,14 +482,13 @@
563482
564<SECTION>483<SECTION>
565<FILE>awn-defines</FILE>484<FILE>awn-defines</FILE>
566AWN_GCONF_PATH
567AWN_APPLET_GCONF_PATH
568AWN_MAX_HEIGHT485AWN_MAX_HEIGHT
569AWN_MIN_HEIGHT486AWN_MIN_HEIGHT
570AwnOrientation487AwnOrientation
571AwnAppletFlags488AwnAppletFlags
572AwnAppletLicense489AwnAppletLicense
573AwnPathType490AwnPathType
491AWN_PANEL_ID_DEFAULT
574AWN_FONT_SIZE_EXTRA_SMALL492AWN_FONT_SIZE_EXTRA_SMALL
575AWN_FONT_SIZE_SMALL493AWN_FONT_SIZE_SMALL
576AWN_FONT_SIZE_MEDIUM494AWN_FONT_SIZE_MEDIUM
@@ -579,31 +497,11 @@
579</SECTION>497</SECTION>
580498
581<SECTION>499<SECTION>
582<FILE>awn-desktop-item</FILE>500<FILE>awn-config</FILE>
583AwnDesktopItem501awn_config_get_default
584AWN_TYPE_DESKTOP_ITEM502awn_config_get_default_for_applet
585AWN_DESKTOP_ITEM503awn_config_get_default_for_applet_by_info
586awn_desktop_item_get_type504awn_config_free
587awn_desktop_item_new
588awn_desktop_item_copy
589awn_desktop_item_get_filename
590awn_desktop_item_get_item_type
591awn_desktop_item_set_item_type
592awn_desktop_item_get_icon_name
593awn_desktop_item_set_icon_name
594awn_desktop_item_get_icon
595awn_desktop_item_get_name
596awn_desktop_item_set_name
597awn_desktop_item_get_exec
598awn_desktop_item_set_exec
599awn_desktop_item_get_string
600awn_desktop_item_set_string
601awn_desktop_item_get_localestring
602awn_desktop_item_set_localestring
603awn_desktop_item_exists
604awn_desktop_item_launch
605awn_desktop_item_save
606awn_desktop_item_free
607</SECTION>505</SECTION>
608506
609<SECTION>507<SECTION>
@@ -616,6 +514,8 @@
616awn_utils_ensure_transparent_bg514awn_utils_ensure_transparent_bg
617awn_utils_make_transparent_bg515awn_utils_make_transparent_bg
618awn_utils_get_offset_modifier_by_path_type516awn_utils_get_offset_modifier_by_path_type
517awn_utils_gslist_to_gvaluearray
518awn_vfs_init
619</SECTION>519</SECTION>
620520
621<SECTION>521<SECTION>
@@ -638,7 +538,6 @@
638AwnCairoRoundCorners538AwnCairoRoundCorners
639awn_cairo_rounded_rect539awn_cairo_rounded_rect
640awn_cairo_rounded_rect_shadow540awn_cairo_rounded_rect_shadow
641AWN_RGBA_SCALE_FACTOR
642awn_cairo_set_source_color541awn_cairo_set_source_color
643awn_cairo_set_source_color_with_alpha_multiplier542awn_cairo_set_source_color_with_alpha_multiplier
644awn_cairo_set_source_color_with_multipliers543awn_cairo_set_source_color_with_multipliers
@@ -647,71 +546,6 @@
647</SECTION>546</SECTION>
648547
649<SECTION>548<SECTION>
650<FILE>eggdesktopfile</FILE>
651EggDesktopFileType
652EggDesktopFile
653egg_desktop_file_get_type
654EGG_TYPE_DESKTOP_FILE
655EGG_DESKTOP_FILE
656egg_desktop_file_new
657egg_desktop_file_new_from_data_dirs
658egg_desktop_file_new_from_key_file
659egg_desktop_file_copy
660egg_desktop_file_free
661egg_desktop_file_get_key_file
662egg_desktop_file_get_source
663egg_desktop_file_get_desktop_file_type
664egg_desktop_file_get_name
665egg_desktop_file_get_icon
666egg_desktop_file_can_launch
667egg_desktop_file_accepts_documents
668egg_desktop_file_accepts_multiple
669egg_desktop_file_accepts_uris
670egg_desktop_file_parse_exec
671egg_desktop_file_launch
672EggDesktopFileLaunchOption
673EGG_DESKTOP_FILE_GROUP
674EGG_DESKTOP_FILE_KEY_TYPE
675EGG_DESKTOP_FILE_KEY_VERSION
676EGG_DESKTOP_FILE_KEY_NAME
677EGG_DESKTOP_FILE_KEY_GENERIC_NAME
678EGG_DESKTOP_FILE_KEY_NO_DISPLAY
679EGG_DESKTOP_FILE_KEY_COMMENT
680EGG_DESKTOP_FILE_KEY_ICON
681EGG_DESKTOP_FILE_KEY_HIDDEN
682EGG_DESKTOP_FILE_KEY_ONLY_SHOW_IN
683EGG_DESKTOP_FILE_KEY_NOT_SHOW_IN
684EGG_DESKTOP_FILE_KEY_TRY_EXEC
685EGG_DESKTOP_FILE_KEY_EXEC
686EGG_DESKTOP_FILE_KEY_PATH
687EGG_DESKTOP_FILE_KEY_TERMINAL
688EGG_DESKTOP_FILE_KEY_MIME_TYPE
689EGG_DESKTOP_FILE_KEY_CATEGORIES
690EGG_DESKTOP_FILE_KEY_STARTUP_NOTIFY
691EGG_DESKTOP_FILE_KEY_STARTUP_WM_CLASS
692EGG_DESKTOP_FILE_KEY_URL
693EGG_DESKTOP_FILE_ERROR
694egg_desktop_file_error_quark
695EggDesktopFileError
696egg_set_desktop_file
697egg_get_desktop_file
698</SECTION>
699
700<SECTION>
701<FILE>egg-enum-types</FILE>
702egg_desktop_file_type_get_type
703EGG_TYPE_DESKTOP_FILE_TYPE
704egg_desktop_file_launch_option_get_type
705EGG_TYPE_DESKTOP_FILE_LAUNCH_OPTION
706egg_desktop_file_error_get_type
707EGG_TYPE_DESKTOP_FILE_ERROR
708</SECTION>
709
710<SECTION>
711<FILE>stamp-egg-enum-types</FILE>
712</SECTION>
713
714<SECTION>
715<FILE>awn-effect-turn</FILE>549<FILE>awn-effect-turn</FILE>
716turn_hover_effect550turn_hover_effect
717turn_effect551turn_effect
718552
=== modified file 'doc/reference/libawn.types'
--- doc/reference/libawn.types 2009-07-18 06:39:39 +0000
+++ doc/reference/libawn.types 2009-07-27 07:19:38 +0000
@@ -6,34 +6,22 @@
6awn_icon_get_type6awn_icon_get_type
7awn_applet_simple_get_type7awn_applet_simple_get_type
8awn_overlay_pixbuf_get_type8awn_overlay_pixbuf_get_type
9awn_config_client_get_type
10awn_orientation_get_type9awn_orientation_get_type
11awn_applet_flags_get_type10awn_applet_flags_get_type
12awn_applet_license_get_type11awn_applet_license_get_type
13awn_path_type_get_type12awn_path_type_get_type
14awn_cairo_round_corners_get_type13awn_cairo_round_corners_get_type
15awn_config_value_type_get_type
16awn_config_list_type_get_type
17awn_config_backend_get_type
18awn_effect_get_type14awn_effect_get_type
19awn_overlay_align_get_type15awn_overlay_align_get_type
20awn_vfs_monitor_event_get_type
21awn_vfs_monitor_type_get_type
22awn_overlay_progress_get_type16awn_overlay_progress_get_type
23awn_desktop_item_get_type
24awn_themed_icon_get_type17awn_themed_icon_get_type
25awn_overlay_throbber_get_type18awn_overlay_throbber_get_type
26awn_applet_get_type19awn_applet_get_type
27awn_effects_get_type20awn_effects_get_type
28awn_alignment_get_type21awn_alignment_get_type
29awn_config_bridge_get_type
30awn_overlay_progress_circle_get_type22awn_overlay_progress_circle_get_type
31awn_icon_box_get_type23awn_icon_box_get_type
32awn_overlay_pixbuf_file_get_type24awn_overlay_pixbuf_file_get_type
33awn_overlayable_get_type25awn_overlayable_get_type
34awn_image_get_type26awn_image_get_type
35awn_overlay_get_type27awn_overlay_get_type
36egg_desktop_file_get_type
37egg_desktop_file_type_get_type
38egg_desktop_file_launch_option_get_type
39egg_desktop_file_error_get_type
4028
=== modified file 'libawn/Makefile.am'
--- libawn/Makefile.am 2009-07-18 07:00:32 +0000
+++ libawn/Makefile.am 2009-07-27 18:28:46 +0000
@@ -1,4 +1,4 @@
1SUBDIRS = egg anims1SUBDIRS = anims
22
3include $(top_srcdir)/Makefile.shave3include $(top_srcdir)/Makefile.shave
4MARSHAL_PREFIX = libawn4MARSHAL_PREFIX = libawn
@@ -33,9 +33,7 @@
33 awn-applet.h \33 awn-applet.h \
34 awn-applet-simple.h \34 awn-applet-simple.h \
35 awn-cairo-utils.h \35 awn-cairo-utils.h \
36 awn-config-bridge.h \36 awn-config.h \
37 awn-config-client.h \
38 awn-desktop-item.h \
39 awn-dialog.h \37 awn-dialog.h \
40 awn-effects.h \38 awn-effects.h \
41 awn-icon.h \39 awn-icon.h \
@@ -54,7 +52,6 @@
54 awn-themed-icon.h \52 awn-themed-icon.h \
55 awn-tooltip.h \53 awn-tooltip.h \
56 awn-utils.h \54 awn-utils.h \
57 awn-vfs.h \
58 libawn.h55 libawn.h
59 $(NULL)56 $(NULL)
6057
@@ -71,7 +68,7 @@
71 awn-applet.c \68 awn-applet.c \
72 awn-applet-simple.c \69 awn-applet-simple.c \
73 awn-cairo-utils.c \70 awn-cairo-utils.c \
74 awn-config-bridge.c \71 awn-config.c \
75 awn-dialog.c \72 awn-dialog.c \
76 awn-effects.c \73 awn-effects.c \
77 awn-effects-ops-new.c \74 awn-effects-ops-new.c \
@@ -92,17 +89,8 @@
92 awn-themed-icon.c \89 awn-themed-icon.c \
93 awn-tooltip.c \90 awn-tooltip.c \
94 awn-utils.c \91 awn-utils.c \
95 awn-vfs.c \
96 $(NULL)92 $(NULL)
9793
98source_c += awn-desktop-item-egg.c
99
100if USE_GCONF
101source_c += awn-config-client-gconf.c
102else
103source_c += awn-config-client-gkeyfile.c
104endif
105
106libawninc_HEADERS = \94libawninc_HEADERS = \
107 $(public_headers) \95 $(public_headers) \
108 $(NULL)96 $(NULL)
@@ -116,7 +104,6 @@
116libawn_la_LDFLAGS = -version-info 0:1:0104libawn_la_LDFLAGS = -version-info 0:1:0
117105
118libawn_la_LIBADD += \106libawn_la_LIBADD += \
119 $(top_builddir)/libawn/egg/libeggdesktopfile.la \
120 $(top_builddir)/libawn/anims/libawn-effects-anims.la \107 $(top_builddir)/libawn/anims/libawn-effects-anims.la \
121 $(NULL)108 $(NULL)
122109
@@ -141,6 +128,4 @@
141128
142CLEANFILES = $(STAMPFILES) $(BUILT_SOURCES)129CLEANFILES = $(STAMPFILES) $(BUILT_SOURCES)
143130
144EXTRA_DIST=awn-config-client-shared.c
145
146# vim: set ts=8 sts=8 sw=8 :131# vim: set ts=8 sts=8 sw=8 :
147132
=== modified file 'libawn/awn-cairo-utils.c'
--- libawn/awn-cairo-utils.c 2009-08-06 06:57:04 +0000
+++ libawn/awn-cairo-utils.c 2009-08-06 19:16:07 +0000
@@ -237,11 +237,11 @@
237{237{
238 g_return_if_fail (color);238 g_return_if_fail (color);
239239
240 cairo_set_source_rgba (cr,240 double red, green, blue, alpha;
241 desktop_agnostic_color_get_red (color) / AWN_RGBA_SCALE_FACTOR,241
242 desktop_agnostic_color_get_green (color) / AWN_RGBA_SCALE_FACTOR,242 desktop_agnostic_color_get_cairo_color (color, &red, &green, &blue, &alpha);
243 desktop_agnostic_color_get_blue (color) / AWN_RGBA_SCALE_FACTOR,243
244 desktop_agnostic_color_get_alpha (color) / AWN_RGBA_SCALE_FACTOR);244 cairo_set_source_rgba (cr, red, green, blue, alpha);
245}245}
246246
247void247void
@@ -252,11 +252,11 @@
252 g_return_if_fail (color);252 g_return_if_fail (color);
253 g_return_if_fail (multiplier >= 0 && multiplier <= 1.0);253 g_return_if_fail (multiplier >= 0 && multiplier <= 1.0);
254254
255 cairo_set_source_rgba (cr,255 double red, green, blue, alpha;
256 desktop_agnostic_color_get_red (color) / AWN_RGBA_SCALE_FACTOR,256
257 desktop_agnostic_color_get_green (color) / AWN_RGBA_SCALE_FACTOR,257 desktop_agnostic_color_get_cairo_color (color, &red, &green, &blue, &alpha);
258 desktop_agnostic_color_get_blue (color) / AWN_RGBA_SCALE_FACTOR,258
259 desktop_agnostic_color_get_alpha (color) / AWN_RGBA_SCALE_FACTOR * multiplier);259 cairo_set_source_rgba (cr, red, green, blue, alpha * multiplier);
260}260}
261261
262void262void
@@ -267,11 +267,12 @@
267{267{
268 g_return_if_fail (color);268 g_return_if_fail (color);
269269
270 cairo_set_source_rgba (cr,270 double red, green, blue, alpha;
271 desktop_agnostic_color_get_red (color) / AWN_RGBA_SCALE_FACTOR * color_multiplier,271
272 desktop_agnostic_color_get_green (color) / AWN_RGBA_SCALE_FACTOR * color_multiplier,272 desktop_agnostic_color_get_cairo_color (color, &red, &green, &blue, &alpha);
273 desktop_agnostic_color_get_blue (color) / AWN_RGBA_SCALE_FACTOR * color_multiplier,273
274 desktop_agnostic_color_get_alpha (color) / AWN_RGBA_SCALE_FACTOR * alpha_multiplier);274 cairo_set_source_rgba (cr, red * color_multiplier, green * color_multiplier,
275 blue * color_multiplier, alpha * alpha_multiplier);
275}276}
276277
277void278void
@@ -281,11 +282,11 @@
281{282{
282 g_return_if_fail (color);283 g_return_if_fail (color);
283284
284 cairo_pattern_add_color_stop_rgba (pattern, offset,285 double red, green, blue, alpha;
285 desktop_agnostic_color_get_red (color) / AWN_RGBA_SCALE_FACTOR,286
286 desktop_agnostic_color_get_green (color) / AWN_RGBA_SCALE_FACTOR,287 desktop_agnostic_color_get_cairo_color (color, &red, &green, &blue, &alpha);
287 desktop_agnostic_color_get_blue (color) / AWN_RGBA_SCALE_FACTOR,288
288 desktop_agnostic_color_get_alpha (color) / AWN_RGBA_SCALE_FACTOR);289 cairo_pattern_add_color_stop_rgba (pattern, offset, red, green, blue, alpha);
289}290}
290291
291void292void
@@ -297,11 +298,12 @@
297 g_return_if_fail (color);298 g_return_if_fail (color);
298 g_return_if_fail (multiplier >= 0 && multiplier <= 1.0);299 g_return_if_fail (multiplier >= 0 && multiplier <= 1.0);
299300
300 cairo_pattern_add_color_stop_rgba (pattern, offset,301 double red, green, blue, alpha;
301 desktop_agnostic_color_get_red (color) / AWN_RGBA_SCALE_FACTOR,302
302 desktop_agnostic_color_get_green (color) / AWN_RGBA_SCALE_FACTOR,303 desktop_agnostic_color_get_cairo_color (color, &red, &green, &blue, &alpha);
303 desktop_agnostic_color_get_blue (color) / AWN_RGBA_SCALE_FACTOR,304
304 desktop_agnostic_color_get_alpha (color) / AWN_RGBA_SCALE_FACTOR * multiplier);305 cairo_pattern_add_color_stop_rgba (pattern, offset, red, green, blue,
306 alpha * multiplier);
305}307}
306308
307/* vim: set et ts=2 sts=2 sw=2 ai cindent : */309/* vim: set et ts=2 sts=2 sw=2 ai cindent : */
308310
=== modified file 'libawn/awn-cairo-utils.h'
--- libawn/awn-cairo-utils.h 2009-08-01 03:51:13 +0000
+++ libawn/awn-cairo-utils.h 2009-08-05 04:06:09 +0000
@@ -58,8 +58,6 @@
58 double radius, AwnCairoRoundCorners state,58 double radius, AwnCairoRoundCorners state,
59 double shadow_radius, double shadow_alpha);59 double shadow_radius, double shadow_alpha);
6060
61#define AWN_RGBA_SCALE_FACTOR (double)(G_MAXUSHORT)
62
63void61void
64awn_cairo_set_source_color (cairo_t *cr,62awn_cairo_set_source_color (cairo_t *cr,
65 DesktopAgnosticColor *color);63 DesktopAgnosticColor *color);
6664
=== removed file 'libawn/awn-config-bridge.c'
--- libawn/awn-config-bridge.c 2008-12-24 23:54:53 +0000
+++ libawn/awn-config-bridge.c 1970-01-01 00:00:00 +0000
@@ -1,317 +0,0 @@
1/*
2 * Copyright (C) 2008 Neil Jagdish Patel <njpatel@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Author : Neil Jagdish Patel <njpatel@gmail.com>
19 *
20 */
21
22#include "config.h"
23
24#include "awn-config-bridge.h"
25
26G_DEFINE_TYPE (AwnConfigBridge, awn_config_bridge, G_TYPE_OBJECT)
27
28#define AWN_CONFIG_BRIDGE_GET_PRIVATE(obj) (G_TYPE_INSTANCE_GET_PRIVATE (obj, \
29 AWN_TYPE_CONFIG_BRIDGE, AwnConfigBridgePrivate))
30
31struct _AwnConfigBridgePrivate
32{
33 GList *binds;
34};
35
36typedef struct
37{
38 GObject *object;
39 gchar *property_name;
40 AwnConfigListType type;
41
42} AwnConfigBind;
43
44/*
45 * FORWARDS
46 */
47static void on_boolean_key_changed (AwnConfigClientNotifyEntry *entry,
48 gpointer data);
49static void on_float_key_changed (AwnConfigClientNotifyEntry *entry,
50 gpointer data);
51static void on_int_key_changed (AwnConfigClientNotifyEntry *entry,
52 gpointer data);
53static void on_string_key_changed (AwnConfigClientNotifyEntry *entry,
54 gpointer data);
55static void on_list_key_changed (AwnConfigClientNotifyEntry *entry,
56 gpointer data);
57
58static void
59awn_config_bridge_dispose (GObject *object)
60{
61 AwnConfigBridgePrivate *priv = AWN_CONFIG_BRIDGE_GET_PRIVATE (object);
62 GList *b;
63
64 for (b = priv->binds; b; b = b->next)
65 {
66 AwnConfigBind *bind = b->data;
67
68 g_free (bind->property_name);
69 g_slice_free (AwnConfigBind, bind);
70 }
71 g_list_free (priv->binds);
72
73 G_OBJECT_CLASS (awn_config_bridge_parent_class)->dispose (object);
74}
75
76static void
77awn_config_bridge_class_init (AwnConfigBridgeClass *klass)
78{
79 GObjectClass *obj_class = G_OBJECT_CLASS (klass);
80
81 obj_class->dispose = awn_config_bridge_dispose;
82
83 g_type_class_add_private (obj_class, sizeof (AwnConfigBridgePrivate));
84}
85
86
87static void
88awn_config_bridge_init (AwnConfigBridge *bridge)
89{
90 AwnConfigBridgePrivate *priv;
91
92 priv = bridge->priv = AWN_CONFIG_BRIDGE_GET_PRIVATE (bridge);
93
94 priv->binds = NULL;
95}
96
97AwnConfigBridge *
98awn_config_bridge_get_default (void)
99{
100 AwnConfigBridge *bridge = NULL;
101
102 if (!bridge)
103 bridge = g_object_new (AWN_TYPE_CONFIG_BRIDGE, NULL);
104
105 return bridge;
106}
107
108/*
109 * Binding function for most types
110 */
111void
112awn_config_bridge_bind (AwnConfigBridge *bridge,
113 AwnConfigClient *client,
114 const gchar *group,
115 const gchar *key,
116 GObject *object,
117 const gchar *property_name)
118{
119 AwnConfigBridgePrivate *priv;
120 AwnConfigBind *bind;
121 GParamSpec *spec;
122 gchar *string;
123 GError *error;
124 gboolean key_exists;
125
126 g_return_if_fail (AWN_IS_CONFIG_BRIDGE (bridge));
127 g_return_if_fail (client);
128 g_return_if_fail (group);
129 g_return_if_fail (key);
130 g_return_if_fail (G_IS_OBJECT (object));
131 g_return_if_fail (property_name);
132 priv = bridge->priv;
133
134 error = NULL;
135
136 bind = g_slice_new0 (AwnConfigBind);
137 bind->object = object;
138 bind->property_name = g_strdup (property_name);
139
140 spec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),
141 property_name);
142
143 key_exists = awn_config_client_entry_exists(client, group, key);
144
145 switch (G_PARAM_SPEC_VALUE_TYPE (spec))
146 {
147 case G_TYPE_BOOLEAN:
148 if (key_exists) {
149 g_object_set (object, property_name,
150 awn_config_client_get_bool (client, group, key, &error),
151 NULL);
152 }
153 awn_config_client_notify_add (client, group, key,
154 on_boolean_key_changed, bind);
155 break;
156
157 case G_TYPE_FLOAT:
158 case G_TYPE_DOUBLE:
159 if (key_exists) {
160 g_object_set (object, property_name,
161 awn_config_client_get_float (client, group, key, &error),
162 NULL);
163 }
164 awn_config_client_notify_add (client, group, key,
165 on_float_key_changed, bind);
166 break;
167
168 case G_TYPE_INT:
169 case G_TYPE_UINT:
170 if (key_exists) {
171 g_object_set (object, property_name,
172 awn_config_client_get_int (client, group, key, &error),
173 NULL);
174 }
175 awn_config_client_notify_add (client, group, key,
176 on_int_key_changed, bind);
177 break;
178
179 case G_TYPE_STRING:
180 string = awn_config_client_get_string (client, group, key, &error);
181 if (key_exists) {
182 g_object_set (object, property_name,
183 string,
184 NULL);
185 }
186 awn_config_client_notify_add (client, group, key,
187 on_string_key_changed, bind);
188 if (string) g_free (string);
189 break;
190
191 default:
192 g_print ("Unable to handle type for %s\n", property_name);
193 g_free (bind->property_name);
194 g_slice_free (AwnConfigBind, bind);
195 return;
196 }
197
198 if (error)
199 {
200 g_warning ("Error binding ConfigClient: %s\n", error->message);
201 g_error_free (error);
202 }
203
204 priv->binds = g_list_append (priv->binds, bind);
205}
206
207void
208awn_config_bridge_bind_list (AwnConfigBridge *bridge,
209 AwnConfigClient *client,
210 const gchar *group,
211 const gchar *key,
212 AwnConfigListType list_type,
213 GObject *object,
214 const gchar *property_name)
215{
216 AwnConfigBridgePrivate *priv;
217 AwnConfigBind *bind;
218 GParamSpec *spec;
219 GSList *list;
220
221
222 g_return_if_fail (AWN_IS_CONFIG_BRIDGE (bridge));
223 g_return_if_fail (client);
224 g_return_if_fail (group);
225 g_return_if_fail (key);
226 g_return_if_fail (G_IS_OBJECT (object));
227 g_return_if_fail (property_name);
228 priv = bridge->priv;
229
230 bind = g_slice_new0 (AwnConfigBind);
231 bind->object = object;
232 bind->property_name = g_strdup (property_name);
233 bind->type = list_type;
234
235 spec = g_object_class_find_property (G_OBJECT_GET_CLASS (object),
236 property_name);
237
238 if (G_PARAM_SPEC_VALUE_TYPE (spec) != G_TYPE_POINTER)
239 {
240 g_warning ("Unable to bridge between lists and anything != G_TYPE_POINTER");
241 g_free (bind->property_name);
242 g_slice_free (AwnConfigBind, bind);
243 return;
244 }
245
246 list = awn_config_client_get_list (client, group, key, list_type, NULL);
247 g_object_set (object, property_name, list, NULL);
248
249 awn_config_client_notify_add (client, group, key, on_list_key_changed, bind);
250
251 priv->binds = g_list_append (priv->binds, bind);
252}
253
254static void
255on_boolean_key_changed (AwnConfigClientNotifyEntry *entry,
256 gpointer data)
257{
258 AwnConfigBind *bind = (AwnConfigBind*)data;
259
260 g_return_if_fail (bind);
261
262 g_object_set (bind->object,
263 bind->property_name, entry->value.bool_val,
264 NULL);
265}
266
267static void
268on_float_key_changed (AwnConfigClientNotifyEntry *entry,
269 gpointer data)
270{
271 AwnConfigBind *bind = (AwnConfigBind*)data;
272
273 g_return_if_fail (bind);
274
275 g_object_set (bind->object,
276 bind->property_name, entry->value.float_val,
277 NULL);
278}
279
280static void
281on_int_key_changed (AwnConfigClientNotifyEntry *entry,
282 gpointer data)
283{
284 AwnConfigBind *bind = (AwnConfigBind*)data;
285
286 g_return_if_fail (bind);
287
288 g_object_set (bind->object,
289 bind->property_name, entry->value.int_val,
290 NULL);
291}
292
293static void
294on_string_key_changed (AwnConfigClientNotifyEntry *entry,
295 gpointer data)
296{
297 AwnConfigBind *bind = (AwnConfigBind*)data;
298
299 g_return_if_fail (bind);
300
301 g_object_set (bind->object,
302 bind->property_name, entry->value.str_val,
303 NULL);
304}
305
306static void
307on_list_key_changed (AwnConfigClientNotifyEntry *entry,
308 gpointer data)
309{
310 AwnConfigBind *bind = (AwnConfigBind*)data;
311
312 g_return_if_fail (bind);
313
314 g_object_set (bind->object,
315 bind->property_name, entry->value.list_val,
316 NULL);
317}
3180
=== removed file 'libawn/awn-config-bridge.h'
--- libawn/awn-config-bridge.h 2008-09-27 18:44:29 +0000
+++ libawn/awn-config-bridge.h 1970-01-01 00:00:00 +0000
@@ -1,86 +0,0 @@
1/*
2 * Copyright (C) 2008 Neil Jagdish Patel <njpatel@gmail.com>
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License
15 * along with this program; if not, write to the Free Software
16 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * Author : Neil Jagdish Patel <njpatel@gmail.com>
19*/
20
21#ifndef _AWN_CONFIG_BRIDGE_H
22#define _AWN_CONFIG_BRIDGE_H
23
24#include <glib.h>
25#include <glib-object.h>
26
27#include <libawn/awn-config-client.h>
28
29G_BEGIN_DECLS
30
31#define AWN_TYPE_CONFIG_BRIDGE (awn_config_bridge_get_type())
32
33#define AWN_CONFIG_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_CAST ((obj), AWN_TYPE_CONFIG_BRIDGE, \
34 AwnConfigBridge))
35
36#define AWN_CONFIG_BRIDGE_CLASS(obj) (G_TYPE_CHECK_CLASS_CAST ((obj), AWN_TYPE_CONFIG_BRIDGE, \
37 AwnConfigBridgeClass))
38
39#define AWN_IS_CONFIG_BRIDGE(obj) (G_TYPE_CHECK_INSTANCE_TYPE ((obj), AWN_TYPE_CONFIG_BRIDGE))
40
41#define AWN_IS_CONFIG_BRIDGE_CLASS(obj) (G_TYPE_CHECK_CLASS_TYPE ((obj), \
42 AWN_TYPE_CONFIG_BRIDGE))
43
44#define AWN_CONFIG_BRIDGE_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj), \
45 AWN_TYPE_CONFIG_BRIDGE, AwnConfigBridgeClass))
46
47typedef struct _AwnConfigBridge AwnConfigBridge;
48typedef struct _AwnConfigBridgeClass AwnConfigBridgeClass;
49typedef struct _AwnConfigBridgePrivate AwnConfigBridgePrivate;
50
51struct _AwnConfigBridge
52{
53 GObject parent;
54
55 AwnConfigBridgePrivate *priv;
56};
57
58struct _AwnConfigBridgeClass
59{
60 GObjectClass parent_class;
61};
62
63GType awn_config_bridge_get_type (void) G_GNUC_CONST;
64
65AwnConfigBridge * awn_config_bridge_get_default (void);
66
67void awn_config_bridge_bind (AwnConfigBridge *bridge,
68 AwnConfigClient *client,
69 const gchar *group,
70 const gchar *key,
71 GObject *object,
72 const gchar *prop_name);
73
74void awn_config_bridge_bind_list (AwnConfigBridge *bridge,
75 AwnConfigClient *client,
76 const gchar *group,
77 const gchar *key,
78 AwnConfigListType list_type,
79 GObject *object,
80 const gchar *prop_name);
81
82
83G_END_DECLS
84
85#endif /* _AWN_CONFIG_BRIDGE_H */
86
870
=== removed file 'libawn/awn-config-client-gconf.c'
--- libawn/awn-config-client-gconf.c 2009-05-25 02:12:33 +0000
+++ libawn/awn-config-client-gconf.c 1970-01-01 00:00:00 +0000
@@ -1,509 +0,0 @@
1/*
2 * Copyright (C) 2007, 2008 Mark Lee <avant-wn@lazymalevolence.com>
3 *
4 * This library is free software; you can redistribute it and/or
5 * modify it under the terms of the GNU Lesser General Public
6 * License as published by the Free Software Foundation; either
7 * version 2 of the License, or (at your option) any later version.
8 *
9 * This library is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 * Lesser General Public License for more details.
13 *
14 * You should have received a copy of the GNU Lesser General Public
15 * License along with this library; if not, write to the
16 * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
17 * Boston, MA 02111-1307, USA.
18 *
19 * Author : Mark Lee <avant-wn@lazymalevolence.com>
20 */
21
22#ifdef HAVE_CONFIG_H
23#include <config.h>
24#endif
25
26#include <glib.h>
27#ifdef HAVE_UNISTD_H
28#include <unistd.h>
29#endif
30
31#include <gconf/gconf-client.h>
32
33#include "libawn/awn-config-client.h"
34#include "libawn/awn-defines.h"
35#include "awn-config-client-shared.c"
36
37struct _AwnConfigClient
38{
39 GConfClient *client;
40 gchar *path; /* key prefix */
41};
42
43typedef struct
44{
45 AwnConfigClient *client;
46 AwnConfigClientNotifyFunc callback;
47 gpointer data;
48} AwnConfigClientNotifyData;
49
50/* returns a newly allocated string */
51static gchar *
52awn_config_client_generate_key (AwnConfigClient *client,
53 const gchar *group,
54 const gchar *key)
55{
56 if (key == NULL)
57 {
58 if (strcmp (group, AWN_CONFIG_CLIENT_DEFAULT_GROUP) == 0) {
59 return g_strdup (client->path);
60 }
61 else
62 {
63 return g_strconcat (client->path, "/", group, NULL);
64 }
65 }
66 else
67 {
68 if (strcmp (group, AWN_CONFIG_CLIENT_DEFAULT_GROUP) == 0)
69 {
70 return g_strconcat (client->path, "/", key, NULL);
71 }
72 else
73 {
74 return g_strconcat (client->path, "/", group, "/", key, NULL);
75 }
76 }
77}
78
79static void
80awn_config_client_notify_proxy (GConfClient *client,
81 guint cid,
82 GConfEntry *entry,
83 AwnConfigClientNotifyData *notify)
84{
85 AwnConfigClientNotifyEntry *awn_entry = g_new (AwnConfigClientNotifyEntry, 1);
86 GConfValue *value = NULL;
87 value = gconf_entry_get_value (entry);
88
89 if (value)
90 {
91 gchar **exploded = g_strsplit (gconf_entry_get_key (entry), "/", 0);
92 guint exploded_len = g_strv_length (exploded);
93 gchar **base_exploded = g_strsplit (notify->client->path, "/", 0);
94 guint base_exploded_len = g_strv_length (base_exploded);
95 g_strfreev (base_exploded);
96 g_return_if_fail (exploded_len >= 2);
97 awn_entry->client = notify->client;
98
99 if (exploded_len - base_exploded_len == 1)
100 {
101 /* special case: top-level dock/applet keys */
102 awn_entry->group = g_strdup (AWN_CONFIG_CLIENT_DEFAULT_GROUP);
103 }
104 else
105 {
106 awn_entry->group = g_strdup (exploded[exploded_len - 2]);
107 }
108 awn_entry->key = g_strdup (exploded[exploded_len - 1]);
109 g_strfreev (exploded);
110
111 switch (value->type)
112 {
113 case GCONF_VALUE_BOOL:
114 awn_entry->value.bool_val = gconf_value_get_bool (value);
115 break;
116 case GCONF_VALUE_FLOAT:
117 awn_entry->value.float_val = (gfloat)gconf_value_get_float (value);
118 break;
119 case GCONF_VALUE_INT:
120 awn_entry->value.int_val = gconf_value_get_int (value);
121 break;
122 case GCONF_VALUE_LIST:
123 awn_entry->value.list_val = gconf_client_get_list (client, entry->key, gconf_value_get_list_type (value), NULL);
124 break;
125 case GCONF_VALUE_STRING:
126 awn_entry->value.str_val = (gchar*)gconf_value_get_string (value);
127 break;
128 default:
129 /* FIXME do an error? */
130 g_warning ("Invalid GConf value type!");
131 break;
132 }
133 (notify->callback) (awn_entry, notify->data);
134 g_free (awn_entry->group);
135 g_free (awn_entry->key);
136 }
137 g_free (awn_entry);
138}
139
140static AwnConfigClient *
141awn_config_client_new_with_path (const gchar *path, const gchar *name)
142{
143 AwnConfigClient *client = g_new (AwnConfigClient, 1);
144 client->path = g_strdup (path);
145 client->client = gconf_client_get_default ();
146
147 if (!gconf_client_dir_exists (client->client, client->path, NULL))
148 {
149 GError *err = NULL;
150 awn_config_client_load_defaults_from_schema (client, &err);
151 if (err)
152 {
153 g_error ("Error loading the schema: '%s'", err->message);
154 g_error_free (err);
155 }
156 }
157 gconf_client_add_dir (client->client, AWN_GCONF_PATH, GCONF_CLIENT_PRELOAD_NONE, NULL);
158 return client;
159}
160
161AwnConfigClient *
162awn_config_client_new ()
163{
164 static AwnConfigClient *awn_dock_config = NULL;
165 if (!awn_dock_config)
166 {
167 awn_dock_config = awn_config_client_new_with_path (AWN_GCONF_PATH, NULL);
168 }
169 return awn_dock_config;
170}
171
172static void
173_associate_schemas_in_dir (GConfClient *client,
174 const gchar *prefs_key,
175 const gchar *schema_dir,
176 GError **error)
177{
178 GSList *list, *l;
179
180 list = gconf_client_all_entries (client, schema_dir, error);
181
182 if (error)
183 {
184 g_return_if_fail (*error == NULL);
185 }
186
187 for (l = list; l; l = l->next)
188 {
189 GConfEntry *entry = l->data;
190 gchar *key;
191 gchar *tmp;
192
193 tmp = g_path_get_basename (gconf_entry_get_key (entry));
194
195 if (strchr (tmp, '-'))
196 g_warning ("Applet key '%s' contains a hyphen. Please "
197 "use underscores in gconf keys\n", tmp);
198
199 key = g_strdup_printf ("%s/%s", prefs_key, tmp);
200
201 g_free (tmp);
202
203 gconf_engine_associate_schema (
204 client->engine, key, gconf_entry_get_key (entry), error);
205
206 g_free (key);
207
208 gconf_entry_free (entry);
209
210 if (error && *error)
211 {
212 g_slist_free (list);
213 return;
214 }
215 }
216
217 g_slist_free (list);
218
219 list = gconf_client_all_dirs (client, schema_dir, error);
220
221 for (l = list; l; l = l->next)
222 {
223 gchar *subdir = l->data;
224 gchar *prefs_subdir;
225 gchar *schema_subdir;
226 gchar *tmp;
227
228 tmp = g_path_get_basename (subdir);
229
230 prefs_subdir = g_strdup_printf ("%s/%s", prefs_key, tmp);
231 schema_subdir = g_strdup_printf ("%s/%s", schema_dir, tmp);
232
233 _associate_schemas_in_dir (
234 client, prefs_subdir, schema_subdir, error);
235
236 g_free (prefs_subdir);
237 g_free (schema_subdir);
238 g_free (subdir);
239 g_free (tmp);
240
241 if (error && *error)
242 {
243 g_slist_free (list);
244 return;
245 }
246 }
247
248 g_slist_free (list);
249}
250
251AwnConfigClient *
252awn_config_client_new_for_applet (const gchar *name, const gchar *uid)
253{
254 AwnConfigClient *client;
255 gchar *gconf_key = NULL;
256
257 g_return_val_if_fail (name, NULL);
258
259 if (uid)
260 {
261 GConfClient *c;
262
263 gconf_key = g_strconcat (AWN_GCONF_PATH, "/applets/", uid, NULL);
264
265 /* Check if the dir exists, and if not, apply the applet schema to it */
266 c = gconf_client_get_default ();
267 if (!gconf_client_dir_exists (c, gconf_key, NULL))
268 {
269 gchar *schema_key = g_strconcat (AWN_GCONF_PATH, "/applets/", name,NULL);
270 _associate_schemas_in_dir (c, gconf_key, schema_key, NULL);
271 g_free (schema_key);
272 }
273 g_object_unref (c);
274 }
275 else
276 {
277 gconf_key = g_strconcat (AWN_GCONF_PATH, "/applets/", name, NULL);
278 }
279
280 client = awn_config_client_new_with_path (gconf_key, name);
281 g_free (gconf_key);
282
283 return client;
284}
285
286/**
287 * awn_config_client_query_backend :
288 *
289 * Returns: An enum value indicating the backend in use.
290 */
291AwnConfigBackend awn_config_client_query_backend (void)
292{
293 return AWN_CONFIG_CLIENT_GKEYFILE;
294}
295
296
297void awn_config_client_clear (AwnConfigClient *client, GError **err)
298{
299 /* only do it for applets on gconf */
300 if (strcmp (AWN_GCONF_PATH, client->path) != 0) {
301 gconf_client_remove_dir (client->client, client->path, err);
302 }
303}
304
305void awn_config_client_ensure_group (AwnConfigClient *client, const gchar *group)
306{
307 gchar *gconf_key = awn_config_client_generate_key (client, group, NULL);
308 if (!gconf_client_dir_exists (client->client, gconf_key, NULL)) {
309 gconf_client_add_dir (client->client, gconf_key, GCONF_CLIENT_PRELOAD_NONE, NULL);
310 }
311 g_free (gconf_key);
312}
313
314void awn_config_client_notify_add (AwnConfigClient *client, const gchar *group,
315 const gchar *key, AwnConfigClientNotifyFunc callback,
316 gpointer user_data)
317{
318 AwnConfigClientNotifyData *notify = g_new0 (AwnConfigClientNotifyData, 1);
319 notify->callback = callback;
320 notify->data = user_data;
321 gchar *full_key = awn_config_client_generate_key (client, group, key);
322 notify->client = client;
323 GError *err = NULL;
324 guint notify_id = gconf_client_notify_add (client->client, full_key, (GConfClientNotifyFunc)awn_config_client_notify_proxy, notify, NULL, &err);
325 if (notify_id == 0 || err) {
326 g_warning ("Something went wrong when we tried to add a notification callback: %s", err->message);
327 g_error_free (err);
328 }
329 g_free (full_key);
330}
331
332gboolean awn_config_client_entry_exists (AwnConfigClient *client, const gchar *group, const gchar *key)
333{
334 GConfValue *value = NULL;
335 gchar *gconf_key = awn_config_client_generate_key (client, group, key);
336 value = gconf_client_get (client->client, gconf_key, NULL);
337 g_free (gconf_key);
338 return value != NULL;
339}
340
341void awn_config_client_load_defaults_from_schema (AwnConfigClient *client, GError **err)
342{
343 (void)g_spawn_command_line_async ("killall -HUP gconfd-2", err);
344}
345
346AwnConfigValueType awn_config_client_get_value_type (AwnConfigClient *client, const gchar *group, const gchar *key, GError **err)
347{
348 AwnConfigValueType value_type;
349 gchar *gconf_key = awn_config_client_generate_key (client, group, key);
350 GConfValue *value = gconf_client_get (client->client, gconf_key, err);
351 if (value) {
352 switch (value->type) {
353 case GCONF_VALUE_BOOL:
354 value_type = AWN_CONFIG_VALUE_TYPE_BOOL;
355 break;
356 case GCONF_VALUE_FLOAT:
357 value_type = AWN_CONFIG_VALUE_TYPE_FLOAT;
358 break;
359 case GCONF_VALUE_INT:
360 value_type = AWN_CONFIG_VALUE_TYPE_INT;
361 break;
362 case GCONF_VALUE_STRING:
363 value_type = AWN_CONFIG_VALUE_TYPE_STRING;
364 break;
365 case GCONF_VALUE_LIST: {
366 switch (gconf_value_get_list_type (value)) {
367 case GCONF_VALUE_BOOL:
368 value_type = AWN_CONFIG_VALUE_TYPE_LIST_BOOL;
369 break;
370 case GCONF_VALUE_FLOAT:
371 value_type = AWN_CONFIG_VALUE_TYPE_LIST_FLOAT;
372 break;
373 case GCONF_VALUE_INT:
374 value_type = AWN_CONFIG_CLIENT_LIST_TYPE_INT;
375 break;
376 case GCONF_VALUE_STRING:
377 value_type = AWN_CONFIG_VALUE_TYPE_LIST_STRING;
378 break;
379 default:
380 value_type = AWN_CONFIG_VALUE_TYPE_NULL;
381 break;
382 }
383 break;
384 } default:
385 value_type = AWN_CONFIG_VALUE_TYPE_NULL;
386 break;
387 }
388 } else {
389 value_type = AWN_CONFIG_VALUE_TYPE_NULL;
390 }
391 g_free (gconf_key);
392 return value_type;
393}
394
395gboolean awn_config_client_get_bool (AwnConfigClient *client, const gchar *group, const gchar *key, GError **err)
396{
397 gchar *gconf_key = awn_config_client_generate_key (client, group, key);
398 gboolean value = gconf_client_get_bool (client->client, gconf_key, err);
399 g_free (gconf_key);
400 return value;
401}
402
403void awn_config_client_set_bool (AwnConfigClient *client, const gchar *group, const gchar *key, gboolean value, GError **err)
404{
405 gchar *full_key = awn_config_client_generate_key (client, group, key);
406 gconf_client_set_bool (client->client, full_key, value, err);
407 g_free (full_key);
408}
409
410gfloat awn_config_client_get_float (AwnConfigClient *client, const gchar *group, const gchar *key, GError **err)
411{
412 gchar *gconf_key = awn_config_client_generate_key (client, group, key);
413 gfloat value = gconf_client_get_float (client->client, gconf_key, err);
414 g_free (gconf_key);
415 return value;
The diff has been truncated for viewing.

Subscribers

People subscribed via source and target branches

to status/vote changes: