summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2020-05-10 12:47:58 +0200
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-05-26 10:15:30 +0200
commit3ec1101652a9fedbfa40a29bcfe4842b1c86051e (patch)
tree59176e1e6e48eb2fff038673b884774d875814cb
parentb13534196167d6e8db11005b3e4cb16a6c82dd85 (diff)
Merge efreet_mime efreet_trash into efreet
efreet_mime and efreet_trash are now included in libefreet.so. There are compatible libs for libefreet_mime.so libefreet_trash.so, which simple drag in libefreet.so. .pc files also are in place for compatibility. efreet_init & shutdown now initializes and shutdowns trash and mime. The old init functions now simply call efreet_init, efreet_init will then init the trash or mime libs. Reviewed-by: Stefan Schmidt <stefan@datenfreihafen.org> Differential Revision: https://phab.enlightenment.org/D11807
-rw-r--r--src/lib/efreet/Efreet.h3
-rw-r--r--src/lib/efreet/efreet.c12
-rw-r--r--src/lib/efreet/efreet_mime.c40
-rw-r--r--src/lib/efreet/efreet_private.h8
-rw-r--r--src/lib/efreet/efreet_trash.c26
-rw-r--r--src/lib/efreet/meson.build47
-rw-r--r--src/lib/eio/meson.build2
-rw-r--r--src/lib/elementary/meson.build4
-rw-r--r--src/tests/efreet/meson.build2
9 files changed, 79 insertions, 65 deletions
diff --git a/src/lib/efreet/Efreet.h b/src/lib/efreet/Efreet.h
index 51fbfebf6f..af25e033fa 100644
--- a/src/lib/efreet/Efreet.h
+++ b/src/lib/efreet/Efreet.h
@@ -167,6 +167,9 @@ EAPI void efreet_cache_disable(void);
167 */ 167 */
168EAPI void efreet_cache_enable(void); 168EAPI void efreet_cache_enable(void);
169 169
170#include <Efreet_Mime.h>
171#include <Efreet_Trash.h>
172
170#undef EAPI 173#undef EAPI
171#define EAPI 174#define EAPI
172 175
diff --git a/src/lib/efreet/efreet.c b/src/lib/efreet/efreet.c
index 091899f2b2..4c20b12bc1 100644
--- a/src/lib/efreet/efreet.c
+++ b/src/lib/efreet/efreet.c
@@ -94,6 +94,12 @@ efreet_init(void)
94 if (!efreet_util_init()) 94 if (!efreet_util_init())
95 goto shutdown_efreet_menu; 95 goto shutdown_efreet_menu;
96 96
97 if (!efreet_internal_mime_init())
98 goto shutdown_efreet_mime;
99
100 if (!efreet_internal_trash_init())
101 goto shutdown_efreet_trash;
102
97#ifdef ENABLE_NLS 103#ifdef ENABLE_NLS
98 bindtextdomain(PACKAGE, LOCALE_DIR); 104 bindtextdomain(PACKAGE, LOCALE_DIR);
99 bind_textdomain_codeset(PACKAGE, "UTF-8"); 105 bind_textdomain_codeset(PACKAGE, "UTF-8");
@@ -101,6 +107,10 @@ efreet_init(void)
101 107
102 return _efreet_init_count; 108 return _efreet_init_count;
103 109
110shutdown_efreet_trash:
111 efreet_internal_trash_shutdown();
112shutdown_efreet_mime:
113 efreet_internal_mime_shutdown();
104shutdown_efreet_menu: 114shutdown_efreet_menu:
105 efreet_menu_shutdown(); 115 efreet_menu_shutdown();
106shutdown_efreet_desktop: 116shutdown_efreet_desktop:
@@ -146,6 +156,8 @@ efreet_shutdown(void)
146 efreet_xml_shutdown(); 156 efreet_xml_shutdown();
147 efreet_cache_shutdown(); 157 efreet_cache_shutdown();
148 efreet_base_shutdown(); 158 efreet_base_shutdown();
159 efreet_internal_mime_shutdown();
160 efreet_internal_trash_shutdown();
149 161
150 IF_RELEASE(efreet_lang); 162 IF_RELEASE(efreet_lang);
151 IF_RELEASE(efreet_lang_country); 163 IF_RELEASE(efreet_lang_country);
diff --git a/src/lib/efreet/efreet_mime.c b/src/lib/efreet/efreet_mime.c
index 9eba8c8db9..d94894ff71 100644
--- a/src/lib/efreet/efreet_mime.c
+++ b/src/lib/efreet/efreet_mime.c
@@ -348,21 +348,12 @@ _efreet_mimedb_glob_mime_get(unsigned int num)
348 348
349/** --------------------------------- **/ 349/** --------------------------------- **/
350 350
351EAPI int 351int
352efreet_mime_init(void) 352efreet_internal_mime_init(void)
353{ 353{
354 if (++_efreet_mime_init_count != 1) 354 if (++_efreet_mime_init_count != 1)
355 return _efreet_mime_init_count; 355 return _efreet_mime_init_count;
356 356
357 if (!ecore_init())
358 return --_efreet_mime_init_count;
359
360 if (!ecore_file_init())
361 goto shutdown_ecore;
362
363 if (!efreet_init())
364 goto shutdown_ecore_file;
365
366 _efreet_mime_log_dom = eina_log_domain_register 357 _efreet_mime_log_dom = eina_log_domain_register
367 ("efreet_mime", EFREET_DEFAULT_LOG_COLOR); 358 ("efreet_mime", EFREET_DEFAULT_LOG_COLOR);
368 359
@@ -388,17 +379,11 @@ unregister_log_domain:
388 eina_log_domain_unregister(_efreet_mime_log_dom); 379 eina_log_domain_unregister(_efreet_mime_log_dom);
389 _efreet_mime_log_dom = -1; 380 _efreet_mime_log_dom = -1;
390shutdown_efreet: 381shutdown_efreet:
391 efreet_shutdown();
392shutdown_ecore_file:
393 ecore_file_shutdown();
394shutdown_ecore:
395 ecore_shutdown();
396
397 return --_efreet_mime_init_count; 382 return --_efreet_mime_init_count;
398} 383 }
399 384
400EAPI int 385int
401efreet_mime_shutdown(void) 386efreet_internal_mime_shutdown(void)
402{ 387{
403 if (_efreet_mime_init_count == 0) 388 if (_efreet_mime_init_count == 0)
404 { 389 {
@@ -428,13 +413,22 @@ efreet_mime_shutdown(void)
428 IF_FREE_HASH(mime_icons); 413 IF_FREE_HASH(mime_icons);
429 eina_log_domain_unregister(_efreet_mime_log_dom); 414 eina_log_domain_unregister(_efreet_mime_log_dom);
430 _efreet_mime_log_dom = -1; 415 _efreet_mime_log_dom = -1;
431 efreet_shutdown();
432 ecore_file_shutdown();
433 ecore_shutdown();
434 416
435 return _efreet_mime_init_count; 417 return _efreet_mime_init_count;
436} 418}
437 419
420EAPI int
421efreet_mime_init(void)
422{
423 return efreet_init();
424}
425
426EAPI int
427efreet_mime_shutdown(void)
428{
429 return efreet_shutdown();
430}
431
438EAPI const char * 432EAPI const char *
439efreet_mime_type_get(const char *file) 433efreet_mime_type_get(const char *file)
440{ 434{
diff --git a/src/lib/efreet/efreet_private.h b/src/lib/efreet/efreet_private.h
index eb42c28f74..77a74dfca1 100644
--- a/src/lib/efreet/efreet_private.h
+++ b/src/lib/efreet/efreet_private.h
@@ -114,7 +114,7 @@
114 114
115/** 115/**
116 * macros that are used all around the code for message processing 116 * macros that are used all around the code for message processing
117 * four macros are defined ERR, WRN, DGB, INF. 117 * four macros are defined ERR, WRN, DGB, INF.
118 * EFREET_MODULE_LOG_DOM should be defined individually for each module 118 * EFREET_MODULE_LOG_DOM should be defined individually for each module
119 */ 119 */
120#ifdef CRI 120#ifdef CRI
@@ -214,6 +214,12 @@ void efreet_desktop_shutdown(void);
214int efreet_util_init(void); 214int efreet_util_init(void);
215int efreet_util_shutdown(void); 215int efreet_util_shutdown(void);
216 216
217int efreet_internal_mime_init(void);
218int efreet_internal_mime_shutdown(void);
219
220int efreet_internal_trash_init(void);
221int efreet_internal_trash_shutdown(void);
222
217const char *efreet_home_dir_get(void); 223const char *efreet_home_dir_get(void);
218void efreet_dirs_reset(void); 224void efreet_dirs_reset(void);
219 225
diff --git a/src/lib/efreet/efreet_trash.c b/src/lib/efreet/efreet_trash.c
index 04a4a6cda4..f3837caf47 100644
--- a/src/lib/efreet/efreet_trash.c
+++ b/src/lib/efreet/efreet_trash.c
@@ -32,28 +32,25 @@ static const char *efreet_trash_dir = NULL;
32# define getuid() GetCurrentProcessId() 32# define getuid() GetCurrentProcessId()
33#endif 33#endif
34 34
35EAPI int 35
36efreet_trash_init(void) 36int
37efreet_internal_trash_init(void)
37{ 38{
38 if (++_efreet_trash_init_count != 1) 39 if (++_efreet_trash_init_count != 1)
39 return _efreet_trash_init_count; 40 return _efreet_trash_init_count;
40 41
41 if (!eina_init())
42 return --_efreet_trash_init_count;
43
44 _efreet_trash_log_dom = eina_log_domain_register 42 _efreet_trash_log_dom = eina_log_domain_register
45 ("efreet_trash", EFREET_DEFAULT_LOG_COLOR); 43 ("efreet_trash", EFREET_DEFAULT_LOG_COLOR);
46 if (_efreet_trash_log_dom < 0) 44 if (_efreet_trash_log_dom < 0)
47 { 45 {
48 EINA_LOG_ERR("Efreet: Could not create a log domain for efreet_trash"); 46 EINA_LOG_ERR("Efreet: Could not create a log domain for efreet_trash");
49 eina_shutdown();
50 return --_efreet_trash_init_count; 47 return --_efreet_trash_init_count;
51 } 48 }
52 return _efreet_trash_init_count; 49 return _efreet_trash_init_count;
53} 50}
54 51
55EAPI int 52int
56efreet_trash_shutdown(void) 53efreet_internal_trash_shutdown(void)
57{ 54{
58 if (--_efreet_trash_init_count != 0) 55 if (--_efreet_trash_init_count != 0)
59 return _efreet_trash_init_count; 56 return _efreet_trash_init_count;
@@ -61,11 +58,22 @@ efreet_trash_shutdown(void)
61 IF_RELEASE(efreet_trash_dir); 58 IF_RELEASE(efreet_trash_dir);
62 eina_log_domain_unregister(_efreet_trash_log_dom); 59 eina_log_domain_unregister(_efreet_trash_log_dom);
63 _efreet_trash_log_dom = -1; 60 _efreet_trash_log_dom = -1;
64 eina_shutdown();
65 61
66 return _efreet_trash_init_count; 62 return _efreet_trash_init_count;
67} 63}
68 64
65EAPI int
66efreet_trash_init(void)
67{
68 return efreet_init();
69}
70
71EAPI int
72efreet_trash_shutdown(void)
73{
74 return efreet_shutdown();
75}
76
69EAPI const char* 77EAPI const char*
70efreet_trash_dir_get(const char *file) 78efreet_trash_dir_get(const char *file)
71{ 79{
diff --git a/src/lib/efreet/meson.build b/src/lib/efreet/meson.build
index f438b02845..271eca0b1a 100644
--- a/src/lib/efreet/meson.build
+++ b/src/lib/efreet/meson.build
@@ -25,7 +25,9 @@ efreet_src = [
25 'efreet_cache.c', 25 'efreet_cache.c',
26 'efreet_private.h', 26 'efreet_private.h',
27 'efreet_xml.h', 27 'efreet_xml.h',
28 'efreet_cache_private.h' 28 'efreet_cache_private.h',
29 'efreet_mime.c',
30 'efreet_trash.c'
29] 31]
30 32
31efreet_deps = [eet, ecore, ecore_con, ecore_file, eo, efl, eina, emile, ecore_ipc, buildsystem,intl] 33efreet_deps = [eet, ecore, ecore_con, ecore_file, eo, efl, eina, emile, ecore_ipc, buildsystem,intl]
@@ -46,50 +48,39 @@ efreet = declare_dependency(
46 dependencies: efreet_pub_deps, 48 dependencies: efreet_pub_deps,
47) 49)
48 50
49efreet_mime_lib = library('efreet_mime', 51install_headers(efreet_header_src,
50 'efreet_mime.c', 52 install_dir : dir_package_include,
51 dependencies: efreet_pub_deps + [m, efreet, efreet_deps],
52 include_directories : config_dir + [include_directories('.')],
53 install: true,
54 c_args : package_c_args,
55 version : meson.project_version()
56) 53)
57 54
58 55
59efreet_mime = declare_dependency( 56#Deprecated efreet libs
60 include_directories: [include_directories('.')], 57# everything and everyone should use efreet itself, efreet_mime and efreet_trash are contained in libefreet.so
61 link_with: efreet_mime_lib, 58# libefreet_mime.so and libefreet_trash.so will just have NEEDED on libefreet.so so the symbols get caught in like that
62 dependencies: efreet_pub_deps
63)
64 59
65efreet_trash_lib = library('efreet_trash', 60deprecated_efreet_mime_lib = library('efreet_mime',
66 'efreet_trash.c', 61 dependencies: [efreet],
67 dependencies: efreet_pub_deps + [efreet, efreet_deps],
68 include_directories : config_dir + [include_directories('.')], 62 include_directories : config_dir + [include_directories('.')],
69 install: true, 63 install: true,
70 c_args : package_c_args,
71 version : meson.project_version() 64 version : meson.project_version()
72) 65)
73 66
74efreet_trash = declare_dependency( 67deprecated_efreet_trash_lib = library('efreet_trash',
75 include_directories: [include_directories('.')], 68 dependencies: efreet,
76 link_with: efreet_trash_lib, 69 include_directories : config_dir + [include_directories('.')],
77 dependencies: efreet_pub_deps, 70 install: true,
78) 71 version : meson.project_version()
79
80install_headers(efreet_header_src,
81 install_dir : dir_package_include,
82) 72)
83 73pkgconfig.generate(efreet_lib,
84pkgconfig.generate(efreet_mime_lib,
85 name : 'efreet-mime', 74 name : 'efreet-mime',
75 description : 'Deprecated, please just use efreet',
86 subdirs : package_version_name, 76 subdirs : package_version_name,
87 version : version_major + '.' + version_minor + '.' + version_micro, 77 version : version_major + '.' + version_minor + '.' + version_micro,
88 libraries : efreet_pub_deps, 78 libraries : efreet_pub_deps,
89) 79)
90 80
91pkgconfig.generate(efreet_trash_lib, 81pkgconfig.generate(efreet_lib,
92 name : 'efreet-trash', 82 name : 'efreet-trash',
83 description : 'Deprecated, please just use efreet',
93 subdirs : package_version_name, 84 subdirs : package_version_name,
94 version : version_major + '.' + version_minor + '.' + version_micro, 85 version : version_major + '.' + version_minor + '.' + version_micro,
95 libraries : efreet_pub_deps, 86 libraries : efreet_pub_deps,
diff --git a/src/lib/eio/meson.build b/src/lib/eio/meson.build
index f95a1e652c..64f33a2430 100644
--- a/src/lib/eio/meson.build
+++ b/src/lib/eio/meson.build
@@ -63,7 +63,7 @@ elif sys_bsd == true
63 eio_src += ['eio_monitor_kevent.c'] 63 eio_src += ['eio_monitor_kevent.c']
64endif 64endif
65 65
66eio_deps = [ecore, ecore_file, eet, eo, eina, efl, emile, efreet_mime] 66eio_deps = [ecore, ecore_file, eet, eo, eina, efl, emile, efreet]
67eio_pub_deps = [eina, eet] 67eio_pub_deps = [eina, eet]
68 68
69eio_lib = library('eio', 69eio_lib = library('eio',
diff --git a/src/lib/elementary/meson.build b/src/lib/elementary/meson.build
index f2e7ed96fb..fb4431d3f7 100644
--- a/src/lib/elementary/meson.build
+++ b/src/lib/elementary/meson.build
@@ -949,9 +949,9 @@ elementary_src = [
949 'efl_ui_spotlight_animation_manager.c', 949 'efl_ui_spotlight_animation_manager.c',
950] 950]
951 951
952elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, efreet_mime, efreet_trash, eio, atspi, dl, intl] 952elementary_deps = [emile, eo, efl, edje, ethumb, ethumb_client, emotion, ecore_imf, ecore_con, eldbus, efreet, eio, atspi, dl, intl]
953elementary_pub_deps = [eina, eet, evas, ecore, ecore_evas, ecore_file, ecore_input, ecore_imf, ecore_con, 953elementary_pub_deps = [eina, eet, evas, ecore, ecore_evas, ecore_file, ecore_input, ecore_imf, ecore_con,
954 edje, eldbus, efreet, efreet_mime, efreet_trash, ethumb_client, efl] 954 edje, eldbus, efreet, ethumb_client, efl]
955 955
956elm_options = configuration_data() 956elm_options = configuration_data()
957 957
diff --git a/src/tests/efreet/meson.build b/src/tests/efreet/meson.build
index 4ce9156ec9..24364523f5 100644
--- a/src/tests/efreet/meson.build
+++ b/src/tests/efreet/meson.build
@@ -31,7 +31,7 @@ efreet_test_src = [
31 'main.c' 31 'main.c'
32] 32]
33 33
34efreet_test_deps = [check, efreet, ecore, ecore_file, efreet_mime, intl] 34efreet_test_deps = [check, efreet, ecore, ecore_file, intl]
35 35
36efreet_test = executable('efreet_test', 36efreet_test = executable('efreet_test',
37 efreet_test_src, 37 efreet_test_src,