OSDPlugin::OSDPlugin(unsigned base) : Plugin(base) { osdPlugin = this; IconDef icon; icon.name = "alert"; icon.xpm = alert; Event eIcon(EventAddIcon, &icon); eIcon.process(); user_data_id = getContacts()->registerUserData(info.title, osdUserData); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&OSD"); cmd->icon = "alert"; cmd->param = (void*)getOSDSetup; Event e(EventAddPreferences, cmd); e.process(); m_osd = NULL; m_timer = new QTimer(this); connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout())); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
AutoAwayPlugin::AutoAwayPlugin(unsigned base, Buffer *config) : Plugin(base), EventReceiver(HighPriority) { load_data(autoAwayData, &data, config); #ifdef WIN32 HINSTANCE hLib = GetModuleHandleA("user32"); if (hLib != NULL){ (DWORD&)_GetLastInputInfo = (DWORD)GetProcAddress(hLib,"GetLastInputInfo"); }else{ hLibUI = LoadLibraryA("idleui.dll"); if (hLibUI != NULL) (DWORD&)_IdleUIGetLastInputTime = (DWORD)GetProcAddress(hLibUI, "IdleUIGetLastInputTime"); } #elif defined(HAVE_CARBON_CARBNON_H) && !defined(HAVE_X) CFBundleRef carbonBundle; if (LoadFrameworkBundle( CFSTR("Carbon.framework"), &carbonBundle ) == noErr) { InstallEventLoopIdleTimerPtr myInstallEventLoopIdleTimer = (InstallEventLoopIdleTimerPtr)CFBundleGetFunctionPointerForName(carbonBundle, CFSTR("InstallEventLoopIdleTimer")); if (myInstallEventLoopIdleTimer){ EventLoopIdleTimerUPP timerUPP = NewEventLoopIdleTimerUPP(Private::IdleTimerAction); (*myInstallEventLoopIdleTimer)(GetMainEventLoop(), kEventDurationSecond, kEventDurationSecond, timerUPP, 0, &mTimerRef); } } #endif Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); bAway = false; bNA = false; bOff = false; m_timer = new QTimer(this); connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout())); m_timer->start(AUTOAWAY_TIME); }
FloatyPlugin::FloatyPlugin(unsigned base) : Plugin(base) { CmdFloaty = registerType(); user_data_id = getContacts()->registerUserData(info.title, floatyUserData); IconDef icon; icon.name = "floating"; icon.xpm = floating; m_bBlink = false; unreadTimer = new QTimer(this); connect(unreadTimer, SIGNAL(timeout()), this, SLOT(unreadBlink())); Event eIcon(EventAddIcon, &icon); eIcon.process(); Command cmd; cmd->id = CmdFloaty; cmd->text = I18N_NOOP("Floating on"); cmd->icon = "floating"; cmd->menu_id = MenuContact; cmd->menu_grp = 0xB000; cmd->flags = COMMAND_CHECK_STATE; Event e(EventCommandCreate, cmd); e.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
ActionPlugin::ActionPlugin(unsigned base) : Plugin(base), EventReceiver(HighPriority) { plugin = this; action_data_id = getContacts()->registerUserData(info.title, actionUserData); CmdAction = registerType(); Command cmd; cmd->id = action_data_id + 1; cmd->text = I18N_NOOP("&Action"); cmd->icon = "run"; cmd->param = (void*)getActionSetup; Event e(EventAddPreferences, cmd); e.process(); cmd->id = CmdAction; cmd->text = "_"; cmd->icon = NULL; cmd->flags = COMMAND_CHECK_STATE; cmd->menu_id = MenuContact; cmd->menu_grp = 0xC000; cmd->param = NULL; Event eCmd(EventCommandCreate, cmd); eCmd.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
SoundPlugin::SoundPlugin(unsigned base, bool bFirst, const char *config) : Plugin(base) { load_data(soundData, &data, config); soundPlugin = this; if (bFirst) playSound(getStartUp()); user_data_id = getContacts()->registerUserData(info.title, soundUserData); IconDef icon; icon.name = "sound"; icon.xpm = sound; icon.isSystem = false; Event eIcon(EventAddIcon, &icon); eIcon.process(); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "sound"; cmd->icon_on = NULL; cmd->param = (void*)getSoundSetup; Event e(EventAddPreferences, cmd); e.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
SoundPlugin::SoundPlugin(unsigned base, bool bFirst, const char *config) : Plugin(base) { load_data(soundData, &data, config); soundPlugin = this; if (bFirst) playSound(getStartUp()); user_data_id = getContacts()->registerUserData(info.title, soundUserData); m_bChanged = false; IconDef icon; icon.name = "sound"; icon.xpm = sound; icon.isSystem = false; Event eIcon(EventAddIcon, &icon); eIcon.process(); icon.name = "nosound"; icon.xpm = nosound; eIcon.process(); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "sound"; cmd->icon_on = NULL; cmd->param = (void*)getSoundSetup; Event e(EventAddPreferences, cmd); e.process(); CmdSoundDisable = registerType(); EventSoundChanged = registerType(); cmd->id = CmdSoundDisable; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "nosound"; cmd->icon_on = "sound"; cmd->bar_id = ToolBarMain; cmd->bar_grp = 0; cmd->menu_id = 0; cmd->menu_grp = 0; cmd->flags = COMMAND_CHECK_STATE; Event eCmd(EventCommandCreate, cmd); eCmd.process(); cmd->icon = NULL; cmd->icon_on = NULL; cmd->bar_id = 0; cmd->menu_id = MenuMain; cmd->flags = COMMAND_CHECK_STATE; eCmd.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
RemotePlugin::RemotePlugin(unsigned base, const char *config) : Plugin(base) { load_data(remoteData, &data, config); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); bind(); }
YahooPlugin::YahooPlugin(unsigned base) : Plugin(base) { Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); YahooPacket = registerType(); getContacts()->addPacketType(YahooPacket, "Yahoo!"); registerMessages(); m_protocol = new YahooProtocol(this); }
SoundPlugin::SoundPlugin(unsigned base, bool bFirst, Buffer *config) : Plugin(base) { load_data(soundData, &data, config); soundPlugin = this; user_data_id = getContacts()->registerUserData(info.title, soundUserData); m_bChanged = false; CmdSoundDisable = registerType(); EventSoundChanged = registerType(); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "sound"; cmd->icon_on = NULL; cmd->param = (void*)getSoundSetup; Event e(EventAddPreferences, cmd); e.process(); cmd->id = CmdSoundDisable; cmd->text = I18N_NOOP("&Sound"); cmd->icon = "nosound"; cmd->icon_on = "sound"; cmd->bar_id = ToolBarMain; cmd->bar_grp = 0; cmd->menu_id = 0; cmd->menu_grp = 0; cmd->flags = COMMAND_CHECK_STATE; Event eCmd(EventCommandCreate, cmd); eCmd.process(); cmd->icon = NULL; cmd->icon_on = NULL; cmd->bar_id = 0; cmd->menu_id = MenuMain; cmd->flags = COMMAND_CHECK_STATE; eCmd.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); m_sound = NULL; #ifndef WIN32 m_player = 0; connect(ExecManager::manager, SIGNAL(childExited(int,int)), this, SLOT(childExited(int,int))); #endif m_checkTimer = new QTimer(this); connect(m_checkTimer, SIGNAL(timeout()), this, SLOT(checkSound())); if (bFirst) playSound(getStartUp()); }
RemotePlugin::RemotePlugin(unsigned base, Buffer *config) : Plugin(base) { load_data(remoteData, &data, config); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); bind(); #ifdef WIN32 remote = this; ipc = new IPC; #endif }
LiveJournalPlugin::LiveJournalPlugin(unsigned base) : Plugin(base) { m_protocol = new LiveJournalProtocol(this); Event eMenu(EventMenuCreate, (void*)MenuWeb); eMenu.process(); Command cmd; cmd->id = CmdMenuWeb; cmd->text = "_"; cmd->menu_id = MenuWeb; cmd->menu_grp = 0x1000; cmd->flags = COMMAND_CHECK_STATE; Event eCmd(EventCommandCreate, cmd); eCmd.process(); cmd->id = MessageJournal; cmd->text = I18N_NOOP("LiveJournal &post"); cmd->icon = "LiveJournal"; cmd->accel = "Ctrl+P"; cmd->menu_grp = 0x3080; cmd->flags = COMMAND_DEFAULT; cmd->param = &defJournalMessage; Event eMsg(EventCreateMessageType, cmd); eMsg.process(); cmd->id = CmdMenuWeb; cmd->text = I18N_NOOP("LiveJournal &WWW"); cmd->icon = NULL; cmd->accel = NULL; cmd->menu_grp = 0x3090; cmd->popup_id = MenuWeb; cmd->flags = COMMAND_DEFAULT; cmd->param = &defWWWJournalMessage; eMsg.process(); cmd->id = MessageUpdated; cmd->text = I18N_NOOP("Friends updated"); cmd->icon = "LiveJournal_upd"; cmd->accel = NULL; cmd->menu_grp = 0; cmd->popup_id = 0; cmd->flags = COMMAND_DEFAULT; cmd->param = &defUpdatedMessage; eMsg.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
ForwardPlugin::ForwardPlugin(unsigned base) : Plugin(base), EventReceiver(DefaultPriority - 1) { forwardPlugin = this; user_data_id = getContacts()->registerUserData(info.title, forwardUserData); Command cmd; cmd->id = user_data_id + 1; cmd->text = I18N_NOOP("&Forward"); cmd->icon = "cell"; cmd->param = (void*)getForwardSetup; Event e(EventAddPreferences, cmd); e.process(); Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); }
AutoAwayPlugin::AutoAwayPlugin(unsigned base, const char *config) : Plugin(base), EventReceiver(HighPriority) { load_data(autoAwayData, &data, config); #ifdef WIN32 HINSTANCE hLib = GetModuleHandleA("user32"); if (hLib != NULL) (DWORD&)_GetLastInputInfo = (DWORD)GetProcAddress(hLib,"GetLastInputInfo"); #endif Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); bAway = false; bNA = false; m_timer = new QTimer(this); connect(m_timer, SIGNAL(timeout()), this, SLOT(timeout())); m_timer->start(AUTOAWAY_TIME); }
ICQPlugin::ICQPlugin(unsigned base) : Plugin(base) { Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); #if defined(WIN32) && (COMPAT_QT_VERSION < 0x030000) qInitJpeg(); #endif icq_plugin = this; OscarPacket = registerType(); getContacts()->addPacketType(OscarPacket, "Oscar"); ICQDirectPacket = registerType(); getContacts()->addPacketType(ICQDirectPacket, "ICQ.Direct"); AIMDirectPacket = registerType(); getContacts()->addPacketType(AIMDirectPacket, "AIM.Direct"); m_icq = new ICQProtocol(this); m_aim = new AIMProtocol(this); Event eMenuSearch(EventMenuCreate, (void*)MenuSearchResult); eMenuSearch.process(); Event eMenuGroups(EventMenuCreate, (void*)MenuIcqGroups); eMenuGroups.process(); Event eMenuCheckInvisible(EventMenuCreate, (void*)MenuCheckInvisible); eMenuCheckInvisible.process(); Command cmd; cmd->id = CmdVisibleList; cmd->text = I18N_NOOP("Visible list"); cmd->menu_id = MenuContactGroup; cmd->menu_grp = 0x8010; cmd->flags = COMMAND_CHECK_STATE; Event eCmd(EventCommandCreate, cmd); eCmd.process(); cmd->id = CmdInvisibleList; cmd->text = I18N_NOOP("Invisible list"); cmd->menu_grp = 0x8011; eCmd.process(); cmd->id = CmdIcqSendMessage; cmd->text = I18N_NOOP("&Message"); cmd->icon = "message"; cmd->menu_id = MenuSearchResult; cmd->menu_grp = 0x1000; cmd->bar_id = 0; cmd->popup_id = 0; cmd->flags = COMMAND_DEFAULT; eCmd.process(); cmd->id = CmdInfo; cmd->text = I18N_NOOP("User &info"); cmd->icon = "info"; cmd->menu_grp = 0x1001; eCmd.process(); cmd->id = CmdGroups; cmd->text = I18N_NOOP("&Add to group"); cmd->icon = NULL; cmd->menu_grp = 0x1002; cmd->popup_id = MenuIcqGroups; eCmd.process(); cmd->id = CmdGroups; cmd->text = "_"; cmd->menu_id = MenuIcqGroups; cmd->flags = COMMAND_CHECK_STATE; eCmd.process(); cmd->id = CmdCheckInvisibleAll; cmd->text = I18N_NOOP("Check &invisible"); cmd->icon = "ICQ_invisible"; cmd->menu_id = MenuMain; cmd->menu_grp = 0x2090; cmd->popup_id = 0; cmd->flags = COMMAND_CHECK_STATE; eCmd.process(); cmd->id = CmdCheckInvisibleAll; cmd->text = I18N_NOOP("&All"); cmd->icon = NULL; cmd->menu_id = MenuCheckInvisible; cmd->menu_grp = 0x2000; cmd->popup_id = 0; cmd->flags = COMMAND_DEFAULT; eCmd.process(); cmd->id = CmdCheckInvisible; cmd->text = I18N_NOOP("&Only invisible"); cmd->icon = NULL; cmd->menu_id = MenuCheckInvisible; cmd->menu_grp = 0x2001; cmd->popup_id = 0; cmd->flags = COMMAND_DEFAULT; eCmd.process(); registerMessages(); RetrySendDND = registerType(); RetrySendOccupied = registerType(); }
DockPlugin::DockPlugin(unsigned base, Buffer *config) : Plugin(base) { load_data(dockData, &data, config); dock = NULL; inactiveTime = 0; m_popup = NULL; Event ePlugin(EventGetPluginInfo, (void*)"_core"); pluginInfo *info = (pluginInfo*)(ePlugin.process()); core = static_cast<CorePlugin*>(info->plugin); DockMenu = registerType(); CmdTitle = registerType(); CmdToggle = registerType(); CmdCustomize = registerType(); Event eMenu(EventMenuCreate, (void*)DockMenu); eMenu.process(); Command cmd; cmd->id = CmdTitle; cmd->text = I18N_NOOP("SIM"); cmd->icon = "ICQ"; cmd->menu_id = DockMenu; cmd->menu_grp = 0x1000; cmd->flags = COMMAND_TITLE; Event eCmd(EventCommandCreate, cmd); eCmd.process(); cmd->id = CmdCustomize; cmd->text = I18N_NOOP("Customize menu"); cmd->icon = "configure"; cmd->menu_id = DockMenu; cmd->menu_grp = 0x10000; cmd->accel = 0; cmd->flags = COMMAND_DEFAULT; eCmd.process(); Event eDef(EventGetMenuDef, (void*)MenuMain); CommandsDef *def = (CommandsDef*)(eDef.process()); if (def){ CommandsList list(*def, true); CommandDef *s; while ((s = ++list) != NULL){ if (s->id == 0) continue; cmd = *s; if (!(cmd->flags & COMMAND_IMPORTANT)) cmd->menu_grp = 0; cmd->bar_id = 0; cmd->menu_id = DockMenu; eCmd.process(); } } cmd->id = CmdToggle; cmd->text = I18N_NOOP("Toggle main window"); cmd->icon = NULL; cmd->menu_id = MenuMain; cmd->menu_grp = 0; cmd->accel = "Ctrl+Shift+A"; cmd->flags = COMMAND_CHECK_STATE | COMMAND_GLOBAL_ACCEL | COMMAND_IMPORTANT; eCmd.process(); init(); QTimer *timer = new QTimer(this); connect(timer, SIGNAL(timeout()), this, SLOT(timer())); timer->start(2000); }