foobar2000 SDK  2015-08-03
popup_message.cpp
Go to the documentation of this file.
1 #include "foobar2000.h"
2 
3 void popup_message::g_show_ex(const char * p_msg,unsigned p_msg_length,const char * p_title,unsigned p_title_length,t_icon p_icon)
4 {
5  // Do not force instantiate, not all platforms have this
8  if (e.first( m ) ) {
9  m->show_ex( p_msg, p_msg_length, p_title, p_title_length, p_icon );
10  }
11 }
12 
13 
14 void popup_message::g_complain(const char * what) {
15  g_show(what, "Information", icon_error);
16 }
17 
18 void popup_message::g_complain(const char * p_whatFailed, const std::exception & p_exception) {
19  g_complain(p_whatFailed,p_exception.what());
20 }
21 void popup_message::g_complain(const char * p_whatFailed, const char * msg) {
22  g_complain( PFC_string_formatter() << p_whatFailed << ": " << msg );
23 }
24 
25 void popup_message_v2::g_show(HWND parent, const char * msg, const char * title) {
28  if (e.first( m )) {
29  m->show(parent, msg, title);
30  } else {
31  popup_message::g_show( msg, title );
32  }
33 }
34 void popup_message_v2::g_complain(HWND parent, const char * whatFailed, const char * msg) {
35  g_show(parent, PFC_string_formatter() << whatFailed << ": " << msg);
36 }
37 void popup_message_v2::g_complain(HWND parent, const char * whatFailed, const std::exception & e) {
38  g_complain(parent, whatFailed, e.what());
39 }
static void g_show(HWND parent, const char *msg, const char *title="Information")
bool first(service_ptr_t< t_query > &p_out)
Definition: service.h:581
static void g_show_ex(const char *p_msg, unsigned p_msg_length, const char *p_title, unsigned p_title_length, t_icon p_icon=icon_information)
Static helper function instantiating the service and activating the message dialog. See show_ex() for description of parameters.
static void g_complain(HWND parent, const char *whatFailed, const char *msg)
static void g_show(const char *p_msg, const char *p_title, t_icon p_icon=icon_information)
Static helper function instantiating the service and activating the message dialog. See show() for description of parameters.
Definition: popup_message.h:26
std::exception exception
Definition: primitives.h:193
Autopointer class to be used with all services. Manages reference counter calls behind-the-scenes.
Definition: service.h:55
static void g_complain(const char *what)