2007-12-09 18:43:23 -08:00
|
|
|
#include <e.h>
|
|
|
|
#include "e_mod_main.h"
|
|
|
|
#if TIME_WITH_SYS_TIME
|
|
|
|
# include <sys/time.h>
|
|
|
|
# include <time.h>
|
|
|
|
#else
|
|
|
|
# if HAVE_SYS_TIME_H
|
|
|
|
# include <sys/time.h>
|
|
|
|
# else
|
|
|
|
# include <time.h>
|
|
|
|
# endif
|
|
|
|
#endif
|
|
|
|
#include <libmpd/libmpdclient.h>
|
|
|
|
|
|
|
|
#define MAX_SONG_LENGTH 255
|
|
|
|
|
|
|
|
/* Func Proto Requirements for Gadcon */
|
|
|
|
static E_Gadcon_Client *_gc_init (E_Gadcon * gc, const char *name,
|
|
|
|
const char *id, const char *style);
|
|
|
|
static void _gc_shutdown (E_Gadcon_Client * gcc);
|
2008-11-03 21:54:59 -08:00
|
|
|
static void _gc_orient (E_Gadcon_Client * gcc, E_Gadcon_Orient orient);
|
2011-11-14 14:17:19 -08:00
|
|
|
static const char *_gc_label (E_Gadcon_Client_Class *client_class);
|
2008-11-03 21:54:59 -08:00
|
|
|
static Evas_Object *_gc_icon (E_Gadcon_Client_Class *client_class, Evas * evas);
|
|
|
|
static const char *_gc_id_new (E_Gadcon_Client_Class *client_class);
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
/* Module Protos */
|
|
|
|
static void _mpdule_cb_mouse_down (void *data, Evas * e, Evas_Object * obj,
|
|
|
|
void *event_info);
|
2008-01-07 18:19:22 -08:00
|
|
|
static void _mpdule_cb_mouse_in (void *data, Evas * e, Evas_Object * obj,
|
|
|
|
void *event_info);
|
|
|
|
static void _mpdule_cb_mouse_out (void *data, Evas * e, Evas_Object * obj,
|
|
|
|
void *event_info);
|
2007-12-09 18:43:23 -08:00
|
|
|
static void _mpdule_menu_cb_configure (void *data, E_Menu * m,
|
|
|
|
E_Menu_Item * mi);
|
|
|
|
static void _mpdule_menu_cb_post (void *data, E_Menu * m);
|
2008-01-07 18:19:22 -08:00
|
|
|
static void _mpdule_cb_play (void *data, Evas_Object * obj,
|
|
|
|
const char *emission, const char *source);
|
|
|
|
static void _mpdule_cb_stop (void *data, Evas_Object * obj,
|
|
|
|
const char *emission, const char *source);
|
|
|
|
static void _mpdule_cb_pause (void *data, Evas_Object * obj,
|
|
|
|
const char *emission, const char *source);
|
|
|
|
static void _mpdule_cb_next (void *data, Evas_Object * obj,
|
|
|
|
const char *emission, const char *source);
|
|
|
|
static void _mpdule_cb_previous (void *data, Evas_Object * obj,
|
|
|
|
const char *emission, const char *source);
|
2007-12-09 18:43:23 -08:00
|
|
|
static Config_Item *_mpdule_config_item_get (const char *id);
|
|
|
|
|
|
|
|
static E_Config_DD *conf_edd = NULL;
|
|
|
|
static E_Config_DD *conf_item_edd = NULL;
|
|
|
|
|
|
|
|
Config *mpdule_config = NULL;
|
|
|
|
|
|
|
|
/* Define the class and gadcon functions this module provides */
|
|
|
|
static const E_Gadcon_Client_Class _gc_class = {
|
|
|
|
GADCON_CLIENT_CLASS_VERSION,
|
2008-01-07 18:19:22 -08:00
|
|
|
"mpdule", {_gc_init, _gc_shutdown, _gc_orient, _gc_label, _gc_icon,
|
List of changes:
1. Gadcon sities:
-- 'E_Gadcon_Site' enum to list all available sities,
-- added 'is_site' callback for distinguish gadcon sities,
-- 'e_gadcon_site_is_*' helpers written to use in gadget modules,
-- gadcon config dialogs modified to show only gadgets that appropriate
to selected gadcon site,
-- all gadget modules updated for using new callback.
When callback is not provided in module, then gadget can be used in
any gadcon site.
2. Filemanager:
-- added error icon to unexisting path dialog,
-- added callback 'func.abort' to 'E_Fm2_Op_Registry_Entry' to specify
abort operation sequence (if not provided, then operation is not
cancelable),
-- added parameter to 'e_fm2_op_registry_entry_add' to specify abort
method on construct 'E_Fm2_Op_Registry_Entry' or make non-cancelable
operation if this function is not provided,
-- added 'e_fm2_operation_abort' call to cancel efm2 operation,
-- added method '_e_fm2_operation_abort_internal' that represent efm2
default handler of operation cancelling,
-- 'done' and 'total' fields of 'E_Fm2_Op_Registry_Entry' changed to
off_t type, also all message handlers modified to work with it
(to show progress for large files correctly),
-- improved file operation progress processing,
-- added cancel button to operation progress gadget in filemanager window,
-- added delete file glyph to operation progress gadget,
-- improved status message for efm2 operation progress.
3. Filemanager slave:
-- fixed critical bug in message handling via stdin/stdout,
-- fixed critical bug in removing task from list,
-- improved 'E_FM_OP_ABORT' handling,
-- fix rollback counting on moving files.
4. Fileman_opinfo module:
-- a new theme writed: status string and gadget for view operation status
in summary and detail modes,
-- summary mode: operation glyph, state message, progressbar, abort button,
-- detail mode: all for summary + from filename, to filename,
-- summary/detailed button works as trigger,
-- added source of module theme and used images.
4. Pathbar module:
-- non-critical fix, just for safety.
Also patch contains several minor updates to serve main task.
SVN revision: 41224
2009-06-29 07:38:03 -07:00
|
|
|
_gc_id_new, NULL, e_gadcon_site_is_not_toolbar},
|
2007-12-09 18:43:23 -08:00
|
|
|
E_GADCON_CLIENT_STYLE_PLAIN
|
|
|
|
};
|
|
|
|
|
|
|
|
typedef struct _Instance Instance;
|
|
|
|
struct _Instance
|
|
|
|
{
|
|
|
|
E_Gadcon_Client *gcc;
|
|
|
|
Evas_Object *mpdule;
|
2007-12-11 19:14:10 -08:00
|
|
|
Evas_Object *o_popup;
|
2007-12-09 18:43:23 -08:00
|
|
|
mpd_Connection *mpd;
|
|
|
|
Ecore_Timer *update_timer;
|
|
|
|
Config_Item *ci;
|
2007-12-11 19:14:10 -08:00
|
|
|
E_Gadcon_Popup *popup;
|
2007-12-09 18:43:23 -08:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
static void _mpdule_connect (Instance * inst);
|
|
|
|
static void _mpdule_disconnect (Instance * inst);
|
|
|
|
static void _mpdule_update_song (Instance * inst);
|
2010-07-07 17:57:17 -07:00
|
|
|
static Eina_Bool _mpdule_update_song_cb (void *data);
|
2008-01-07 18:19:22 -08:00
|
|
|
static void _mpdule_popup_destroy (Instance * inst);
|
2009-09-01 11:23:05 -07:00
|
|
|
static void _mpdule_popup_create (Instance * inst, const char *dir);
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
static E_Gadcon_Client *
|
|
|
|
_gc_init (E_Gadcon * gc, const char *name, const char *id, const char *style)
|
|
|
|
{
|
2009-09-01 11:23:05 -07:00
|
|
|
Evas_Object *o;
|
2007-12-09 18:43:23 -08:00
|
|
|
E_Gadcon_Client *gcc;
|
2007-12-11 19:14:10 -08:00
|
|
|
Evas *evas;
|
2007-12-09 18:43:23 -08:00
|
|
|
Instance *inst;
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
inst = E_NEW (Instance, 1);
|
2008-01-07 18:19:22 -08:00
|
|
|
|
2007-12-09 18:43:23 -08:00
|
|
|
inst->ci = _mpdule_config_item_get (id);
|
|
|
|
if (!inst->ci->id)
|
2008-11-01 20:14:20 -07:00
|
|
|
inst->ci->id = eina_stringshare_add (id);
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
o = edje_object_add (gc->evas);
|
|
|
|
snprintf (buf, sizeof (buf), "%s/mpdule.edj",
|
|
|
|
e_module_dir_get (mpdule_config->module));
|
|
|
|
if (!e_theme_edje_object_set
|
|
|
|
(o, "base/theme/modules/mpdule", "modules/mpdule/main"))
|
|
|
|
edje_object_file_set (o, buf, "modules/mpdule/main");
|
|
|
|
evas_object_show (o);
|
|
|
|
|
|
|
|
gcc = e_gadcon_client_new (gc, name, id, style, o);
|
|
|
|
gcc->data = inst;
|
|
|
|
inst->gcc = gcc;
|
|
|
|
inst->mpdule = o;
|
|
|
|
|
2009-09-01 11:23:05 -07:00
|
|
|
_mpdule_popup_create(inst, buf);
|
2007-12-11 19:14:10 -08:00
|
|
|
|
2007-12-09 18:43:23 -08:00
|
|
|
evas_object_event_callback_add (o, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_mpdule_cb_mouse_down, inst);
|
2008-01-07 18:19:22 -08:00
|
|
|
evas_object_event_callback_add (inst->mpdule, EVAS_CALLBACK_MOUSE_IN,
|
|
|
|
_mpdule_cb_mouse_in, inst);
|
|
|
|
evas_object_event_callback_add (inst->mpdule, EVAS_CALLBACK_MOUSE_OUT,
|
|
|
|
_mpdule_cb_mouse_out, inst);
|
|
|
|
edje_object_signal_callback_add (o, "mpdule,play", "", _mpdule_cb_play,
|
|
|
|
inst);
|
|
|
|
edje_object_signal_callback_add (o, "mpdule,stop", "", _mpdule_cb_stop,
|
|
|
|
inst);
|
|
|
|
edje_object_signal_callback_add (o, "mpdule,pause", "", _mpdule_cb_pause,
|
|
|
|
inst);
|
|
|
|
edje_object_signal_callback_add (o, "mpdule,next", "", _mpdule_cb_next,
|
|
|
|
inst);
|
|
|
|
edje_object_signal_callback_add (o, "mpdule,previous", "",
|
|
|
|
_mpdule_cb_previous, inst);
|
|
|
|
_mpdule_connect (inst);
|
|
|
|
_mpdule_update_song (inst);
|
2008-01-09 22:26:22 -08:00
|
|
|
inst->update_timer = ecore_timer_add (inst->ci->poll_time,
|
2008-01-07 18:19:22 -08:00
|
|
|
_mpdule_update_song_cb, inst);
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
mpdule_config->instances =
|
2008-10-22 06:53:03 -07:00
|
|
|
eina_list_append (mpdule_config->instances, inst);
|
2007-12-09 18:43:23 -08:00
|
|
|
return gcc;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_gc_shutdown (E_Gadcon_Client * gcc)
|
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
|
|
|
|
inst = gcc->data;
|
|
|
|
if (inst->update_timer)
|
2008-01-07 18:19:22 -08:00
|
|
|
ecore_timer_del (inst->update_timer);
|
|
|
|
_mpdule_disconnect (inst);
|
2007-12-09 18:43:23 -08:00
|
|
|
mpdule_config->instances =
|
2008-10-22 06:53:03 -07:00
|
|
|
eina_list_remove (mpdule_config->instances, inst);
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
evas_object_event_callback_del (inst->mpdule, EVAS_CALLBACK_MOUSE_DOWN,
|
|
|
|
_mpdule_cb_mouse_down);
|
2008-01-07 18:19:22 -08:00
|
|
|
evas_object_event_callback_del (inst->mpdule, EVAS_CALLBACK_MOUSE_IN,
|
|
|
|
_mpdule_cb_mouse_in);
|
|
|
|
evas_object_event_callback_del (inst->mpdule, EVAS_CALLBACK_MOUSE_OUT,
|
|
|
|
_mpdule_cb_mouse_out);
|
|
|
|
_mpdule_popup_destroy (inst);
|
2007-12-09 18:43:23 -08:00
|
|
|
evas_object_del (inst->mpdule);
|
|
|
|
free (inst);
|
|
|
|
inst = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_orient (E_Gadcon_Client * gcc, E_Gadcon_Orient orient)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
Evas_Coord mw, mh;
|
|
|
|
|
|
|
|
inst = gcc->data;
|
|
|
|
edje_object_size_min_calc (inst->mpdule, &mw, &mh);
|
|
|
|
e_gadcon_client_min_size_set (gcc, mw, mh);
|
|
|
|
}
|
|
|
|
|
2011-11-14 14:17:19 -08:00
|
|
|
static const char *
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_label (E_Gadcon_Client_Class *client_class)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
|
|
|
return D_ ("MPDule");
|
|
|
|
}
|
|
|
|
|
|
|
|
static Evas_Object *
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_icon (E_Gadcon_Client_Class *client_class, Evas * evas)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
|
|
|
Evas_Object *o;
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
o = edje_object_add (evas);
|
|
|
|
snprintf (buf, sizeof (buf), "%s/e-module-mpdule.edj",
|
|
|
|
e_module_dir_get (mpdule_config->module));
|
|
|
|
edje_object_file_set (o, buf, "icon");
|
|
|
|
return o;
|
|
|
|
}
|
|
|
|
|
|
|
|
static const char *
|
2008-11-03 21:54:59 -08:00
|
|
|
_gc_id_new (E_Gadcon_Client_Class *client_class)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
Config_Item *ci;
|
2007-12-09 18:43:23 -08:00
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
ci = _mpdule_config_item_get (NULL);
|
|
|
|
return ci->id;
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_mpdule_cb_mouse_down (void *data, Evas * e, Evas_Object * obj,
|
|
|
|
void *event_info)
|
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
Evas_Event_Mouse_Down *ev;
|
|
|
|
|
|
|
|
inst = data;
|
|
|
|
ev = event_info;
|
|
|
|
if ((ev->button == 3) && (!mpdule_config->menu))
|
|
|
|
{
|
2011-03-17 10:24:53 -07:00
|
|
|
E_Menu *m;
|
2007-12-09 18:43:23 -08:00
|
|
|
E_Menu_Item *mi;
|
|
|
|
int x, y, w, h;
|
|
|
|
|
2011-03-17 10:24:53 -07:00
|
|
|
m = e_menu_new ();
|
|
|
|
mi = e_menu_item_new (m);
|
2010-09-09 07:50:02 -07:00
|
|
|
e_menu_item_label_set (mi, D_ ("Settings"));
|
2009-03-28 06:30:14 -07:00
|
|
|
e_util_menu_item_theme_icon_set(mi, "preferences-system");
|
2007-12-09 18:43:23 -08:00
|
|
|
e_menu_item_callback_set (mi, _mpdule_menu_cb_configure, inst);
|
|
|
|
|
2011-03-17 10:24:53 -07:00
|
|
|
m = e_gadcon_client_util_menu_items_append (inst->gcc, m, 0);
|
|
|
|
e_menu_post_deactivate_callback_set (m, _mpdule_menu_cb_post, inst);
|
|
|
|
mpdule_config->menu = m;
|
|
|
|
|
2007-12-09 18:43:23 -08:00
|
|
|
e_gadcon_canvas_zone_geometry_get (inst->gcc->gadcon, &x, &y, &w, &h);
|
2011-03-17 10:24:53 -07:00
|
|
|
e_menu_activate_mouse (m,
|
2007-12-09 18:43:23 -08:00
|
|
|
e_util_zone_current_get (e_manager_current_get
|
|
|
|
()), x + ev->output.x,
|
|
|
|
y + ev->output.y, 1, 1,
|
|
|
|
E_MENU_POP_DIRECTION_DOWN, ev->timestamp);
|
|
|
|
evas_event_feed_mouse_up (inst->gcc->gadcon->evas, ev->button,
|
|
|
|
EVAS_BUTTON_NONE, ev->timestamp, NULL);
|
2008-01-07 18:19:22 -08:00
|
|
|
}
|
|
|
|
else if (ev->button == 1)
|
|
|
|
{
|
|
|
|
//e_gadcon_popup_toggle_pinned(inst->popup);
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2007-12-11 19:14:10 -08:00
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
static void
|
|
|
|
_mpdule_cb_mouse_in (void *data, Evas * e, Evas_Object * obj,
|
|
|
|
void *event_info)
|
2007-12-11 19:14:10 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
Instance *inst;
|
|
|
|
E_Gadcon_Popup *popup;
|
|
|
|
|
2009-09-01 11:23:05 -07:00
|
|
|
if ((!(inst = data)) || (!inst->ci->show_popup))
|
2008-01-07 18:19:22 -08:00
|
|
|
return;
|
|
|
|
popup = inst->popup;
|
|
|
|
e_gadcon_popup_show (inst->popup);
|
2007-12-11 19:14:10 -08:00
|
|
|
}
|
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
static void
|
|
|
|
_mpdule_cb_mouse_out (void *data, Evas * e, Evas_Object * obj,
|
|
|
|
void *event_info)
|
2007-12-11 19:14:10 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
Instance *inst;
|
|
|
|
E_Gadcon_Popup *popup;
|
2007-12-11 19:14:10 -08:00
|
|
|
|
2009-09-01 11:23:05 -07:00
|
|
|
if ((!(inst = data)) || ((!inst->ci->show_popup) && (inst->popup)))
|
2008-01-07 18:19:22 -08:00
|
|
|
return;
|
|
|
|
popup = inst->popup;
|
|
|
|
e_gadcon_popup_hide (inst->popup);
|
2007-12-11 19:14:10 -08:00
|
|
|
}
|
|
|
|
|
2007-12-09 18:43:23 -08:00
|
|
|
static void
|
|
|
|
_mpdule_menu_cb_post (void *data, E_Menu * m)
|
|
|
|
{
|
|
|
|
if (!mpdule_config->menu)
|
|
|
|
return;
|
|
|
|
e_object_del (E_OBJECT (mpdule_config->menu));
|
|
|
|
mpdule_config->menu = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
|
|
|
_mpdule_menu_cb_configure (void *data, E_Menu * m, E_Menu_Item * mi)
|
|
|
|
{
|
|
|
|
Instance *inst;
|
2007-12-24 13:40:33 -08:00
|
|
|
|
2007-12-09 18:43:23 -08:00
|
|
|
inst = data;
|
|
|
|
_config_mpdule_module (inst->ci);
|
|
|
|
}
|
|
|
|
|
|
|
|
void
|
2008-01-07 18:19:22 -08:00
|
|
|
_mpdule_config_updated (Config_Item * ci)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-10-22 06:53:03 -07:00
|
|
|
Eina_List *l;
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
if (!mpdule_config)
|
|
|
|
return;
|
|
|
|
for (l = mpdule_config->instances; l; l = l->next)
|
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
|
|
|
|
inst = l->data;
|
2008-01-09 22:26:22 -08:00
|
|
|
if (inst->ci != ci)
|
2007-12-09 18:43:23 -08:00
|
|
|
continue;
|
2008-01-07 18:19:22 -08:00
|
|
|
_mpdule_disconnect (inst);
|
|
|
|
_mpdule_connect (inst);
|
|
|
|
_mpdule_update_song (inst);
|
2007-12-09 18:43:23 -08:00
|
|
|
if (inst->update_timer)
|
2008-01-09 22:26:22 -08:00
|
|
|
ecore_timer_interval_set (inst->update_timer, ci->poll_time);
|
2007-12-09 18:43:23 -08:00
|
|
|
else
|
2008-01-07 18:19:22 -08:00
|
|
|
inst->update_timer =
|
2008-01-09 22:26:22 -08:00
|
|
|
ecore_timer_add (ci->poll_time, _mpdule_update_song_cb,
|
2008-01-07 18:19:22 -08:00
|
|
|
inst);
|
2009-09-01 11:23:05 -07:00
|
|
|
if (inst->ci->show_popup)
|
|
|
|
{
|
|
|
|
if (!inst->popup)
|
|
|
|
{
|
|
|
|
_mpdule_popup_create(inst, NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
if (inst->popup)
|
|
|
|
{
|
|
|
|
_mpdule_popup_destroy(inst);
|
|
|
|
}
|
|
|
|
if (inst->o_popup)
|
|
|
|
{
|
|
|
|
evas_object_del(inst->o_popup);
|
|
|
|
}
|
|
|
|
}
|
2007-12-09 18:43:23 -08:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
static void
|
|
|
|
_mpdule_cb_play (void *data, Evas_Object * obj, const char *emission,
|
|
|
|
const char *source)
|
2007-12-24 13:40:33 -08:00
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
mpd_Connection *mpd;
|
|
|
|
|
|
|
|
inst = data;
|
|
|
|
mpd = inst->mpd;
|
2008-01-07 18:19:22 -08:00
|
|
|
mpd_sendPlayCommand (mpd, -1);
|
2007-12-24 13:40:33 -08:00
|
|
|
}
|
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
static void
|
|
|
|
_mpdule_cb_previous (void *data, Evas_Object * obj, const char *emission,
|
|
|
|
const char *source)
|
2007-12-24 13:40:33 -08:00
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
mpd_Connection *mpd;
|
|
|
|
|
|
|
|
inst = data;
|
|
|
|
mpd = inst->mpd;
|
2008-01-07 18:19:22 -08:00
|
|
|
mpd_sendPrevCommand (mpd);
|
2007-12-24 13:40:33 -08:00
|
|
|
}
|
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
static void
|
|
|
|
_mpdule_cb_next (void *data, Evas_Object * obj, const char *emission,
|
|
|
|
const char *source)
|
2007-12-24 13:40:33 -08:00
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
mpd_Connection *mpd;
|
|
|
|
|
|
|
|
inst = data;
|
|
|
|
mpd = inst->mpd;
|
2008-01-07 18:19:22 -08:00
|
|
|
mpd_sendNextCommand (mpd);
|
2007-12-24 13:40:33 -08:00
|
|
|
}
|
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
static void
|
|
|
|
_mpdule_cb_stop (void *data, Evas_Object * obj, const char *emission,
|
|
|
|
const char *source)
|
2007-12-24 13:40:33 -08:00
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
mpd_Connection *mpd;
|
|
|
|
|
|
|
|
inst = data;
|
|
|
|
mpd = inst->mpd;
|
2008-01-07 18:19:22 -08:00
|
|
|
mpd_sendStopCommand (mpd);
|
2007-12-24 13:40:33 -08:00
|
|
|
}
|
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
static void
|
|
|
|
_mpdule_cb_pause (void *data, Evas_Object * obj, const char *emission,
|
|
|
|
const char *source)
|
2007-12-24 13:40:33 -08:00
|
|
|
{
|
|
|
|
Instance *inst;
|
|
|
|
mpd_Connection *mpd;
|
|
|
|
|
|
|
|
inst = data;
|
|
|
|
mpd = inst->mpd;
|
2008-01-07 18:19:22 -08:00
|
|
|
mpd_sendPauseCommand (mpd, 1);
|
2007-12-24 13:40:33 -08:00
|
|
|
}
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
static Config_Item *
|
|
|
|
_mpdule_config_item_get (const char *id)
|
|
|
|
{
|
2008-10-22 06:53:03 -07:00
|
|
|
Eina_List *l;
|
2007-12-09 18:43:23 -08:00
|
|
|
Config_Item *ci;
|
2008-01-07 18:19:22 -08:00
|
|
|
char buf[128];
|
|
|
|
|
|
|
|
|
|
|
|
if (!id)
|
|
|
|
{
|
|
|
|
int num = 0;
|
|
|
|
|
|
|
|
/* Create id */
|
|
|
|
if (mpdule_config->items)
|
|
|
|
{
|
|
|
|
const char *p;
|
2008-10-22 06:53:03 -07:00
|
|
|
ci = eina_list_last (mpdule_config->items)->data;
|
2008-01-07 18:19:22 -08:00
|
|
|
p = strrchr (ci->id, '.');
|
|
|
|
if (p)
|
|
|
|
num = atoi (p + 1) + 1;
|
|
|
|
}
|
|
|
|
snprintf (buf, sizeof (buf), "%s.%d", _gc_class.name, num);
|
|
|
|
id = buf;
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
for (l = mpdule_config->items; l; l = l->next)
|
|
|
|
{
|
|
|
|
ci = l->data;
|
|
|
|
if (!ci->id)
|
|
|
|
continue;
|
|
|
|
if (!strcmp (ci->id, id))
|
|
|
|
return ci;
|
|
|
|
}
|
|
|
|
}
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
ci = E_NEW (Config_Item, 1);
|
2008-11-01 20:14:20 -07:00
|
|
|
ci->id = eina_stringshare_add (id);
|
2007-12-09 18:43:23 -08:00
|
|
|
ci->poll_time = 1.0;
|
2008-11-01 20:14:20 -07:00
|
|
|
ci->hostname = eina_stringshare_add ("localhost");
|
2007-12-09 18:43:23 -08:00
|
|
|
ci->port = 6600;
|
2009-09-01 11:23:05 -07:00
|
|
|
ci->show_popup = 1;
|
2007-12-09 18:43:23 -08:00
|
|
|
|
2008-10-22 06:53:03 -07:00
|
|
|
mpdule_config->items = eina_list_append (mpdule_config->items, ci);
|
2007-12-09 18:43:23 -08:00
|
|
|
return ci;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI E_Module_Api e_modapi = {
|
|
|
|
E_MODULE_API_VERSION,
|
|
|
|
"MPDule"
|
|
|
|
};
|
|
|
|
|
|
|
|
static void
|
2008-01-07 18:19:22 -08:00
|
|
|
_mpdule_connect (Instance * inst)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
mpd_Connection *mpd;
|
|
|
|
Config_Item *ci;
|
2007-12-09 18:43:23 -08:00
|
|
|
|
2008-01-07 18:19:22 -08:00
|
|
|
ci = inst->ci;
|
|
|
|
mpd = mpd_newConnection (ci->hostname, ci->port, 3.0);
|
|
|
|
inst->mpd = mpd;
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2011-02-24 10:45:24 -08:00
|
|
|
_mpdule_disconnect(Instance *inst)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
if (inst->mpd)
|
|
|
|
{
|
2011-02-24 10:45:24 -08:00
|
|
|
mpd_closeConnection(inst->mpd);
|
2008-01-07 18:19:22 -08:00
|
|
|
inst->mpd = NULL;
|
|
|
|
}
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
|
|
|
|
2010-07-07 17:57:17 -07:00
|
|
|
static Eina_Bool
|
2008-01-07 18:19:22 -08:00
|
|
|
_mpdule_update_song_cb (void *data)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
Instance *inst;
|
|
|
|
|
|
|
|
inst = data;
|
|
|
|
_mpdule_update_song (inst);
|
2010-07-07 17:57:17 -07:00
|
|
|
return EINA_TRUE;
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
static void
|
2008-01-07 18:19:22 -08:00
|
|
|
_mpdule_update_song (Instance * inst)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
mpd_Connection *mpd;
|
|
|
|
Evas_Object *mpdule;
|
|
|
|
Evas_Object *o_popup;
|
|
|
|
|
|
|
|
if (!inst->mpd)
|
|
|
|
return;
|
|
|
|
mpd = inst->mpd;
|
|
|
|
mpdule = inst->mpdule;
|
|
|
|
o_popup = inst->o_popup;
|
|
|
|
mpd_sendStatusCommand (mpd);
|
|
|
|
if (mpd->error == 0)
|
|
|
|
{
|
|
|
|
mpd_Status *status = mpd_getStatus (mpd);
|
|
|
|
|
|
|
|
if (status)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
if (status->state == MPD_STATUS_STATE_UNKNOWN)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
|
|
|
D_ ("Unknown"));
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
|
|
|
D_ ("Unknown"));
|
|
|
|
}
|
|
|
|
else if (status->state == MPD_STATUS_STATE_STOP)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
|
|
|
D_ ("Stopped"));
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
|
|
|
D_ ("Stopped"));
|
|
|
|
}
|
|
|
|
else if (status->state == MPD_STATUS_STATE_PLAY)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
|
|
|
D_ ("Playing"));
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
|
|
|
D_ ("Playing"));
|
|
|
|
}
|
|
|
|
else if (status->state == MPD_STATUS_STATE_PAUSE)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.status",
|
|
|
|
D_ ("Paused"));
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.status",
|
|
|
|
D_ ("Paused"));
|
|
|
|
}
|
|
|
|
|
|
|
|
if (status->state > MPD_STATUS_STATE_STOP)
|
|
|
|
{
|
|
|
|
mpd_sendCurrentSongCommand (mpd);
|
|
|
|
mpd_InfoEntity *entity = NULL;
|
|
|
|
|
|
|
|
while ((entity = mpd_getNextInfoEntity (mpd)))
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
if (entity->type == MPD_INFO_ENTITY_TYPE_SONG &&
|
|
|
|
entity->info.song->id == status->songid)
|
|
|
|
{
|
|
|
|
mpd_Song *song = entity->info.song;
|
|
|
|
|
|
|
|
if (song->artist)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
edje_object_part_text_set (mpdule, "mpdule.artist",
|
|
|
|
song->artist);
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.artist",
|
|
|
|
song->artist);
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
2008-01-07 18:19:22 -08:00
|
|
|
else
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
edje_object_part_text_set (mpdule, "mpdule.artist",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.artist",
|
|
|
|
"");
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
2008-01-07 18:19:22 -08:00
|
|
|
if (song->title)
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
edje_object_part_text_set (mpdule, "mpdule.title",
|
|
|
|
song->title);
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.title",
|
|
|
|
song->title);
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
2008-01-07 18:19:22 -08:00
|
|
|
else
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
edje_object_part_text_set (mpdule, "mpdule.title",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.title",
|
|
|
|
"");
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
2008-01-07 18:19:22 -08:00
|
|
|
if (song->album)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.album",
|
|
|
|
song->album);
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.album",
|
|
|
|
song->album);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.album",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.album",
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
if (song->track)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.track",
|
|
|
|
song->track);
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.track",
|
|
|
|
song->track);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.track",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.track",
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
if (song->date)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.date",
|
|
|
|
song->date);
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.date",
|
|
|
|
song->date);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.date",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.date",
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
if (song->genre)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.genre",
|
|
|
|
song->genre);
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.genre",
|
|
|
|
song->genre);
|
|
|
|
}
|
|
|
|
else
|
2007-12-09 18:43:23 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
edje_object_part_text_set (mpdule, "mpdule.genre",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.genre",
|
|
|
|
"");
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
2008-01-07 18:19:22 -08:00
|
|
|
if (song->composer)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule,
|
|
|
|
"mpdule.composer",
|
|
|
|
song->composer);
|
|
|
|
edje_object_part_text_set (o_popup,
|
|
|
|
"mpdule.composer",
|
|
|
|
song->composer);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule,
|
|
|
|
"mpdule.composer", "");
|
|
|
|
edje_object_part_text_set (o_popup,
|
|
|
|
"mpdule.composer", "");
|
|
|
|
}
|
|
|
|
if (song->time)
|
|
|
|
{
|
|
|
|
//char * songtime;
|
|
|
|
//sprintf(songtime, "%i", song->time);
|
|
|
|
//edje_object_part_text_set (mpdule, "mpdule.time", songtime);
|
|
|
|
//edje_object_part_text_set (o_popup, "mpdule.time", songtime);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.time",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.time",
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
if (song->file)
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.file",
|
|
|
|
song->file);
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.file",
|
|
|
|
song->file);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
edje_object_part_text_set (mpdule, "mpdule.file",
|
|
|
|
"");
|
|
|
|
edje_object_part_text_set (o_popup, "mpdule.file",
|
|
|
|
"");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
mpd_freeInfoEntity (entity);
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
2008-01-07 18:19:22 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
mpd_freeStatus (status);
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
2008-01-07 18:19:22 -08:00
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
_mpdule_disconnect (inst);
|
|
|
|
_mpdule_connect (inst);
|
|
|
|
}
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
|
|
|
|
|
|
|
EAPI void *
|
|
|
|
e_modapi_init (E_Module * m)
|
|
|
|
{
|
2007-12-09 21:39:02 -08:00
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
snprintf (buf, sizeof (buf), "%s/locale", e_module_dir_get (m));
|
|
|
|
bindtextdomain (PACKAGE, buf);
|
2007-12-09 18:43:23 -08:00
|
|
|
bind_textdomain_codeset (PACKAGE, "UTF-8");
|
|
|
|
|
|
|
|
conf_item_edd = E_CONFIG_DD_NEW ("MPDule_Config_Item", Config_Item);
|
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
#define T Config_Item
|
|
|
|
#define D conf_item_edd
|
|
|
|
E_CONFIG_VAL (D, T, id, STR);
|
|
|
|
E_CONFIG_VAL (D, T, poll_time, DOUBLE);
|
|
|
|
E_CONFIG_VAL (D, T, hostname, STR);
|
|
|
|
E_CONFIG_VAL (D, T, port, INT);
|
2009-09-01 11:23:05 -07:00
|
|
|
E_CONFIG_VAL (D, T, show_popup, UCHAR);
|
2007-12-09 18:43:23 -08:00
|
|
|
|
|
|
|
conf_edd = E_CONFIG_DD_NEW ("MPDule_Config", Config);
|
|
|
|
#undef T
|
|
|
|
#undef D
|
|
|
|
#define T Config
|
|
|
|
#define D conf_edd
|
|
|
|
E_CONFIG_LIST (D, T, items, conf_item_edd);
|
|
|
|
|
|
|
|
mpdule_config = e_config_domain_load ("module.mpdule", conf_edd);
|
|
|
|
if (!mpdule_config)
|
|
|
|
{
|
|
|
|
Config_Item *ci;
|
|
|
|
|
|
|
|
mpdule_config = E_NEW (Config, 1);
|
|
|
|
|
|
|
|
ci = E_NEW (Config_Item, 1);
|
2008-11-01 20:14:20 -07:00
|
|
|
ci->id = eina_stringshare_add ("0");
|
2007-12-09 18:43:23 -08:00
|
|
|
ci->poll_time = 1.0;
|
2008-11-01 20:14:20 -07:00
|
|
|
ci->hostname = eina_stringshare_add ("localhost");
|
2007-12-09 18:43:23 -08:00
|
|
|
ci->port = 6600;
|
2009-09-01 11:23:05 -07:00
|
|
|
ci->show_popup = 1;
|
2007-12-09 18:43:23 -08:00
|
|
|
|
2008-10-22 06:53:03 -07:00
|
|
|
mpdule_config->items = eina_list_append (mpdule_config->items, ci);
|
2007-12-09 18:43:23 -08:00
|
|
|
}
|
|
|
|
mpdule_config->module = m;
|
|
|
|
|
|
|
|
e_gadcon_provider_register (&_gc_class);
|
|
|
|
return m;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_shutdown (E_Module * m)
|
|
|
|
{
|
|
|
|
mpdule_config->module = NULL;
|
|
|
|
e_gadcon_provider_unregister (&_gc_class);
|
|
|
|
|
|
|
|
if (mpdule_config->config_dialog)
|
|
|
|
e_object_del (E_OBJECT (mpdule_config->config_dialog));
|
|
|
|
if (mpdule_config->menu)
|
|
|
|
{
|
|
|
|
e_menu_post_deactivate_callback_set (mpdule_config->menu, NULL, NULL);
|
|
|
|
e_object_del (E_OBJECT (mpdule_config->menu));
|
|
|
|
mpdule_config->menu = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
while (mpdule_config->items)
|
|
|
|
{
|
|
|
|
Config_Item *ci;
|
|
|
|
|
|
|
|
ci = mpdule_config->items->data;
|
|
|
|
mpdule_config->items =
|
2008-10-22 06:53:03 -07:00
|
|
|
eina_list_remove_list (mpdule_config->items, mpdule_config->items);
|
2007-12-09 18:43:23 -08:00
|
|
|
if (ci->id)
|
2008-11-01 20:14:20 -07:00
|
|
|
eina_stringshare_del (ci->id);
|
2007-12-09 18:43:23 -08:00
|
|
|
free (ci);
|
|
|
|
ci = NULL;
|
|
|
|
}
|
|
|
|
|
|
|
|
free (mpdule_config);
|
|
|
|
mpdule_config = NULL;
|
|
|
|
E_CONFIG_DD_FREE (conf_item_edd);
|
|
|
|
E_CONFIG_DD_FREE (conf_edd);
|
|
|
|
return 1;
|
|
|
|
}
|
|
|
|
|
|
|
|
EAPI int
|
|
|
|
e_modapi_save (E_Module * m)
|
|
|
|
{
|
|
|
|
e_config_domain_save ("module.mpdule", conf_edd, mpdule_config);
|
|
|
|
return 1;
|
|
|
|
}
|
2007-12-11 19:14:10 -08:00
|
|
|
|
|
|
|
static void
|
2008-01-07 18:19:22 -08:00
|
|
|
_mpdule_popup_destroy (Instance * inst)
|
2007-12-11 19:14:10 -08:00
|
|
|
{
|
2008-01-07 18:19:22 -08:00
|
|
|
if (!inst->popup)
|
|
|
|
return;
|
|
|
|
e_object_del (E_OBJECT (inst->popup));
|
2007-12-11 19:14:10 -08:00
|
|
|
}
|
2009-09-01 11:23:05 -07:00
|
|
|
|
|
|
|
static void
|
|
|
|
_mpdule_popup_create (Instance * inst, const char *dir)
|
|
|
|
{
|
|
|
|
Evas *evas;
|
|
|
|
Evas_Object *o_popup;
|
|
|
|
char buf[4096];
|
|
|
|
|
|
|
|
if (inst->ci->show_popup)
|
|
|
|
{
|
|
|
|
inst->popup = e_gadcon_popup_new (inst->gcc);
|
|
|
|
evas = inst->popup->win->evas;
|
|
|
|
o_popup = edje_object_add (evas);
|
|
|
|
if (!e_theme_edje_object_set
|
|
|
|
(o_popup, "base/theme/modules/mpdule", "modules/mpdule/popup"))
|
|
|
|
{
|
|
|
|
if (dir)
|
|
|
|
{
|
|
|
|
edje_object_file_set (o_popup, dir, "modules/mpdule/popup");
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
snprintf(buf, sizeof(buf), "%s/mpdule.edj",
|
|
|
|
e_module_dir_get(mpdule_config->module));
|
|
|
|
edje_object_file_set(o_popup, buf, "modules/mpdule/popup");
|
|
|
|
}
|
|
|
|
}
|
|
|
|
evas_object_show (o_popup);
|
|
|
|
e_gadcon_popup_content_set (inst->popup, o_popup);
|
|
|
|
edje_object_size_min_calc (o_popup, NULL, NULL);
|
|
|
|
inst->o_popup = o_popup;
|
|
|
|
edje_object_signal_callback_add (o_popup, "mpdule,play", "",
|
|
|
|
_mpdule_cb_play, inst);
|
|
|
|
edje_object_signal_callback_add (o_popup, "mpdule,stop", "",
|
|
|
|
_mpdule_cb_stop, inst);
|
|
|
|
edje_object_signal_callback_add (o_popup, "mpdule,pause", "",
|
|
|
|
_mpdule_cb_pause, inst);
|
|
|
|
edje_object_signal_callback_add (o_popup, "mpdule,next", "",
|
|
|
|
_mpdule_cb_next, inst);
|
|
|
|
edje_object_signal_callback_add (o_popup, "mpdule,previous", "",
|
|
|
|
_mpdule_cb_previous, inst);
|
|
|
|
}
|
|
|
|
else
|
|
|
|
{
|
|
|
|
inst->popup = NULL;
|
|
|
|
inst->o_popup = NULL;
|
|
|
|
}
|
|
|
|
}
|