mirror of
https://github.com/tuxbox-neutrino/neutrino.git
synced 2025-09-01 09:51:22 +02:00
port rounded corner code from tuxbox CVSuse getScreenStartX(),getScreenStartY(),h_max(),w_max() routines
git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@87 e54a6e83-5905-42d5-8d5c-058d10e6a962
This commit is contained in:
@@ -1,21 +1,26 @@
|
||||
/*
|
||||
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.cpp,v 1.3 2004/03/17 22:56:08 rasc Exp $
|
||||
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.cpp,v 1.4 2009/12/15 09:42:59 dbt Exp $
|
||||
*
|
||||
* -- some odd module to calc max. screen usage of an menue
|
||||
* -- this should be somewhere else (neutrino needs redesign)
|
||||
*
|
||||
* (C) 2004 by rasc
|
||||
*
|
||||
*
|
||||
*/
|
||||
|
||||
#include <config.h>
|
||||
|
||||
|
||||
|
||||
#include "global.h"
|
||||
#include "driver/screen_max.h"
|
||||
|
||||
|
||||
// -- this is a simple odd class provided for 'static' usage
|
||||
// -- to calculate max. usage of a preferred menue size (x,y)
|
||||
// -- this is due to 16:9 TV zoom functions, which are cutting menues.
|
||||
// -- so using this function will make menues to obey max. screen settings.
|
||||
//
|
||||
//
|
||||
// usage: e.g. try to paint menue h: 500 w, 400 (but screen is limited
|
||||
// to (450 x 420)), functions will return 450 and 400
|
||||
// the _add factor is for boundary...
|
||||
@@ -24,6 +29,7 @@
|
||||
//
|
||||
// 2004-03-17 rasc
|
||||
|
||||
|
||||
int w_max (int w_size, int w_add)
|
||||
{
|
||||
int dw;
|
||||
@@ -37,6 +43,7 @@ int w_max (int w_size, int w_add)
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
int h_max (int h_size, int h_add)
|
||||
{
|
||||
int dh;
|
||||
@@ -49,3 +56,21 @@ int h_max (int h_size, int h_add)
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
//some helpers to get x and y screen values vor menus and windows
|
||||
int getScreenStartX (int width)
|
||||
{
|
||||
int w = width;
|
||||
return (((g_settings.screen_EndX- g_settings.screen_StartX)-w) / 2) + g_settings.screen_StartX;
|
||||
|
||||
}
|
||||
|
||||
int getScreenStartY (int height)
|
||||
{
|
||||
int y = height;
|
||||
return (((g_settings.screen_EndY- g_settings.screen_StartY)-y) / 2) + g_settings.screen_StartY;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
@@ -1,5 +1,5 @@
|
||||
/*
|
||||
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.h,v 1.1 2004/03/17 21:30:51 rasc Exp $
|
||||
* $Header: /cvs/tuxbox/apps/tuxbox/neutrino/src/driver/screen_max.h,v 1.2 2009/12/15 09:42:59 dbt Exp $
|
||||
*
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@@ -25,7 +25,8 @@
|
||||
|
||||
int w_max (int w_size, int w_add);
|
||||
int h_max (int h_size, int h_add);
|
||||
|
||||
int getScreenStartX(int width);
|
||||
int getScreenStartY(int height);
|
||||
|
||||
|
||||
#endif
|
||||
|
Reference in New Issue
Block a user