Mercurial > emacs
comparison src/xterm.c @ 25091:c3dc74005d22
(x_set_toolkit_scroll_bar_thumb): Don't call
XawScrollbarSetThumb if thumb parameters haven't changed because
that function apparently isn't optimized for this case.
author | Gerd Moellmann <gerd@gnu.org> |
---|---|
date | Tue, 27 Jul 1999 23:55:28 +0000 |
parents | 23813e3a69b8 |
children | 6b42357f28f9 |
comparison
equal
deleted
inserted
replaced
25090:4cd409210c7f | 25091:c3dc74005d22 |
---|---|
904 ? 1 : 0); | 904 ? 1 : 0); |
905 int left = window_box_left (w, -1); | 905 int left = window_box_left (w, -1); |
906 | 906 |
907 if (top_line_height < 0) | 907 if (top_line_height < 0) |
908 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w); | 908 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w); |
909 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); | 909 |
910 /* In case the same realized face is used for bitmap areas and | |
911 for something displayed in the text (e.g. face `region' on | |
912 mono-displays, the fill style may have been changed to | |
913 FillSolid in x_draw_glyph_string_background. */ | |
914 if (face->stipple) | |
915 XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); | |
916 else | |
917 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); | |
918 | |
910 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 919 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
911 face->gc, | 920 face->gc, |
912 (left | 921 (left |
913 - FRAME_X_FLAGS_AREA_WIDTH (f) | 922 - FRAME_X_FLAGS_AREA_WIDTH (f) |
914 + border), | 923 + border), |
915 WINDOW_TO_FRAME_PIXEL_Y (w, max (top_line_height, | 924 WINDOW_TO_FRAME_PIXEL_Y (w, max (top_line_height, |
916 row->y)), | 925 row->y)), |
917 FRAME_X_FLAGS_AREA_WIDTH (f) - border, | 926 FRAME_X_FLAGS_AREA_WIDTH (f) - border, |
918 row->visible_height); | 927 row->visible_height); |
919 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); | 928 if (!face->stipple) |
929 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); | |
920 } | 930 } |
921 | 931 |
922 /* Draw the left bitmap. */ | 932 /* Draw the left bitmap. */ |
923 if (bitmap != NO_BITMAP) | 933 if (bitmap != NO_BITMAP) |
924 x_draw_bitmap (w, row, bitmap); | 934 x_draw_bitmap (w, row, bitmap); |
939 { | 949 { |
940 int right = window_box_right (w, -1); | 950 int right = window_box_right (w, -1); |
941 | 951 |
942 if (top_line_height < 0) | 952 if (top_line_height < 0) |
943 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w); | 953 top_line_height = WINDOW_DISPLAY_TOP_LINE_HEIGHT (w); |
944 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); | 954 |
955 /* In case the same realized face is used for bitmap areas and | |
956 for something displayed in the text (e.g. face `region' on | |
957 mono-displays, the fill style may have been changed to | |
958 FillSolid in x_draw_glyph_string_background. */ | |
959 if (face->stipple) | |
960 XSetFillStyle (FRAME_X_DISPLAY (f), face->gc, FillOpaqueStippled); | |
961 else | |
962 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->background); | |
945 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 963 XFillRectangle (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), |
946 face->gc, | 964 face->gc, |
947 right, | 965 right, |
948 WINDOW_TO_FRAME_PIXEL_Y (w, max (top_line_height, | 966 WINDOW_TO_FRAME_PIXEL_Y (w, max (top_line_height, |
949 row->y)), | 967 row->y)), |
950 FRAME_X_FLAGS_AREA_WIDTH (f), | 968 FRAME_X_FLAGS_AREA_WIDTH (f), |
951 row->visible_height); | 969 row->visible_height); |
952 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); | 970 if (!face->stipple) |
971 XSetForeground (FRAME_X_DISPLAY (f), face->gc, face->foreground); | |
953 } | 972 } |
954 | 973 |
955 /* Draw the right bitmap. */ | 974 /* Draw the right bitmap. */ |
956 if (bitmap != NO_BITMAP) | 975 if (bitmap != NO_BITMAP) |
957 x_draw_bitmap (w, row, bitmap); | 976 x_draw_bitmap (w, row, bitmap); |
3027 struct x_output *di = f->output_data.x; | 3046 struct x_output *di = f->output_data.x; |
3028 unsigned long mask = GCForeground | GCLineWidth | GCGraphicsExposures; | 3047 unsigned long mask = GCForeground | GCLineWidth | GCGraphicsExposures; |
3029 unsigned long pixel; | 3048 unsigned long pixel; |
3030 unsigned long background = di->relief_background; | 3049 unsigned long background = di->relief_background; |
3031 Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); | 3050 Colormap cmap = DefaultColormapOfScreen (FRAME_X_SCREEN (f)); |
3051 struct x_display_info *dpyinfo = FRAME_X_DISPLAY_INFO (f); | |
3052 Display *dpy = FRAME_X_DISPLAY (f); | |
3032 | 3053 |
3033 xgcv.graphics_exposures = False; | 3054 xgcv.graphics_exposures = False; |
3034 xgcv.line_width = 1; | 3055 xgcv.line_width = 1; |
3035 | 3056 |
3036 /* Free previously allocated color. The color cell will be reused | 3057 /* Free previously allocated color. The color cell will be reused |
3039 if (relief->gc | 3060 if (relief->gc |
3040 && relief->allocated_p) | 3061 && relief->allocated_p) |
3041 { | 3062 { |
3042 /* If display has an immutable color map, freeing colors is not | 3063 /* If display has an immutable color map, freeing colors is not |
3043 necessary and some servers don't allow it. So don't do it. */ | 3064 necessary and some servers don't allow it. So don't do it. */ |
3044 int class = FRAME_X_DISPLAY_INFO (f)->visual->class; | 3065 int class = dpyinfo->visual->class; |
3045 if (class != StaticColor | 3066 if (class != StaticColor |
3046 && class != StaticGray | 3067 && class != StaticGray |
3047 && class != TrueColor) | 3068 && class != TrueColor) |
3048 XFreeColors (FRAME_X_DISPLAY (f), cmap, &relief->pixel, 1, 0); | 3069 XFreeColors (dpy, cmap, &relief->pixel, 1, 0); |
3049 relief->allocated_p = 0; | 3070 relief->allocated_p = 0; |
3050 } | 3071 } |
3051 | 3072 |
3052 /* Allocate new color. */ | 3073 /* Allocate new color. */ |
3053 xgcv.foreground = default_pixel; | 3074 xgcv.foreground = default_pixel; |
3054 pixel = background; | 3075 pixel = background; |
3055 if (x_alloc_lighter_color (f, FRAME_X_DISPLAY (f), cmap, &pixel, | 3076 if (dpyinfo->n_planes != 1 |
3056 factor, delta)) | 3077 && x_alloc_lighter_color (f, dpy, cmap, &pixel, factor, delta)) |
3057 { | 3078 { |
3058 relief->allocated_p = 1; | 3079 relief->allocated_p = 1; |
3059 xgcv.foreground = relief->pixel = pixel; | 3080 xgcv.foreground = relief->pixel = pixel; |
3060 } | 3081 } |
3061 | 3082 |
3062 if (relief->gc == 0) | 3083 if (relief->gc == 0) |
3063 { | 3084 { |
3064 xgcv.stipple = FRAME_X_DISPLAY_INFO (f)->gray; | 3085 xgcv.stipple = dpyinfo->gray; |
3065 mask |= GCStipple; | 3086 mask |= GCStipple; |
3066 relief->gc = XCreateGC (FRAME_X_DISPLAY (f), FRAME_X_WINDOW (f), | 3087 relief->gc = XCreateGC (dpy, FRAME_X_WINDOW (f), mask, &xgcv); |
3067 mask, &xgcv); | |
3068 } | 3088 } |
3069 else | 3089 else |
3070 XChangeGC (FRAME_X_DISPLAY (f), relief->gc, mask, &xgcv); | 3090 XChangeGC (dpy, relief->gc, mask, &xgcv); |
3071 } | 3091 } |
3072 | 3092 |
3073 | 3093 |
3074 /* Set up colors for the relief lines around glyph string S. */ | 3094 /* Set up colors for the relief lines around glyph string S. */ |
3075 | 3095 |