📄 pw_m.c
字号:
/***********************************************************************/
/* File: */
/* Copyright (c) 2000 ZORAN Corporation, All Rights Reserved */
/* THIS IS PROPRIETARY SOURCE CODE OF ZORAN CORPORATION */
/* */
/* =========== */
/* Descripton: */
/* =========== */
/* */
/* Log: */
/* === */
/* $Name: V_1_16 V_1_15 V_1_14 V_1_13 V_1_12 NV_1_00 V_1_11 $
/* $Header: v:/dsg/rcs/dsg/vp2k/Customer/menu/zoran/pw_m.c 1.12 2001/06/06 06:15:10 dingming Exp $
/* $Log: pw_m.c $
/* Revision 1.12 2001/06/06 06:15:10 dingming
/* font 32X24 complile
/* Revision 1.11 2001/05/21 06:59:35 leslie
/* Revision 1.10 2000/11/18 23:09:33 charlie
/* Changed debug message from printf to rtouts
/* Revision 1.9 2000/11/17 18:54:17 charlie
/* Use C_FOCUSED
/* Revision 1.8 2000/11/09 04:07:33 cliff
/***********************************************************************/
#include <stdio.h>
#include <string.h>
#include "sysdefs.h"
#include "..\..\..\ui\menu_sys\ms_wdgt.h"
#include "..\..\..\ui\menu_sys\ms_lib.h"
#include "..\..\..\ui\menu_sys\osd_drv.h"
#include "..\..\..\decoder\osdrendr.h"
#include "..\..\..\decoder\osdlayou.h"
#ifdef FONT32X24 //DM0605
#include "..\..\..\customer\dragon\strings\strings.h"
#else
#include "..\..\..\ui\strings\strings.h"
#endif
#include "menu_var.h"
#include "..\..\..\playcore\ps\ps.h"
#include "..\..\..\playcore\coremain\coregdef.h"
#include "..\..\..\kernel\eventdef.h"
// REMINDER This is not needed if we don't use oHWLimit
#include "..\..\..\Decoder\decoder.h"
#define USE_UNION
#ifdef USE_UNION
#define MEMBER(_member_) gu_ms.m_pwm._member_
#else
static char sz_password[5];
#endif
// Static text positions
// Widget positions
static const MS_POS screen_pos = {104, MS_LINE_2, 496, MS_LINE_HEIGHT};
const MS_POS pw_edit_pos = {200, MS_LINE_0 , 192, MS_LINE_HEIGHT};
static const MS_POS dont_care_pos = {200, MS_LINE_1, 0, 0};
static const MS_STATIC mssPassword = {
{
0,
ALIGN_LEFT,
I_COLOR,
{16, MS_LINE_0, 200, MS_LINE_HEIGHT},
NO_PARENT,
static_user_op,
},
(void *)S_PASSWORD
};
static char sz_password[5];
static void layout (void)
{
go_CurrentLayout.m_bBigMemMap = FALSE;//USE_BIGMEMMAP_WHEN_REQUIRED;
go_CurrentLayout.m_cPixRes = 0;
go_CurrentLayout.m_wOriginX = 0;
#ifdef FONT32X24 //DM0605
go_CurrentLayout.m_wOriginY = MS_LINE_2;
#else
go_CurrentLayout.m_wOriginY = 60;
#endif
go_CurrentLayout.m_wWidth = 720;
go_CurrentLayout.m_wHeight = 120;
go_CurrentLayout.m_cNbrHole = 0;
go_CurrentLayout.m_cInitColor = 0;
go_CurrentLayout.m_cNbrColor = 16;
go_CurrentLayout.m_pColorPalette = (OSD_Palette *)MenuBitmapColor;
OSDSetLayout();
OSDSetFont(0);
rtouts("\nPASSWORD SCREEN LAYOUT");
}
static void close_password(void)
{
#ifdef NO_C_STDLIB
rtouts("\nPassword menu closed");
#endif
SAFELY_DELETE(mspwPassword);
#ifdef ALLOW_PARENTAL_CHANGE//ZORAN LX0517
if ( gns.dvd.password_state == PASSWORD_IN_PROGRESS )
gns.dvd.password_state = PASSWORD_FAILED;
#endif
}
void password_action(char *s)
{
long lPassword;
#ifdef NO_C_STDLIB
rtouts("\nPassword is "); rtouts(s);
#endif
if ( strlen(s) < 4 )
{
#ifdef NO_C_STDLIB
rtouts("\nToo short (must be 4 digits)!");
#endif
return;
}
text_to_num(s, &lPassword);
#ifdef NO_C_STDLIB
rtouts(" ( "); rtoutl(lPassword); rtouts(" )\n");
#endif
if ( (lPassword == gps->parental_password) || (lPassword == MASTER_PASSWORD) )
{
gns.dvd.password_state = PASSWORD_OK;
}
else
{
gns.dvd.password_state = PASSWORD_FAILED;
}
g_ms_bMustClose = TRUE;
}
void open_password(void)
{
screen = MS_create_screen((MS_POS *)&screen_pos, screen_color, 0, close_password, layout);
strcpy( sz_password, "----" );
mspwPassword = MS_create_password((MS_POS *)&pw_edit_pos, i_color, sz_password, password_action, 4, MS_HOT_SPOT);
MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)mspwPassword, C_FOCUSED);
MS_add_item((MS_DIALOG*)screen,(MS_WIDGET*)&mssPassword, !C_FOCUSED);
MS_dialog_display((MS_DIALOG*)screen);
}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -