From 6ead487b065fb66adad951f585919a8258c6bf10 Mon Sep 17 00:00:00 2001 From: gabucino Date: Sun, 15 Apr 2001 18:35:17 +0000 Subject: Pontscho's mixer, select, and hell-a-lot-of-stuff patch ;) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@441 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libvo/wskeys.h | 2 ++ libvo/x11_common.c | 94 +++++++++++++++++++++++++++--------------------------- 2 files changed, 49 insertions(+), 47 deletions(-) (limited to 'libvo') diff --git a/libvo/wskeys.h b/libvo/wskeys.h index e624abc34f..e3643ca09f 100644 --- a/libvo/wskeys.h +++ b/libvo/wskeys.h @@ -60,6 +60,8 @@ #define wsSpace ' ' #define wsMinus '-' #define wsPlus '+' +#define wsMul '*' +#define wsDiv '/' #define wsUp 0x52 + 256 #define wsDown 0x54 + 256 diff --git a/libvo/x11_common.c b/libvo/x11_common.c index 0379797f81..9c72b16732 100644 --- a/libvo/x11_common.c +++ b/libvo/x11_common.c @@ -1,41 +1,37 @@ - #include #include - -#include "config.h" - -#ifdef X11_FULLSCREEN - #include + #include #include +#include "config.h" #include "video_out.h" +#ifdef X11_FULLSCREEN + #include #include #include #include -#include - static int dpms_disabled=0; static int timeout_save=0; void vo_hidecursor ( Display *disp , Window win ) { - Cursor no_ptr; - Pixmap bm_no; - XColor black,dummy; - Colormap colormap; - static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 }; - - colormap = DefaultColormap(disp,DefaultScreen(disp)); - XAllocNamedColor(disp,colormap,"black",&black,&dummy); - bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8); - no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0); - XDefineCursor(disp,win,no_ptr); + Cursor no_ptr; + Pixmap bm_no; + XColor black,dummy; + Colormap colormap; + static unsigned char bm_no_data[] = { 0,0,0,0, 0,0,0,0 }; + + colormap = DefaultColormap(disp,DefaultScreen(disp)); + XAllocNamedColor(disp,colormap,"black",&black,&dummy); + bm_no = XCreateBitmapFromData(disp, win, bm_no_data, 8,8); + no_ptr=XCreatePixmapCursor(disp, bm_no, bm_no,&black, &black,0, 0); + XDefineCursor(disp,win,no_ptr); } @@ -100,6 +96,10 @@ void vo_x11_putkey(int key){ case wsGrayMinus: mplayer_put_key('-'); break; case wsPlus: case wsGrayPlus: mplayer_put_key('+'); break; + case wsGrayMul: + case wsMul: mplayer_put_key('*'); break; + case wsGrayDiv: + case wsDiv: mplayer_put_key('/'); break; default: if((key>='a' && key<='z')||(key>='A' && key<='Z')) mplayer_put_key(key); } @@ -153,17 +153,17 @@ int vo_x11_check_events(Display *mydisplay){ switch( Event.type ) { case Expose: - ret|=VO_EVENT_EXPOSE; + ret|=VO_EVENT_EXPOSE; break; case ConfigureNotify: vo_dwidth=Event.xconfigure.width; - vo_dheight=Event.xconfigure.height; - ret|=VO_EVENT_RESIZE; + vo_dheight=Event.xconfigure.height; + ret|=VO_EVENT_RESIZE; break; case KeyPress: XLookupString( &Event.xkey,buf,sizeof(buf),&keySym,&stat ); vo_x11_putkey( ( (keySym&0xff00) != 0?( (keySym&0x00ff) + 256 ):( keySym ) ) ); - ret|=VO_EVENT_KEYPRESS; + ret|=VO_EVENT_KEYPRESS; break; } } @@ -171,25 +171,27 @@ int vo_x11_check_events(Display *mydisplay){ return ret; } +#endif + void saver_on(Display *mDisplay) { int nothing; if (dpms_disabled) { - if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) - { - printf ("Enabling DPMS\n"); - DPMSEnable(mDisplay); // restoring power saving settings - DPMSQueryExtension(mDisplay, ¬hing, ¬hing); - } + if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) + { + printf ("Enabling DPMS\n"); + DPMSEnable(mDisplay); // restoring power saving settings + DPMSQueryExtension(mDisplay, ¬hing, ¬hing); + } } - + if (timeout_save) { - int dummy, interval, prefer_blank, allow_exp; - XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp); - XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp); - XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); + int dummy, interval, prefer_blank, allow_exp; + XGetScreenSaver(mDisplay, &dummy, &interval, &prefer_blank, &allow_exp); + XSetScreenSaver(mDisplay, timeout_save, interval, prefer_blank, allow_exp); + XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); } } @@ -200,20 +202,18 @@ void saver_off(Display *mDisplay) { if (DPMSQueryExtension(mDisplay, ¬hing, ¬hing)) { - BOOL onoff; - CARD16 state; - DPMSInfo(mDisplay, &state, &onoff); - if (onoff) - { - printf ("Disabling DPMS\n"); - dpms_disabled=1; - DPMSDisable(mDisplay); // monitor powersave off - } + BOOL onoff; + CARD16 state; + DPMSInfo(mDisplay, &state, &onoff); + if (onoff) + { + printf ("Disabling DPMS\n"); + dpms_disabled=1; + DPMSDisable(mDisplay); // monitor powersave off + } } XGetScreenSaver(mDisplay, &timeout_save, &interval, &prefer_blank, &allow_exp); if (timeout_save) - XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); - // turning off screensaver + XSetScreenSaver(mDisplay, 0, interval, prefer_blank, allow_exp); + // turning off screensaver } - -#endif -- cgit v1.2.3