comparison src/skins/plugin.c @ 2762:22d73f09eecc

change GeneralPlugin to Interface plugin
author Tomasz Mon <desowin@gmail.com>
date Wed, 02 Jul 2008 21:27:56 +0200
parents a8328c40a5c1
children ffb79e3d133a
comparison
equal deleted inserted replaced
2761:41a80a649b9d 2762:22d73f09eecc
29 #include <audacious/i18n.h> 29 #include <audacious/i18n.h>
30 #include <libintl.h> 30 #include <libintl.h>
31 31
32 gchar *skins_paths[SKINS_PATH_COUNT] = {}; 32 gchar *skins_paths[SKINS_PATH_COUNT] = {};
33 33
34 GeneralPlugin skins_gp = 34 static Interface skins_gp =
35 { 35 {
36 .description= "Audacious Skinned GUI", 36 .id = "skinned",
37 .desc = "Audacious Skinned GUI",
37 .init = skins_init, 38 .init = skins_init,
38 .about = skins_about, 39 .fini = skins_cleanup
39 .configure = skins_configure,
40 .cleanup = skins_cleanup
41 }; 40 };
42 41
43 GeneralPlugin *skins_gplist[] = { &skins_gp, NULL }; 42 SIMPLE_INTERFACE_PLUGIN("skinned", &skins_gp);
44 SIMPLE_GENERAL_PLUGIN(skins, skins_gplist);
45 gboolean plugin_is_active = FALSE; 43 gboolean plugin_is_active = FALSE;
46 44
47 static void skins_free_paths(void) { 45 static void skins_free_paths(void) {
48 int i; 46 int i;
49 47
71 69
72 g_free(xdg_data_home); 70 g_free(xdg_data_home);
73 g_free(xdg_cache_home); 71 g_free(xdg_cache_home);
74 } 72 }
75 73
76 void skins_init(void) { 74 gboolean skins_init(void) {
77 plugin_is_active = TRUE; 75 plugin_is_active = TRUE;
78 g_log_set_handler(NULL, G_LOG_LEVEL_WARNING, g_log_default_handler, NULL); 76 g_log_set_handler(NULL, G_LOG_LEVEL_WARNING, g_log_default_handler, NULL);
79 77
80 skins_init_paths(); 78 skins_init_paths();
81 skins_cfg_load(); 79 skins_cfg_load();
89 87
90 if (config.player_visible) mainwin_real_show(); 88 if (config.player_visible) mainwin_real_show();
91 if (config.equalizer_visible) equalizerwin_show(TRUE); 89 if (config.equalizer_visible) equalizerwin_show(TRUE);
92 if (config.playlist_visible) playlistwin_show(); 90 if (config.playlist_visible) playlistwin_show();
93 91
94 return; 92 g_message("Entering Gtk+ main loop!");
93 gtk_main();
94
95 return TRUE;
95 } 96 }
96 97
97 void skins_cleanup(void) { 98 gboolean skins_cleanup(void) {
98 if (plugin_is_active == TRUE) { 99 if (plugin_is_active == TRUE) {
99 skins_cfg_save(); 100 skins_cfg_save();
100 skins_free_paths(); 101 skins_free_paths();
101 ui_main_evlistener_dissociate(); 102 ui_main_evlistener_dissociate();
102 ui_playlist_evlistener_dissociate(); 103 ui_playlist_evlistener_dissociate();
112 playlistwin = NULL; 113 playlistwin = NULL;
113 mainwin_info = NULL; 114 mainwin_info = NULL;
114 plugin_is_active = FALSE; 115 plugin_is_active = FALSE;
115 } 116 }
116 117
117 return; 118 gtk_main_quit();
119
120 return TRUE;
118 } 121 }
119 122
120 void skins_about(void) { 123 void skins_about(void) {
121 static GtkWidget* about_window = NULL; 124 static GtkWidget* about_window = NULL;
122 125