From f64b25ba44251abf6d06b89a42d2b1f40cb6c9fb Mon Sep 17 00:00:00 2001 From: Tobias Doerffel Date: Wed, 28 Sep 2005 07:42:40 +0000 Subject: [PATCH] added missing files git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@11 0778d3d1-df1d-0410-868b-ea421aaaa00d --- include/gui_templates.h | 64 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 include/gui_templates.h diff --git a/include/gui_templates.h b/include/gui_templates.h new file mode 100644 index 000000000..59032386e --- /dev/null +++ b/include/gui_templates.h @@ -0,0 +1,64 @@ +/* + * gui_templates.h - GUI-specific templates + * + * Linux MultiMedia Studio + * Copyright (c) 2004-2005 Tobias Doerffel + * + * This program is free software; you can redistribute it and/or + * modify it under the terms of the GNU General Public + * License as published by the Free Software Foundation; either + * version 2 of the License, or (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + * General Public License for more details. + * + * You should have received a copy of the GNU General Public + * License along with this program (see COPYING); if not, write to the + * Free Software Foundation, Inc., 59 Temple Place - Suite 330, + * Boston, MA 02111-1307, USA. + * + */ + + +#ifndef _GUI_TEMPLATES_H +#define _GUI_TEMPLATES_H + +#include "qt3support.h" + +#ifdef QT4 + +#include +#include +#include +#include + +#else + +#include +#include +#include +#include + +#endif + + +// return DPI-independent font-size - font with returned font-size has always +// the same size in pixels +template +inline QFont pointSize( QFont _f ) +{ + static const int DPI = 96; +#ifdef QT4 + _f.setPointSizeF( SIZE * DPI / + QPaintDevice( QApplication::desktop() ).logicalDpiY() ); +#else + _f.setPointSizeFloat( SIZE * DPI / + QPaintDeviceMetrics( qApp->desktop() ).logicalDpiY() ); +#endif + return( _f ); +} + + +#endif