-
-int CheckVideoButtons(int mx, int my, int button)
-{
- int return_code = 0;
- static int choice = -1;
- static BOOL pressed = FALSE;
- static int video_button[5] =
- {
- VIDEO_PRESS_EJECT_ON,
- VIDEO_PRESS_STOP_ON,
- VIDEO_PRESS_PAUSE_ON,
- VIDEO_PRESS_REC_ON,
- VIDEO_PRESS_PLAY_ON
- };
-
- if (button)
- {
- if (!motion_status) /* Maustaste neu gedrückt */
- {
- if (ON_VIDEO_BUTTON(mx,my))
- {
- choice = VIDEO_BUTTON(mx);
- pressed = TRUE;
- DrawVideoDisplay(video_button[choice],0);
- }
- }
- else /* Mausbewegung bei gedrückter Maustaste */
- {
- if ((!ON_VIDEO_BUTTON(mx,my) || VIDEO_BUTTON(mx)!=choice) &&
- choice>=0 && pressed)
- {
- pressed = FALSE;
- DrawVideoDisplay(video_button[choice]<<1,0);
- }
- else if (ON_VIDEO_BUTTON(mx,my) && VIDEO_BUTTON(mx)==choice && !pressed)
- {
- pressed = TRUE;
- DrawVideoDisplay(video_button[choice],0);
- }
- }
- }
- else /* Maustaste wieder losgelassen */
- {
- if (ON_VIDEO_BUTTON(mx,my) && VIDEO_BUTTON(mx)==choice && pressed)
- {
- DrawVideoDisplay(video_button[choice]<<1,0);
- return_code = choice+1;
- choice = -1;
- pressed = FALSE;
- }
- else
- {
- choice = -1;
- pressed = FALSE;
- }
- }
-
- BackToFront();
- return(return_code);
-}
-
-int CheckSoundButtons(int mx, int my, int button)
-{
- int return_code = 0;
- static int choice = -1;
- static BOOL pressed = FALSE;
- int sound_state[3];
-
- sound_state[0] = BUTTON_SOUND_MUSIC | (BUTTON_ON * sound_music_on);
- sound_state[1] = BUTTON_SOUND_LOOPS | (BUTTON_ON * sound_loops_on);
- sound_state[2] = BUTTON_SOUND_SOUND | (BUTTON_ON * sound_on);
-
- if (button)
- {
- if (!motion_status) /* Maustaste neu gedrückt */
- {
- if (ON_SOUND_BUTTON(mx,my))
- {
- choice = SOUND_BUTTON(mx);
- pressed = TRUE;
- DrawSoundDisplay(sound_state[choice] | BUTTON_PRESSED);
- }
- }
- else /* Mausbewegung bei gedrückter Maustaste */
- {
- if ((!ON_SOUND_BUTTON(mx,my) || SOUND_BUTTON(mx)!=choice) &&
- choice>=0 && pressed)
- {
- pressed = FALSE;
- DrawSoundDisplay(sound_state[choice] | BUTTON_RELEASED);
- }
- else if (ON_SOUND_BUTTON(mx,my) && SOUND_BUTTON(mx)==choice && !pressed)
- {
- pressed = TRUE;
- DrawSoundDisplay(sound_state[choice] | BUTTON_PRESSED);
- }
- }
- }
- else /* Maustaste wieder losgelassen */
- {
- if (ON_SOUND_BUTTON(mx,my) && SOUND_BUTTON(mx)==choice && pressed)
- {
- DrawSoundDisplay(sound_state[choice] | BUTTON_RELEASED);
- return_code = 1<<choice;
- choice = -1;
- pressed = FALSE;
- }
- else
- {
- choice = -1;
- pressed = FALSE;
- }
- }
-
- BackToFront();
- return(return_code);
-}
-
-int CheckGameButtons(int mx, int my, int button)
-{
- int return_code = 0;
- static int choice = -1;
- static BOOL pressed = FALSE;
- int game_state[3] =
- {
- BUTTON_GAME_STOP,
- BUTTON_GAME_PAUSE,
- BUTTON_GAME_PLAY
- };
-
- if (button)
- {
- if (!motion_status) /* Maustaste neu gedrückt */
- {
- if (ON_GAME_BUTTON(mx,my))
- {
- choice = GAME_BUTTON(mx);
- pressed = TRUE;
- DrawGameButton(game_state[choice] | BUTTON_PRESSED);
- }
- }
- else /* Mausbewegung bei gedrückter Maustaste */
- {
- if ((!ON_GAME_BUTTON(mx,my) || GAME_BUTTON(mx)!=choice) &&
- choice>=0 && pressed)
- {
- pressed = FALSE;
- DrawGameButton(game_state[choice] | BUTTON_RELEASED);
- }
- else if (ON_GAME_BUTTON(mx,my) && GAME_BUTTON(mx)==choice && !pressed)
- {
- pressed = TRUE;
- DrawGameButton(game_state[choice] | BUTTON_PRESSED);
- }
- }
- }
- else /* Maustaste wieder losgelassen */
- {
- if (ON_GAME_BUTTON(mx,my) && GAME_BUTTON(mx)==choice && pressed)
- {
- DrawGameButton(game_state[choice] | BUTTON_RELEASED);
- return_code = 1<<choice;
- choice = -1;
- pressed = FALSE;
- }
- else
- {
- choice = -1;
- pressed = FALSE;
- }
- }
-
- BackToFront();
- return(return_code);
-}
-
-int CheckChooseButtons(int mx, int my, int button)
-{
- int return_code = 0;
- static int choice = -1;
- static BOOL pressed = FALSE;
- static int choose_button[5] =
- {
- BUTTON_OK,
- BUTTON_NO
- };
-
- if (button)
- {
- if (!motion_status) /* Maustaste neu gedrückt */
- {
- if (ON_CHOOSE_BUTTON(mx,my))
- {
- choice = CHOOSE_BUTTON(mx);
- pressed = TRUE;
- DrawChooseButton(choose_button[choice] | BUTTON_PRESSED);
- }
- }
- else /* Mausbewegung bei gedrückter Maustaste */
- {
- if ((!ON_CHOOSE_BUTTON(mx,my) || CHOOSE_BUTTON(mx)!=choice) &&
- choice>=0 && pressed)
- {
- pressed = FALSE;
- DrawChooseButton(choose_button[choice] | BUTTON_RELEASED);
- }
- else if (ON_CHOOSE_BUTTON(mx,my) &&CHOOSE_BUTTON(mx)==choice && !pressed)
- {
- pressed = TRUE;
- DrawChooseButton(choose_button[choice] | BUTTON_PRESSED);
- }
- }
- }
- else /* Maustaste wieder losgelassen */
- {
- if (ON_CHOOSE_BUTTON(mx,my) && CHOOSE_BUTTON(mx)==choice && pressed)
- {
- DrawChooseButton(choose_button[choice] | BUTTON_RELEASED);
- return_code = choice+1;
- choice = -1;
- pressed = FALSE;
- }
- else
- {
- choice = -1;
- pressed = FALSE;
- }
- }
-
- BackToFront();
- return(return_code);
-}
-
-int CheckConfirmButton(int mx, int my, int button)
-{
- int return_code = 0;
- static int choice = -1;
- static BOOL pressed = FALSE;
-
- if (button)
- {
- if (!motion_status) /* Maustaste neu gedrückt */
- {
- if (ON_CONFIRM_BUTTON(mx,my))
- {
- choice = 0;
- pressed = TRUE;
- DrawConfirmButton(BUTTON_PRESSED);
- }
- }
- else /* Mausbewegung bei gedrückter Maustaste */
- {
- if (!ON_CONFIRM_BUTTON(mx,my) && choice>=0 && pressed)
- {
- pressed = FALSE;
- DrawConfirmButton(BUTTON_RELEASED);
- }
- else if (ON_CONFIRM_BUTTON(mx,my) && !pressed)
- {
- pressed = TRUE;
- DrawConfirmButton(BUTTON_PRESSED);
- }
- }
- }
- else /* Maustaste wieder losgelassen */
- {
- if (ON_CONFIRM_BUTTON(mx,my) && pressed)
- {
- DrawConfirmButton(BUTTON_RELEASED);
- return_code = BUTTON_CONFIRM;
- choice = -1;
- pressed = FALSE;
- }
- else
- {
- choice = -1;
- pressed = FALSE;
- }
- }
-
- BackToFront();
- return(return_code);
-}
-
-void DrawCompleteVideoDisplay()
-{
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- DOOR_GFX_PAGEX3,DOOR_GFX_PAGEY2, VXSIZE,VYSIZE, VX,VY);
- XCopyArea(display,pix[PIX_DOOR],drawto,gc,
- DOOR_GFX_PAGEX4+VIDEO_CONTROL_XPOS,
- DOOR_GFX_PAGEY2+VIDEO_CONTROL_YPOS,
- VIDEO_CONTROL_XSIZE,VIDEO_CONTROL_YSIZE,
- VX+VIDEO_CONTROL_XPOS,VY+VIDEO_CONTROL_YPOS);
-
- DrawVideoDisplay(VIDEO_ALL_OFF,0);
- if (tape.date && tape.length)
- {
- DrawVideoDisplay(VIDEO_STATE_DATE_ON,tape.date);
- DrawVideoDisplay(VIDEO_STATE_TIME_ON,0);
- }
-
- XCopyArea(display,drawto,pix[PIX_DB_DOOR],gc,
- VX,VY, VXSIZE,VYSIZE, DOOR_GFX_PAGEX1,DOOR_GFX_PAGEY2);
-}