/usr/include/wx-3.0/wx/msgout.h is in wx3.0-headers 3.0.0-2.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 | ///////////////////////////////////////////////////////////////////////////////
// Name: wx/msgout.h
// Purpose: wxMessageOutput class. Shows a message to the user
// Author: Mattia Barbon
// Modified by:
// Created: 17.07.02
// Copyright: (c) Mattia Barbon
// Licence: wxWindows licence
///////////////////////////////////////////////////////////////////////////////
#ifndef _WX_MSGOUT_H_
#define _WX_MSGOUT_H_
// ----------------------------------------------------------------------------
// headers
// ----------------------------------------------------------------------------
#include "wx/defs.h"
#include "wx/chartype.h"
#include "wx/strvararg.h"
// ----------------------------------------------------------------------------
// wxMessageOutput is a class abstracting formatted output target, i.e.
// something you can printf() to
// ----------------------------------------------------------------------------
// NB: VC6 has a bug that causes linker errors if you have template methods
// in a class using __declspec(dllimport). The solution is to split such
// class into two classes, one that contains the template methods and does
// *not* use WXDLLIMPEXP_BASE and another class that contains the rest
// (with DLL linkage).
class wxMessageOutputBase
{
public:
virtual ~wxMessageOutputBase() { }
// show a message to the user
// void Printf(const wxString& format, ...) = 0;
WX_DEFINE_VARARG_FUNC_VOID(Printf, 1, (const wxFormatString&),
DoPrintfWchar, DoPrintfUtf8)
#ifdef __WATCOMC__
// workaround for http://bugzilla.openwatcom.org/show_bug.cgi?id=351
WX_VARARG_WATCOM_WORKAROUND(void, Printf, 1, (const wxString&),
(wxFormatString(f1)));
WX_VARARG_WATCOM_WORKAROUND(void, Printf, 1, (const wxCStrData&),
(wxFormatString(f1)));
WX_VARARG_WATCOM_WORKAROUND(void, Printf, 1, (const char*),
(wxFormatString(f1)));
WX_VARARG_WATCOM_WORKAROUND(void, Printf, 1, (const wchar_t*),
(wxFormatString(f1)));
#endif
// called by DoPrintf() to output formatted string but can also be called
// directly if no formatting is needed
virtual void Output(const wxString& str) = 0;
protected:
// NB: this is pure virtual so that it can be implemented in dllexported
// wxMessagOutput class
#if !wxUSE_UTF8_LOCALE_ONLY
virtual void DoPrintfWchar(const wxChar *format, ...) = 0;
#endif
#if wxUSE_UNICODE_UTF8
virtual void DoPrintfUtf8(const char *format, ...) = 0;
#endif
};
#ifdef __VISUALC__
// "non dll-interface class 'wxStringPrintfMixin' used as base interface
// for dll-interface class 'wxString'" -- this is OK in our case
#pragma warning (push)
#pragma warning (disable:4275)
#endif
class WXDLLIMPEXP_BASE wxMessageOutput : public wxMessageOutputBase
{
public:
virtual ~wxMessageOutput() { }
// gets the current wxMessageOutput object (may be NULL during
// initialization or shutdown)
static wxMessageOutput* Get();
// sets the global wxMessageOutput instance; returns the previous one
static wxMessageOutput* Set(wxMessageOutput* msgout);
protected:
#if !wxUSE_UTF8_LOCALE_ONLY
virtual void DoPrintfWchar(const wxChar *format, ...);
#endif
#if wxUSE_UNICODE_UTF8
virtual void DoPrintfUtf8(const char *format, ...);
#endif
private:
static wxMessageOutput* ms_msgOut;
};
#ifdef __VISUALC__
#pragma warning (pop)
#endif
// ----------------------------------------------------------------------------
// implementation which sends output to stderr or specified file
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutputStderr : public wxMessageOutput
{
public:
wxMessageOutputStderr(FILE *fp = stderr) : m_fp(fp) { }
virtual void Output(const wxString& str);
protected:
// return the string with "\n" appended if it doesn't already terminate
// with it (in which case it's returned unchanged)
wxString AppendLineFeedIfNeeded(const wxString& str);
FILE *m_fp;
};
// ----------------------------------------------------------------------------
// implementation showing the message to the user in "best" possible way:
// uses stderr or message box if available according to the flag given to ctor.
// ----------------------------------------------------------------------------
enum wxMessageOutputFlags
{
wxMSGOUT_PREFER_STDERR = 0, // use stderr if available (this is the default)
wxMSGOUT_PREFER_MSGBOX = 1 // always use message box if available
};
class WXDLLIMPEXP_BASE wxMessageOutputBest : public wxMessageOutputStderr
{
public:
wxMessageOutputBest(wxMessageOutputFlags flags = wxMSGOUT_PREFER_STDERR)
: m_flags(flags) { }
virtual void Output(const wxString& str);
private:
wxMessageOutputFlags m_flags;
};
// ----------------------------------------------------------------------------
// implementation which shows output in a message box
// ----------------------------------------------------------------------------
#if wxUSE_GUI && wxUSE_MSGDLG
class WXDLLIMPEXP_CORE wxMessageOutputMessageBox : public wxMessageOutput
{
public:
wxMessageOutputMessageBox() { }
virtual void Output(const wxString& str);
};
#endif // wxUSE_GUI && wxUSE_MSGDLG
// ----------------------------------------------------------------------------
// implementation using the native way of outputting debug messages
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutputDebug : public wxMessageOutputStderr
{
public:
wxMessageOutputDebug() { }
virtual void Output(const wxString& str);
};
// ----------------------------------------------------------------------------
// implementation using wxLog (mainly for backwards compatibility)
// ----------------------------------------------------------------------------
class WXDLLIMPEXP_BASE wxMessageOutputLog : public wxMessageOutput
{
public:
wxMessageOutputLog() { }
virtual void Output(const wxString& str);
};
#endif // _WX_MSGOUT_H_
|