Changeset 3905
- Timestamp:
- 10/13/05 21:29:45 (3 years ago)
- Files:
-
- trunk/src/ChangeLog.Meadow (modified) (1 diff)
- trunk/src/mw32fns.c (modified) (4 diffs)
- trunk/src/mw32term.c (modified) (2 diffs)
- trunk/src/mw32term.h (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/src/ChangeLog.Meadow
r3904 r3905 1 2005-10-13 Kyotaro HORIGUCHI <horiguti@meadowy.org> 2 3 * mw32term.h (mw32_alpha_type): New enumeration. 4 (struct mw32_output): Remove *_alpha except current_alpha, and add 5 alpha[]. 6 7 * mw32term.c (mw32_update_frame_alpha): Refine code and sadd 8 upport of alpha of resizing window. 9 10 * mw32fns.c (CHECK_ALPHA_RANGE): New macro. 11 (mw32_set_frame_alpha): Refine code and sadd upport of alpha of 12 resizing window. 13 (mw32_WndProc<WM_SETFOCUS>): Immediately udpate alpha. 14 (mw32_WndProc<WM_KILLFOCUS>): Immediately udpate alpha. 15 (mw32_WndProc<WM_MOVING>): Refine. 16 (mw32_WndProc<WM_SIZING>): New event handler. 17 (mw32_WndProc<WM_EXITSIZEMOVE>): Ditto. 18 (x-create-frame): Following changes of mw32_output. 19 1 20 2005-10-12 Masayuki FUJII <boochang@m4.kcn.ne.jp> 2 21 trunk/src/mw32fns.c
r3902 r3905 932 932 extern SETLAYEREDWINDOWATTRPROC SetLayeredWindowAttributes; 933 933 934 #define CHECK_ALPHA_RANGE(alpha) if (alpha < 0 || alpha > 100) \ 935 args_out_of_range (make_number (0), make_number (100)); 936 934 937 static void 935 938 mw32_set_frame_alpha (FRAME_PTR f, Lisp_Object arg, Lisp_Object oldval) 936 939 { 937 int oldalpha= f->output_data.mw32->current_alpha;938 int newalpha_active, newalpha_inactive, newalpha_moving, newalpha;939 int obj;940 940 int newalpha[NUM_OF_ALPHAS]; 941 int i, tmp; 942 Lisp_Object obj; 943 941 944 if (SetLayeredWindowAttributes == NULL) 942 945 return; 943 944 if (NILP (arg)) 945 newalpha_active = newalpha_inactive = -1; 946 else 946 947 for (i = 0 ; i < NUM_OF_ALPHAS ; i++) 948 newalpha[i] = -1; 949 950 if (!NILP (arg)) 947 951 { 948 952 if (NUMBERP (arg)) 949 953 { 950 newalpha_active = XINT (arg); 951 952 if (newalpha_active < 0 || newalpha_active > 100) 953 args_out_of_range (make_number (0), make_number (100)); 954 955 newalpha_inactive = newalpha_moving = newalpha_active; 954 tmp = XINT (arg); 955 CHECK_ALPHA_RANGE (tmp); 956 for (i = 0 ; i < NUM_OF_ALPHAS ; i++) 957 newalpha[i] = tmp; 956 958 } 957 else if (CONSP (arg) )959 else if (CONSP (arg) && NUMBERP (CAR (arg))) 958 960 { 959 if (! NUMBERP (CAR (arg))) 960 wrong_type_argument (Qnumberp, (CAR (arg))); 961 newalpha_active = XINT (CAR (arg)); 961 tmp = XINT (CAR (arg)); 962 CHECK_ALPHA_RANGE (tmp); 963 for (i = 0 ; i < NUM_OF_ALPHAS ; i++) 964 newalpha[i] = tmp; 962 965 963 966 if (NUMBERP (CDR (arg))) 964 newalpha_inactive = XINT (CDR (arg));965 else if (CONSP (CDR (arg)) && NUMBERP (CAR (CDR (arg))))966 newalpha_inactive = XINT (CAR (CDR (arg)));967 else968 wrong_type_argument (Qnumberp, (CDR (arg)));967 { 968 tmp = XINT (CDR (arg)); 969 CHECK_ALPHA_RANGE (tmp) 970 newalpha[ALPHA_INACTIVE] = tmp; 971 } 969 972 970 newalpha_moving = newalpha_active; 971 972 if (newalpha_active > 100 || newalpha_active < 0 973 || newalpha_inactive > 100 || newalpha_inactive < 0) 974 args_out_of_range (make_number (0), make_number (100)); 975 976 if (CONSP (CDR (arg))) 977 { 978 if (Flength (arg) > 2) 979 { 980 obj = (CAR (CDR (CDR (arg)))); 981 if (! NUMBERP (obj)) 982 wrong_type_argument (Qnumberp, obj); 983 newalpha_moving = XINT (obj); 984 985 if (newalpha_moving > 100 || newalpha_moving < 0) 986 args_out_of_range (make_number (0), make_number (100)); 987 } 973 obj = CDR (arg); 974 for (i = ALPHA_INACTIVE ; 975 i < NUM_OF_ALPHAS && CONSP (obj) ; 976 i++, obj = CDR (obj)) 977 { 978 if (! NUMBERP (CAR (obj))) 979 wrong_type_argument (Qnumberp, (CAR (obj))); 980 tmp = XINT (CAR (obj)); 981 CHECK_ALPHA_RANGE (tmp); 982 newalpha[i] = tmp; 988 983 } 989 984 } 990 985 else 991 986 wrong_type_argument (Qnumberp, arg); 992 987 } 988 989 for (i = 0 ; i < NUM_OF_ALPHAS ; i++) 990 { 993 991 /* Apply lower limit silently */ 994 if (newalpha_active < mw32_frame_alpha_lower_limit) 995 newalpha_active = mw32_frame_alpha_lower_limit; 996 if (newalpha_inactive < mw32_frame_alpha_lower_limit) 997 newalpha_inactive = mw32_frame_alpha_lower_limit; 998 if (newalpha_moving < mw32_frame_alpha_lower_limit) 999 newalpha_moving = mw32_frame_alpha_lower_limit; 992 if (newalpha[i] != -1 && newalpha[i] < mw32_frame_alpha_lower_limit) 993 newalpha[i] = mw32_frame_alpha_lower_limit; 994 995 f->output_data.mw32->alpha[i] = newalpha[i]; 1000 996 } 1001 997 1002 f->output_data.mw32->active_alpha = newalpha_active;1003 f->output_data.mw32->inactive_alpha = newalpha_inactive;1004 f->output_data.mw32->moving_alpha = newalpha_moving;1005 1006 998 mw32_update_frame_alpha (f, TRUE); 1007 999 } … … 1931 1923 (WPARAM) 0, (LPARAM) 0); 1932 1924 1925 mw32_update_frame_alpha (f, FALSE); 1933 1926 return 0; 1934 1927 … … 1947 1940 PostMessage (hwnd, WM_EMACS_CLEAR_MOUSE_FACE, 1948 1941 (WPARAM) 1, (LPARAM) 0); 1942 1943 mw32_update_frame_alpha (f, FALSE); 1949 1944 return 0; 1950 1945 1951 1946 case WM_MOVING: 1952 if (f->output_data.mw32->moving_alpha >= 0 1953 && f->output_data.mw32->current_alpha >= 0 1954 && (f->output_data.mw32->moving_alpha != 1955 f->output_data.mw32->current_alpha)) 1956 { 1957 SetLayeredWindowAttributes(FRAME_MW32_WINDOW (f), 1958 RGB(255, 255, 255), 1959 (int) 1960 ((float)(f->output_data.mw32->moving_alpha) 1961 /(float)100*(float)255), 1962 LWA_ALPHA); 1963 f->output_data.mw32->current_alpha 1964 = f->output_data.mw32->moving_alpha; 1965 } 1966 return 0; 1947 f->output_data.mw32->frame_moving_or_sizing = 1; 1948 mw32_update_frame_alpha (f, FALSE); 1949 return TRUE; 1950 1951 case WM_SIZING: 1952 f->output_data.mw32->frame_moving_or_sizing = 2; 1953 mw32_update_frame_alpha (f, FALSE); 1954 return TRUE; 1955 1956 case WM_EXITSIZEMOVE: 1957 f->output_data.mw32->frame_moving_or_sizing = 0; 1958 mw32_update_frame_alpha (f, FALSE); 1959 1960 return TRUE; 1967 1961 1968 1962 case WM_MOVE: … … 2805 2799 f->output_data.mw32->hdc = INVALID_HANDLE_VALUE; 2806 2800 f->output_data.mw32->message_thread_hdc = INVALID_HANDLE_VALUE; 2807 f->output_data.mw32->current_alpha = -1; 2808 f->output_data.mw32->active_alpha = -1; 2809 f->output_data.mw32->inactive_alpha = -1; 2810 f->output_data.mw32->moving_alpha = -1; 2801 f->output_data.mw32->frame_moving_or_sizing = 0; 2802 { 2803 int i; 2804 2805 f->output_data.mw32->current_alpha = -1; 2806 for (i = 0 ; i < NUM_OF_ALPHAS ; i++) 2807 f->output_data.mw32->alpha[i] = -1; 2808 } 2811 2809 { 2812 2810 LOGFONT lf; trunk/src/mw32term.c
r3904 r3905 709 709 oldalpha = f->output_data.mw32->current_alpha; 710 710 711 if (FRAME_MW32_DISPLAY_INFO (f)->mw32_highlight_frame == f) 712 newalpha = f->output_data.mw32->active_alpha; 711 if (f->output_data.mw32->frame_moving_or_sizing == 1) 712 newalpha = f->output_data.mw32->alpha[ALPHA_MOVING]; 713 else if (f->output_data.mw32->frame_moving_or_sizing == 2) 714 newalpha = f->output_data.mw32->alpha[ALPHA_SIZING]; 715 else if (FRAME_MW32_DISPLAY_INFO (f)->mw32_highlight_frame == f) 716 newalpha = f->output_data.mw32->alpha[ALPHA_ACTIVE]; 713 717 else 714 newalpha = f->output_data.mw32-> inactive_alpha;718 newalpha = f->output_data.mw32->alpha[ALPHA_INACTIVE]; 715 719 716 720 if (change_style) … … 4228 4232 clear_mouse_face (dpyinfo); 4229 4233 } 4230 4231 4234 } 4232 4235 break; trunk/src/mw32term.h
r3904 r3905 332 332 }; 333 333 334 /* Index of alpha set in mw32_output */ 335 enum mw32_alpha_type 336 { 337 ALPHA_ACTIVE, 338 ALPHA_INACTIVE, 339 ALPHA_MOVING, 340 ALPHA_SIZING, 341 NUM_OF_ALPHAS 342 }; 343 334 344 /* Each X frame object points to its own struct x_output object 335 345 in the output_data.x field. The x_output structure contains … … 478 488 LOGFONT ime_logfont; 479 489 490 int frame_moving_or_sizing; /* 0: none, 1: moving, 2:sizing */ 491 480 492 /* Transparent frame. Range is -1 to 100, -1 means alpha disabled. */ 481 int active_alpha; /* Alpha value when this frame is active */ 482 int inactive_alpha; /* Alpha value when this frame is inactive */ 483 int moving_alpha; /* Alpha value when this frame is under move */ 493 int alpha[NUM_OF_ALPHAS]; 484 494 int current_alpha; /* Current alpha value of this frame */ 485 495 };
