10120 |
} |
} |
10121 |
#endif |
#endif |
10122 |
|
|
10123 |
|
/* Count number of set bits in mask and number of bits to shift to |
10124 |
|
get to the first bit. With MASK 0x7e0, *BITS is set to 6, and *OFFSET |
10125 |
|
to 5. */ |
10126 |
|
static void |
10127 |
|
get_bits_and_offset (mask, bits, offset) |
10128 |
|
unsigned long mask; |
10129 |
|
int *bits; |
10130 |
|
int *offset; |
10131 |
|
{ |
10132 |
|
int nr = 0; |
10133 |
|
int off = 0; |
10134 |
|
|
10135 |
|
while (!(mask & 1)) |
10136 |
|
{ |
10137 |
|
off++; |
10138 |
|
mask >>= 1; |
10139 |
|
} |
10140 |
|
|
10141 |
|
while (mask & 1) |
10142 |
|
{ |
10143 |
|
nr++; |
10144 |
|
mask >>= 1; |
10145 |
|
} |
10146 |
|
|
10147 |
|
*offset = off; |
10148 |
|
*bits = nr; |
10149 |
|
} |
10150 |
|
|
10151 |
struct x_display_info * |
struct x_display_info * |
10152 |
x_term_init (display_name, xrm_option, resource_name) |
x_term_init (display_name, xrm_option, resource_name) |
10153 |
Lisp_Object display_name; |
Lisp_Object display_name; |
10395 |
dpyinfo->x_highlight_frame = 0; |
dpyinfo->x_highlight_frame = 0; |
10396 |
dpyinfo->image_cache = make_image_cache (); |
dpyinfo->image_cache = make_image_cache (); |
10397 |
|
|
10398 |
|
/* See if we can construct pixel values from RGB values. */ |
10399 |
|
dpyinfo->red_bits = dpyinfo->blue_bits = dpyinfo->green_bits = 0; |
10400 |
|
dpyinfo->red_offset = dpyinfo->blue_offset = dpyinfo->green_offset = 0; |
10401 |
|
|
10402 |
|
if (dpyinfo->visual->class == TrueColor) |
10403 |
|
{ |
10404 |
|
get_bits_and_offset (dpyinfo->visual->red_mask, |
10405 |
|
&dpyinfo->red_bits, &dpyinfo->red_offset); |
10406 |
|
get_bits_and_offset (dpyinfo->visual->blue_mask, |
10407 |
|
&dpyinfo->blue_bits, &dpyinfo->blue_offset); |
10408 |
|
get_bits_and_offset (dpyinfo->visual->green_mask, |
10409 |
|
&dpyinfo->green_bits, &dpyinfo->green_offset); |
10410 |
|
} |
10411 |
|
|
10412 |
/* See if a private colormap is requested. */ |
/* See if a private colormap is requested. */ |
10413 |
if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) |
if (dpyinfo->visual == DefaultVisualOfScreen (dpyinfo->screen)) |
10414 |
{ |
{ |