1// 2// This file is part of the aMule Project. 3// 4// Copyright (c) 2004-2011 aMule Team ( admin@amule.org / http://www.amule.org ) 5// Copyright (c) 2004-2011 Angel Vidal ( kry@amule.org ) 6// Copyright (c) 2004-2011 Froenchenko Leonid (lfroen@users.sourceforge.net) 7// 8// Any parts of this program derived from the xMule, lMule or eMule project, 9// or contributed by third-party developers are copyrighted by their 10// respective authors. 11// 12// This program is free software; you can redistribute it and/or modify 13// it under the terms of the GNU General Public License as published by 14// the Free Software Foundation; either version 2 of the License, or 15// (at your option) any later version. 16// 17// This program is distributed in the hope that it will be useful, 18// but WITHOUT ANY WARRANTY; without even the implied warranty of 19// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 20// GNU General Public License for more details. 21// 22// You should have received a copy of the GNU General Public License 23// along with this program; if not, write to the Free Software 24// Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301, USA 25// 26 27#ifndef GUIEVENTS_H 28#define GUIEVENTS_H 29 30#include <wx/event.h> 31 32#include "Types.h" 33#include "Constants.h" 34#define __need_convertinfo // We need only the ConvertInfo struct from PartFileConvert.h 35#include "PartFileConvert.h" 36 37class CKnownFile; 38class CSearchFile; 39class CPartFile; 40class CServer; 41class CFriend; 42class CClientRef; 43 44 45DECLARE_LOCAL_EVENT_TYPE(MULE_EVT_NOTIFY, -1) 46 47 48/** 49 * This namespaces contains a number of functions and classes 50 * related to defered function calls, allowing a notification 51 * call to be delayed till it can be initiated from the main 52 * thread. 53 */ 54namespace MuleNotify 55{ 56 /** 57 * Creates a deep copy of the object passed. 58 * 59 * Note that this function should be overwritten as 60 * needed. See the wxString version below. 61 */ 62 template <class ValueType> 63 inline ValueType DeepCopy(const ValueType& value) 64 { 65 return ValueType(value); 66 } 67 68 /** Special DeepCopy for wxString, which uses reference counting. */ 69 inline wxString DeepCopy(const wxString& value) 70 { 71 return wxString(value.c_str(), value.Length()); 72 } 73 74 75 //////////////////////////////////////////////////////////// 76 // Notification handlers 77 // 78 // These functions should not be called directly, but 79 // through the Notify_*, etc. macros. 80 // 81 82 void SharedFilesShowFile(CKnownFile* file); 83 void SharedFilesRemoveFile(CKnownFile* file); 84 void SharedFilesRemoveAllFiles(); 85 void SharedFilesShowFileList(); 86 void SharedFilesUpdateItem(CKnownFile* file); 87 88 void DownloadCtrlUpdateItem(const void* item); 89 void SourceCtrlUpdateSource(uint32 source, SourceItemType type); 90 void DownloadCtrlAddFile(CPartFile* file); 91 void SourceCtrlAddSource(CPartFile* owner, CClientRef source, SourceItemType type); 92 void DownloadCtrlRemoveFile(CPartFile* file); 93 void SourceCtrlRemoveSource(uint32 source, const CPartFile* owner); 94 void DownloadCtrlHideSource(CPartFile* file); 95 void DownloadCtrlSort(); 96 void DownloadCtrlDoItemSelectionChanged(); 97 98 void SharedCtrlAddClient(CKnownFile* owner, CClientRef client, SourceItemType type); 99 void SharedCtrlRefreshClient(uint32 client, SourceItemType type); 100 void SharedCtrlRemoveClient(uint32 client, const CKnownFile* owner); 101 102 void ServerAdd(CServer* server); 103 void ServerRemove(CServer* server); 104 void ServerRemoveDead(); 105 void ServerRemoveAll(); 106 void ServerHighlight(CServer* server, bool highlight); 107 void ServerRefresh(CServer* server); 108 void ServerFreeze(); 109 void ServerThaw(); 110 void ServerUpdateED2KInfo(); 111 void ServerUpdateKadKInfo(); 112 113 void SearchCancel(); 114 void SearchLocalEnd(); 115 void KadSearchEnd(uint32 id); 116 void Search_Update_Sources(CSearchFile* result); 117 void Search_Add_Result(CSearchFile* result); 118 119 void ChatUpdateFriend(CFriend* Friend); 120 void ChatRemoveFriend(CFriend* Friend); 121 void ChatConnResult(bool success, uint64 id, wxString message); 122 void ChatProcessMsg(uint64 sender, wxString message); 123 void ChatSendCaptcha(wxString captcha, uint64 to_id); 124 125 void ShowConnState(long state); 126 void ShowUserCount(wxString str); 127 void ShowUpdateCatTabTitles(); 128 void ShowGUI(); 129 130 void CategoryAdded(); 131 void CategoryUpdate(uint32 cat); 132 void CategoryDelete(uint32 cat); 133 134 void NodesURLChanged(wxString url); 135 void ServersURLChanged(wxString url); 136 137 // Partfile conversion: Core -> GUI 138 void ConvertUpdateProgress(float percent, wxString label, wxString header); 139 void ConvertUpdateJobInfo(ConvertInfo info); 140 void ConvertRemoveJobInfo(unsigned id); 141 void ConvertClearInfos(); 142 // Partfile conversion: GUI -> Core 143 void ConvertRemoveJob(unsigned id); 144 void ConvertRetryJob(unsigned id); 145 void ConvertReaddAllJobs(); 146 147 // 148 // GUI -> core notification 149 // 150 151 void PartFile_Swap_A4AF(CPartFile* file); 152 void PartFile_Swap_A4AF_Auto(CPartFile* file); 153 void PartFile_Swap_A4AF_Others(CPartFile* file); 154 void PartFile_Pause(CPartFile* file); 155 void PartFile_Resume(CPartFile* file); 156 void PartFile_Stop(CPartFile* file); 157 void PartFile_PrioAuto(CPartFile* file, bool val); 158 void PartFile_PrioSet(CPartFile* file, uint8 newDownPriority, bool bSave); 159 void PartFile_Delete(CPartFile* file); 160 void PartFile_SetCat(CPartFile* file, uint32 val); 161 162 void KnownFile_Up_Prio_Set(CKnownFile* file, uint8 val); 163 void KnownFile_Up_Prio_Auto(CKnownFile* file); 164 void KnownFile_Comment_Set(CKnownFile* file, wxString comment, int8 rating); 165 166 void Search_Add_Download(CSearchFile* result, uint8 category); 167 void Search_Update_Progress(uint32 value); 168 169 void Download_Set_Cat_Prio(uint8 cat, uint8 newprio); 170 void Download_Set_Cat_Status(uint8 cat, int newstatus); 171 172 void Upload_Resort_Queue(); 173 174 void Client_Delete(CClientRef client); 175 176 // 177 // Notifications that always create an event 178 // 179 void IPFilter_Reload(); 180 void IPFilter_Update(wxString url); 181 182 //////////////////////////////////////////////////////////// 183 // Notification utilities 184 185 /** 186 * The base class of the functions. 187 * 188 * This class allows the the notification call to be executed 189 * without knowing the exact specifics of a given functor. 190 */ 191 class CMuleNotiferBase 192 { 193 public: 194 /** The constructor does nothing. */ 195 CMuleNotiferBase() {}; 196 /** The destructor is virtual since we will be deleting pointers to this type. */ 197 virtual ~CMuleNotiferBase() {}; 198 199 /** Executes the actual notification call. */ 200 virtual void Notify() const = 0; 201 /** Returns a copy of the functor (function + arguments). */ 202 virtual CMuleNotiferBase* Clone() const = 0; 203 }; 204 205 206 /** Notification functor for functions taking no arguments. */ 207 class CMuleNotifier0 : public CMuleNotiferBase 208 { 209 public: 210 typedef void (*FuncType)(); 211 212 /** Creates a functor from the given function. */ 213 CMuleNotifier0(FuncType func) 214 : m_func(func) {} 215 216 /** @see CMuleNotifierBase::Notify */ 217 virtual void Notify() const { 218 m_func(); 219 } 220 221 /** @see CMuleNotifierBase::Clone */ 222 virtual CMuleNotiferBase* Clone() const { 223 return new CMuleNotifier0(m_func); 224 } 225 226 private: 227 FuncType m_func; 228 }; 229 230 231 /** Notification functor for functions taking 1 arguments. */ 232 template <typename ARG> 233 class CMuleNotifier1 : public CMuleNotiferBase 234 { 235 public: 236 typedef void (*FuncType)(ARG); 237 238 /** Creates a functor from the given function and arguments. */ 239 CMuleNotifier1(FuncType func, ARG arg) 240 : m_func(func), 241 m_arg(DeepCopy(arg)) 242 {} 243 244 /** @see CMuleNotifierBase::Notify */ 245 virtual void Notify() const { 246 m_func(m_arg); 247 } 248 249 /** @see CMuleNotifierBase::Clone */ 250 virtual CMuleNotiferBase* Clone() const { 251 return new CMuleNotifier1<ARG>(m_func, m_arg); 252 } 253 254 private: 255 FuncType m_func; 256 ARG m_arg; 257 }; 258 259 260 /** Notification functor for functions taking 2 arguments. */ 261 template <typename ARG_1, typename ARG_2> 262 class CMuleNotifier2 : public CMuleNotiferBase 263 { 264 public: 265 typedef void (*FuncType)(ARG_1, ARG_2); 266 267 /** Creates a functor from the given function and arguments. */ 268 CMuleNotifier2(FuncType func, ARG_1 arg1, ARG_2 arg2) 269 : m_func(func), 270 m_arg1(DeepCopy(arg1)), 271 m_arg2(DeepCopy(arg2)) 272 {} 273 274 /** @see CMuleNotifierBase:: Notify */ 275 virtual void Notify() const { 276 m_func(m_arg1, m_arg2); 277 } 278 279 /** @see CMuleNotifierBase::Clone */ 280 virtual CMuleNotiferBase* Clone() const { 281 return new CMuleNotifier2<ARG_1, ARG_2>(m_func, m_arg1, m_arg2); 282 } 283 284 private: 285 FuncType m_func; 286 ARG_1 m_arg1; 287 ARG_2 m_arg2; 288 }; 289 290 291 /** Notification functor for functions taking 3 arguments. */ 292 template <typename ARG_1, typename ARG_2, typename ARG_3> 293 class CMuleNotifier3 : public CMuleNotiferBase 294 { 295 public: 296 typedef void (*FuncType)(ARG_1, ARG_2, ARG_3); 297 298 /** Creates a functor from the given function and arguments. */ 299 CMuleNotifier3(FuncType func, ARG_1 arg1, ARG_2 arg2, ARG_3 arg3) 300 : m_func(func), 301 m_arg1(DeepCopy(arg1)), 302 m_arg2(DeepCopy(arg2)), 303 m_arg3(DeepCopy(arg3)) 304 {} 305 306 /** @see CMuleNotifierBase:: Notify */ 307 virtual void Notify() const { 308 m_func(m_arg1, m_arg2, m_arg3); 309 } 310 311 /** @see CMuleNotifierBase::Clone */ 312 virtual CMuleNotiferBase* Clone() const { 313 return new CMuleNotifier3<ARG_1, ARG_2, ARG_3>(m_func, m_arg1, m_arg2, m_arg3); 314 } 315 316 private: 317 FuncType m_func; 318 ARG_1 m_arg1; 319 ARG_2 m_arg2; 320 ARG_3 m_arg3; 321 }; 322 323 324 /** 325 * This event is sent when a worker-thread makes use of a notify-macro. 326 * 327 * This insures that all notifications are executed on the main thread, 328 * thereby improving overall threadsafety. The events are currently 329 * sent to wxTheApp. 330 */ 331 class CMuleGUIEvent : public wxEvent 332 { 333 public: 334 /** Takes ownership a notifier functor. */ 335 CMuleGUIEvent(CMuleNotiferBase* ntf) 336 : wxEvent(-1, MULE_EVT_NOTIFY) 337 , m_functor(ntf) 338 { 339 wxASSERT(m_functor); 340 } 341 342 /** Destructor, frees the functor object. */ 343 virtual ~CMuleGUIEvent() { 344 delete m_functor; 345 } 346 347 /** Executes the notification. */ 348 void Notify() const { 349 m_functor->Notify(); 350 } 351 352 /** @see wxEvent::Clone */ 353 virtual wxEvent* Clone() const { 354 return new CMuleGUIEvent(m_functor->Clone()); 355 } 356 357 private: 358 /** Not copyable. */ 359 CMuleGUIEvent(const CMuleGUIEvent&); 360 /** Not assignable. */ 361 CMuleGUIEvent& operator=(const CMuleGUIEvent&); 362 363 //! The actual functor object, 364 CMuleNotiferBase* m_functor; 365 }; 366 367 368 /** 369 * This function will execute or queue a given notification functor. 370 * 371 * If the caller is the main thread, the functor is executed immediatly, 372 * thus acting like a regular function call. OTOH, if the caller is a 373 * worker thread, the functor is cloned and sent via an event to 374 * wxTheApp. 375 */ 376 void HandleNotification(const CMuleNotiferBase& ntf); 377 378 /** 379 * These functions take a function pointer and a set of arguments, 380 * matching those of the function-pointer. A functor is created 381 * from these and either executed immediatly, or sent as an event 382 * in the case of non-main threads calling the functions. 383 * 384 * Note that the return-value of the function must be void. 385 * 386 * IMPORTANT: Note that the functions passed to DoNotify must not 387 * take arguments via references, since this causes the functors 388 * to store references to the arguments, rather than a copy and 389 * thus ends up with dangling references. 390 */ 391 //@{ 392 inline void DoNotify(void (*func)()) { 393 HandleNotification(CMuleNotifier0(func)); 394 } 395 template <typename A1A, typename A1B> 396 inline void DoNotify(void (*func)(A1A), A1B arg1) { 397 HandleNotification(CMuleNotifier1<A1A>(func, arg1)); 398 } 399 template <typename A1A, typename A1B, typename A2A, typename A2B> 400 inline void DoNotify(void (*func)(A1A, A2A), A1B arg1, A2B arg2) { 401 HandleNotification(CMuleNotifier2<A1A, A2A>(func, arg1, arg2)); 402 } 403 template <typename A1A, typename A1B, typename A2A, typename A2B, typename A3A, typename A3B> 404 inline void DoNotify(void (*func)(A1A, A2A, A3A), A1B arg1, A2B arg2, A3B arg3) { 405 HandleNotification(CMuleNotifier3<A1A, A2A, A3A>(func, arg1, arg2, arg3)); 406 } 407 //@} 408 409 /** 410 * The same as above, but these functions will always send an event, 411 * even from the main thread. 412 */ 413 void HandleNotificationAlways(const CMuleNotiferBase& ntf); 414 415 inline void DoNotifyAlways(void (*func)()) { 416 HandleNotificationAlways(CMuleNotifier0(func)); 417 } 418 template <typename A1A, typename A1B> 419 inline void DoNotifyAlways(void (*func)(A1A), A1B arg1) { 420 HandleNotificationAlways(CMuleNotifier1<A1A>(func, arg1)); 421 } 422 template <typename A1A, typename A1B, typename A2A, typename A2B> 423 inline void DoNotifyAlways(void (*func)(A1A, A2A), A1B arg1, A2B arg2) { 424 HandleNotificationAlways(CMuleNotifier2<A1A, A2A>(func, arg1, arg2)); 425 } 426 template <typename A1A, typename A1B, typename A2A, typename A2B, typename A3A, typename A3B> 427 inline void DoNotifyAlways(void (*func)(A1A, A2A, A3A), A1B arg1, A2B arg2, A3B arg3) { 428 HandleNotificationAlways(CMuleNotifier3<A1A, A2A, A3A>(func, arg1, arg2, arg3)); 429 } 430} 431 432 433//! Placing CMuleGUIEvent in the global namespace. 434using MuleNotify::CMuleGUIEvent; 435 436//! The event-handler type that takes a CMuleGUIEvent. 437typedef void (wxEvtHandler::*MuleNotifyEventFunction)(CMuleGUIEvent&); 438 439//! Event-handler for completed hashings of new shared files and partfiles. 440#define EVT_MULE_NOTIFY(func) \ 441 DECLARE_EVENT_TABLE_ENTRY(MULE_EVT_NOTIFY, -1, -1, \ 442 (wxObjectEventFunction) (wxEventFunction) \ 443 wxStaticCastEvent(MuleNotifyEventFunction, &func), (wxObject*) NULL), 444 445 446 447 448// SharedFilesCtrl 449#define Notify_SharedFilesShowFile(file) MuleNotify::DoNotify(&MuleNotify::SharedFilesShowFile, file) 450#define Notify_SharedFilesRemoveFile(file) MuleNotify::DoNotify(&MuleNotify::SharedFilesRemoveFile, file) 451#define Notify_SharedFilesRemoveAllItems() MuleNotify::DoNotify(&MuleNotify::SharedFilesRemoveAllFiles) 452#define Notify_SharedFilesShowFileList() MuleNotify::DoNotify(&MuleNotify::SharedFilesShowFileList) 453#define Notify_SharedFilesSort() MuleNotify::DoNotify(&MuleNotify::SharedFilesSort) 454#define Notify_SharedFilesUpdateItem(file) MuleNotify::DoNotify(&MuleNotify::SharedFilesUpdateItem, file) 455 456// download ctrl 457#define Notify_DownloadCtrlUpdateItem(ptr) MuleNotify::DoNotify(&MuleNotify::DownloadCtrlUpdateItem, ptr) 458#define Notify_DownloadCtrlAddFile(file) MuleNotify::DoNotify(&MuleNotify::DownloadCtrlAddFile, file) 459#define Notify_DownloadCtrlRemoveFile(file) MuleNotify::DoNotify(&MuleNotify::DownloadCtrlRemoveFile, file) 460#define Notify_DownloadCtrlSort() MuleNotify::DoNotify(&MuleNotify::DownloadCtrlSort) 461#define Notify_DownloadCtrlDoItemSelectionChanged() MuleNotify::DoNotifyAlways(&MuleNotify::DownloadCtrlDoItemSelectionChanged) 462 463// source ctrl 464#define Notify_SourceCtrlUpdateSource(ptr, val) MuleNotify::DoNotify(&MuleNotify::SourceCtrlUpdateSource, ptr, val) 465#define Notify_SourceCtrlAddSource(p0, p1, val) MuleNotify::DoNotify(&MuleNotify::SourceCtrlAddSource, p0, p1, val) 466#define Notify_SourceCtrlRemoveSource(ptr0, ptr1) MuleNotify::DoNotify(&MuleNotify::SourceCtrlRemoveSource, ptr0, ptr1) 467 468// upload ctrl 469#define Notify_SharedCtrlAddClient(p0, p1, val) MuleNotify::DoNotify(&MuleNotify::SharedCtrlAddClient, p0, p1, val) 470#define Notify_SharedCtrlRefreshClient(ptr, val) MuleNotify::DoNotify(&MuleNotify::SharedCtrlRefreshClient, ptr, val) 471#define Notify_SharedCtrlRemoveClient(p0, p1) MuleNotify::DoNotify(&MuleNotify::SharedCtrlRemoveClient, p0, p1) 472 473// server 474#define Notify_ServerAdd(ptr) MuleNotify::DoNotify(&MuleNotify::ServerAdd, ptr) 475#define Notify_ServerRemove(ptr) MuleNotify::DoNotify(&MuleNotify::ServerRemove, ptr) 476#define Notify_ServerRemoveDead() MuleNotify::DoNotify(&MuleNotify::ServerRemoveDead) 477#define Notify_ServerRemoveAll() MuleNotify::DoNotify(&MuleNotify::ServerRemoveAll) 478#define Notify_ServerHighlight(ptr, val) MuleNotify::DoNotify(&MuleNotify::ServerHighlight, ptr, val) 479#define Notify_ServerRefresh(ptr) MuleNotify::DoNotify(&MuleNotify::ServerRefresh, ptr) 480#define Notify_ServerFreeze() MuleNotify::DoNotify(&MuleNotify::ServerFreeze) 481#define Notify_ServerThaw() MuleNotify::DoNotify(&MuleNotify::ServerThaw) 482#define Notify_ServerUpdateED2KInfo() MuleNotify::DoNotify(&MuleNotify::ServerUpdateED2KInfo) 483#define Notify_ServerUpdateKadKInfo() MuleNotify::DoNotify(&MuleNotify::ServerUpdateKadKInfo) 484 485// search 486#define Notify_SearchCancel() MuleNotify::DoNotify(&MuleNotify::SearchCancel) 487#define Notify_SearchLocalEnd() MuleNotify::DoNotify(&MuleNotify::SearchLocalEnd) 488#define Notify_KadSearchEnd(val) MuleNotify::DoNotify(&MuleNotify::KadSearchEnd, val) 489#define Notify_Search_Update_Sources(ptr) MuleNotify::DoNotify(&MuleNotify::Search_Update_Sources, ptr) 490#define Notify_Search_Add_Result(s) MuleNotify::DoNotify(&MuleNotify::Search_Add_Result, s) 491 492// chat 493#define Notify_ChatUpdateFriend(ptr) MuleNotify::DoNotify(&MuleNotify::ChatUpdateFriend, ptr) 494#define Notify_ChatRemoveFriend(ptr) MuleNotify::DoNotify(&MuleNotify::ChatRemoveFriend, ptr) 495#define Notify_ChatConnResult(val0, val1, s) MuleNotify::DoNotify(&MuleNotify::ChatConnResult, val0, val1, s) 496#define Notify_ChatProcessMsg(val0, s) MuleNotify::DoNotify(&MuleNotify::ChatProcessMsg, val0, s) 497#define Notify_ChatSendCaptcha(val0, s) MuleNotify::DoNotify(&MuleNotify::ChatSendCaptcha, val0, s) 498 499// misc 500#define Notify_ShowConnState(val) MuleNotify::DoNotify(&MuleNotify::ShowConnState, val) 501#define Notify_ShowUserCount(str) MuleNotify::DoNotify(&MuleNotify::ShowUserCount, str) 502#define Notify_ShowUpdateCatTabTitles() MuleNotify::DoNotify(&MuleNotify::ShowUpdateCatTabTitles) 503#define Notify_ShowGUI() MuleNotify::DoNotify(&MuleNotify::ShowGUI) 504 505// categories 506#define Notify_CategoryAdded() MuleNotify::DoNotify(&MuleNotify::CategoryAdded) 507#define Notify_CategoryUpdate(cat) MuleNotify::DoNotify(&MuleNotify::CategoryUpdate, cat) 508#define Notify_CategoryDelete(cat) MuleNotify::DoNotify(&MuleNotify::CategoryDelete, cat) 509 510// server.met/nodes.dat default urls 511#define Notify_NodesURLChanged(url) MuleNotify::DoNotify(&MuleNotify::NodesURLChanged, url) 512#define Notify_ServersURLChanged(url) MuleNotify::DoNotify(&MuleNotify::ServersURLChanged, url) 513 514// Partfile conversion: Core -> GUI 515#define Notify_ConvertUpdateProgress(val, text) Notify_ConvertUpdateProgressFull(val, text, wxEmptyString) 516#define Notify_ConvertUpdateProgressFull(val, text, hdr) MuleNotify::DoNotify(&MuleNotify::ConvertUpdateProgress, val, text, hdr) 517#define Notify_ConvertUpdateJobInfo(info) MuleNotify::DoNotify(&MuleNotify::ConvertUpdateJobInfo, info) 518#define Notify_ConvertRemoveJobInfo(id) MuleNotify::DoNotify(&MuleNotify::ConvertRemoveJobInfo, id) 519#define Notify_ConvertClearInfos() MuleNotify::DoNotify(&MuleNotify::ConvertClearInfos) 520// Partfile conversion: GUI -> Core 521#define Notify_ConvertRemoveJob(id) MuleNotify::DoNotify(&MuleNotify::ConvertRemoveJob, id) 522#define Notify_ConvertRetryJob(id) MuleNotify::DoNotify(&MuleNotify::ConvertRetryJob, id) 523#define Notify_ConvertReaddAllJobs() MuleNotify::DoNotify(&MuleNotify::ConvertReaddAllJobs) 524 525// 526// GUI -> core notification 527// 528 529// PartFile 530#define CoreNotify_PartFile_Swap_A4AF(ptr) MuleNotify::DoNotify(&MuleNotify::PartFile_Swap_A4AF, ptr) 531#define CoreNotify_PartFile_Swap_A4AF_Auto(ptr) MuleNotify::DoNotify(&MuleNotify::PartFile_Swap_A4AF_Auto, ptr) 532#define CoreNotify_PartFile_Swap_A4AF_Others(ptr) MuleNotify::DoNotify(&MuleNotify::PartFile_Swap_A4AF_Others, ptr) 533#define CoreNotify_PartFile_Pause(ptr) MuleNotify::DoNotify(&MuleNotify::PartFile_Pause, ptr) 534#define CoreNotify_PartFile_Resume(ptr) MuleNotify::DoNotify(&MuleNotify::PartFile_Resume, ptr) 535#define CoreNotify_PartFile_Stop(ptr) MuleNotify::DoNotify(&MuleNotify::PartFile_Stop, ptr) 536#define CoreNotify_PartFile_PrioAuto(ptr, val) MuleNotify::DoNotify(&MuleNotify::PartFile_PrioAuto, ptr, val) 537#define CoreNotify_PartFile_PrioSet(p, v0, v1) MuleNotify::DoNotify(&MuleNotify::PartFile_PrioSet, p, v0, v1) 538#define CoreNotify_PartFile_Delete(ptr) MuleNotify::DoNotify(&MuleNotify::PartFile_Delete, ptr) 539#define CoreNotify_PartFile_SetCat(ptr, val) MuleNotify::DoNotify(&MuleNotify::PartFile_SetCat, ptr, val) 540 541// KnownFile 542#define CoreNotify_KnownFile_Up_Prio_Set(ptr, val) MuleNotify::DoNotify(&MuleNotify::KnownFile_Up_Prio_Set, ptr, val) 543#define CoreNotify_KnownFile_Up_Prio_Auto(ptr) MuleNotify::DoNotify(&MuleNotify::KnownFile_Up_Prio_Auto, ptr) 544#define CoreNotify_KnownFile_Comment_Set(ptr, v0, v1) MuleNotify::DoNotify(&MuleNotify::KnownFile_Comment_Set, ptr, v0, v1) 545 546// Search 547#define CoreNotify_Search_Add_Download(ptr, val) MuleNotify::DoNotify(&MuleNotify::Search_Add_Download, ptr, val) 548#define CoreNotify_Search_Update_Progress(val) MuleNotify::DoNotify(&MuleNotify::Search_Update_Progress, val) 549 550// download queue 551#define CoreNotify_Download_Set_Cat_Prio(cat, pri) MuleNotify::DoNotify(&MuleNotify::Download_Set_Cat_Prio, cat, pri) 552#define CoreNotify_Download_Set_Cat_Status(cat, st) MuleNotify::DoNotify(&MuleNotify::Download_Set_Cat_Status, cat, st) 553 554// upload queue 555#define CoreNotify_Upload_Resort_Queue() MuleNotify::DoNotify(&MuleNotify::Upload_Resort_Queue) 556 557// client 558#define CoreNotify_Client_Delete(client) MuleNotify::DoNotify(&MuleNotify::Client_Delete, client) 559 560// 561// Notifications that always create an event 562// 563 564// IP filter 565#define NotifyAlways_IPFilter_Reload() MuleNotify::DoNotifyAlways(&MuleNotify::IPFilter_Reload) 566#define NotifyAlways_IPFilter_Update(url) MuleNotify::DoNotifyAlways(&MuleNotify::IPFilter_Update, url) 567 568#endif // __GUIEVENTS_H__ 569 570// File_checked_for_headers 571