/*****************************************************************************
 *
 *  macrosdev.h -- Macros for developer convenience.
 *
 *  Copyright (C) 2010 Starbuck <starbuck@labdv.com>
 *  All rights reserved.
 *
 *  This file is part of the Encoder module of the DVDx 4 application.
 *
 *  GNU Lesser General Public License Usage
 *  This file may be used under the terms of the GNU Lesser General
 *  Public License version 2.1 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.LGPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU Lesser General Public License version 2.1 requirements
 *  will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
 *
 *  GNU General Public License Usage
 *  Alternatively, this file may be used under the terms of the GNU
 *  General Public License version 3.0 as published by the Free Software
 *  Foundation and appearing in the file LICENSE.GPL included in the
 *  packaging of this file.  Please review the following information to
 *  ensure the GNU General Public License version 3.0 requirements will be
 *  met: http://www.gnu.org/copyleft/gpl.html.
 *
 *****************************************************************************/

#ifndef MACROSDEV_H
#define MACROSDEV_H

// Helpers
#define Stringify( L )			#L
#define MakeString( M, L )		M(L)
#define QuotedLine				MakeString( Stringify, __LINE__ )

// Compiler messages to display in Visual Studio
// Usage: 
// 
// #ifdef WIN32	(muted for GCC on Macx and Unix)
// #pragma message (ToBeDone "clear theora encoder settings - " __FUNCTION__)
// #pragma message (Reminder "xvid.max_bframes not altered by preset - " __FUNCTION__)
// #pragma message (Bug "memory leak - " __FUNCTION__)
// #endif
//
#define ToBeDone				\
	__FILE__ "(" QuotedLine ") : TBD: "
#define Bug				\
	__FILE__ "(" QuotedLine ") : BUG: "
#define Reminder				\
	__FILE__ "(" QuotedLine ") : Reminder: "

// WidgetBridge messages
#define MSG_CHANGEVOLUME					"changeVolume"
#define MSG_CHANGETESTMODE					"changeTestMode"
#define MSG_CHANGEENCODERPREFERENCES		"changeEncoderPreferences"

// Verbosity (the most verbose the highest)
#define VERBOSITY_QUIET		1
#define VERBOSITY_NORMAL	2
#define VERBOSITY_VERBOSE	3

// Email regex (RFC 2822)
//#define RX_CATCH_EMAIL "(?:[a-z0-9!#$%&'*+/=?^_`{|}~-]+(?:\\.[a-z0-9!#$%&'*+/=?^_`{|}~-]+)*|\"(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21\\x23-\\x5b\\x5d-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])*\")@(?:(?:[a-z0-9](?:[a-z0-9-]*[a-z0-9])?\\.)+[a-z0-9](?:[a-z0-9-]*[a-z0-9])?|\\[(?:(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)\\.){3}(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?|[a-z0-9-]*[a-z0-9]:(?:[\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x21-\\x5a\\x53-\\x7f]|\\\\[\\x01-\\x09\\x0b\\x0c\\x0e-\\x7f])+)\\])"
//#define RX_CATCH_EMAIL "[a-z0-9!#$%&'*+/=?^_`{|}~-\\.]+@[a-z0-9!#$%&'*+/=?^_`{|}~-\\.]+\\.[a-z0-9]{2,6}"
#define RX_CATCH_EMAIL "[a-z0-9!#\\$%\\&\\'\\*+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-\\.]+@[a-z0-9!#\\$%\\&\\'\\*+\\/\\=\\?\\^\\_\\`\\{\\|\\}\\~\\-\\.]+\\.[a-z0-9]{2,6}"

// Application handling
#define RESTART_CODE	1000

#endif // MACROSDEV.H
