Mercurial > mplayer.hg
comparison libvo/x11_common.c @ 10765:c8fb7e2690a3
10000l. Never ever use such foolish GCC 3.x extensionscvs diff -u x11_common.c x11_common.h |more
author | alex |
---|---|
date | Sun, 31 Aug 2003 23:13:45 +0000 |
parents | 3aea64e0d6d9 |
children | e2dcade78bc6 |
comparison
equal
deleted
inserted
replaced
10764:06ebe990fa92 | 10765:c8fb7e2690a3 |
---|---|
814 } | 814 } |
815 | 815 |
816 // | 816 // |
817 Window vo_x11_create_smooth_window( Display *mDisplay, Window mRoot, Visual *vis, int x, int y, unsigned int width, unsigned int height, int depth, Colormap col_map) | 817 Window vo_x11_create_smooth_window( Display *mDisplay, Window mRoot, Visual *vis, int x, int y, unsigned int width, unsigned int height, int depth, Colormap col_map) |
818 { | 818 { |
819 unsigned long xswamask; | 819 unsigned long xswamask = CWBackingStore | CWBorderPixel; |
820 XSetWindowAttributes xswa; | 820 XSetWindowAttributes xswa; |
821 | 821 Window ret_win; |
822 xswamask=CWBackingStore | CWBorderPixel; | |
823 | 822 |
824 if (col_map!=CopyFromParent) | 823 if (col_map!=CopyFromParent) |
825 { | 824 { |
826 xswa.colormap = col_map; | 825 xswa.colormap = col_map; |
827 xswamask|=CWColormap; | 826 xswamask|=CWColormap; |
829 xswa.background_pixel = 0; | 828 xswa.background_pixel = 0; |
830 xswa.border_pixel = 0; | 829 xswa.border_pixel = 0; |
831 xswa.backing_store = Always; | 830 xswa.backing_store = Always; |
832 xswa.bit_gravity = StaticGravity; | 831 xswa.bit_gravity = StaticGravity; |
833 | 832 |
834 Window ret_win = XCreateWindow(mDisplay, mRootWin, x, y, width, height, 0, depth, | 833 ret_win = XCreateWindow(mDisplay, mRootWin, x, y, width, height, 0, depth, |
835 CopyFromParent, vis, xswamask , &xswa); | 834 CopyFromParent, vis, xswamask , &xswa); |
836 if (!f_gc) f_gc=XCreateGC (mDisplay, ret_win, 0, 0); | 835 if (!f_gc) f_gc=XCreateGC (mDisplay, ret_win, 0, 0); |
837 XSetForeground (mDisplay, f_gc, 0); | 836 XSetForeground (mDisplay, f_gc, 0); |
838 | 837 |
839 return ret_win; | 838 return ret_win; |
840 } | 839 } |
841 | 840 |
842 | 841 |
843 void vo_x11_clearwindow_part( Display *mDisplay, Window vo_window, int img_wid, int img_hei, int use_fs) | 842 void vo_x11_clearwindow_part(Display *mDisplay, Window vo_window, int img_width, int img_height, int use_fs) |
844 { | 843 { |
844 int u_dheight, u_dwidth, left_ov, left_ov2; | |
845 | |
845 if (!f_gc) return; | 846 if (!f_gc) return; |
846 int u_dheight = use_fs?vo_screenheight:vo_dheight; | 847 |
847 int u_dwidth = use_fs?vo_screenwidth:vo_dwidth; | 848 u_dheight = use_fs?vo_screenheight:vo_dheight; |
848 | 849 u_dwidth = use_fs?vo_screenwidth:vo_dwidth; |
849 if (u_dheight<=img_hei && u_dwidth<=img_wid) return; | 850 if ((u_dheight<=img_height) && (u_dwidth<=img_width)) return; |
850 | 851 |
851 int left_ov = (u_dheight - img_hei)/2; | 852 left_ov = (u_dheight - img_height)/2; |
852 int left_ov2 = (u_dwidth - img_wid)/2; | 853 left_ov2 = (u_dwidth - img_width)/2; |
853 | 854 |
854 XFillRectangle(mDisplay, vo_window, f_gc, 0, 0, u_dwidth, left_ov); | 855 XFillRectangle(mDisplay, vo_window, f_gc, 0, 0, u_dwidth, left_ov); |
855 XFillRectangle(mDisplay, vo_window, f_gc, 0, u_dheight-left_ov-1, u_dwidth, left_ov+1); | 856 XFillRectangle(mDisplay, vo_window, f_gc, 0, u_dheight-left_ov-1, u_dwidth, left_ov+1); |
856 | 857 |
857 if (u_dwidth>img_wid) | 858 if (u_dwidth>img_width) |
858 { | 859 { |
859 XFillRectangle(mDisplay, vo_window, f_gc, 0, left_ov, left_ov2, img_hei); | 860 XFillRectangle(mDisplay, vo_window, f_gc, 0, left_ov, left_ov2, img_height); |
860 XFillRectangle(mDisplay, vo_window, f_gc, u_dwidth-left_ov2-1, left_ov, left_ov2, img_hei); | 861 XFillRectangle(mDisplay, vo_window, f_gc, u_dwidth-left_ov2-1, left_ov, left_ov2, img_height); |
861 } | 862 } |
862 | 863 |
863 XFlush(mDisplay); | 864 XFlush(mDisplay); |
864 } | 865 } |
865 | 866 |