aboutsummaryrefslogtreecommitdiffstats
path: root/src/xterm.c
diff options
context:
space:
mode:
authorKenichi Handa2012-08-16 21:25:17 +0900
committerKenichi Handa2012-08-16 21:25:17 +0900
commitd75ffb4ed0b2e72a9361a07d16a5c884a9459728 (patch)
tree8ac5a6a8ae033fef7fbc7fb7b09a703ef4b0ed5b /src/xterm.c
parent69c41c4070c86baac11a627e9c3d366420aeb7cc (diff)
parent250c8ab9b8f6322959fa3122db83944c30c3894b (diff)
downloademacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.tar.gz
emacs-d75ffb4ed0b2e72a9361a07d16a5c884a9459728.zip
merge trunk
Diffstat (limited to 'src/xterm.c')
-rw-r--r--src/xterm.c60
1 files changed, 30 insertions, 30 deletions
diff --git a/src/xterm.c b/src/xterm.c
index b5c5ce33d6c..1b746f87d53 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -520,7 +520,7 @@ x_set_frame_alpha (struct frame *f)
520 if (rc == Success && actual != None) 520 if (rc == Success && actual != None)
521 { 521 {
522 unsigned long value = *(unsigned long *)data; 522 unsigned long value = *(unsigned long *)data;
523 XFree ((void *) data); 523 XFree (data);
524 if (value == opac) 524 if (value == opac)
525 { 525 {
526 x_uncatch_errors (); 526 x_uncatch_errors ();
@@ -1438,12 +1438,12 @@ x_draw_glyphless_glyph_string_foreground (struct glyph_string *s)
1438 1438
1439#ifdef USE_X_TOOLKIT 1439#ifdef USE_X_TOOLKIT
1440 1440
1441static struct frame *x_frame_of_widget (Widget);
1442static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *, 1441static Boolean cvt_string_to_pixel (Display *, XrmValue *, Cardinal *,
1443 XrmValue *, XrmValue *, XtPointer *); 1442 XrmValue *, XrmValue *, XtPointer *);
1444static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer, 1443static void cvt_pixel_dtor (XtAppContext, XrmValue *, XtPointer,
1445 XrmValue *, Cardinal *); 1444 XrmValue *, Cardinal *);
1446 1445
1446#ifdef USE_LUCID
1447 1447
1448/* Return the frame on which widget WIDGET is used.. Abort if frame 1448/* Return the frame on which widget WIDGET is used.. Abort if frame
1449 cannot be determined. */ 1449 cannot be determined. */
@@ -1478,9 +1478,6 @@ x_frame_of_widget (Widget widget)
1478 abort (); 1478 abort ();
1479} 1479}
1480 1480
1481
1482#ifdef USE_LUCID
1483
1484/* Allocate a color which is lighter or darker than *PIXEL by FACTOR 1481/* Allocate a color which is lighter or darker than *PIXEL by FACTOR
1485 or DELTA. Try a color with RGB values multiplied by FACTOR first. 1482 or DELTA. Try a color with RGB values multiplied by FACTOR first.
1486 If this produces the same color as PIXEL, try a color where all RGB 1483 If this produces the same color as PIXEL, try a color where all RGB
@@ -1496,7 +1493,7 @@ x_alloc_lighter_color_for_widget (Widget widget, Display *display, Colormap cmap
1496 return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta); 1493 return x_alloc_lighter_color (f, display, cmap, pixel, factor, delta);
1497} 1494}
1498 1495
1499#endif 1496#endif /* USE_LUCID */
1500 1497
1501 1498
1502/* Structure specifying which arguments should be passed by Xt to 1499/* Structure specifying which arguments should be passed by Xt to
@@ -3588,7 +3585,7 @@ x_frame_rehighlight (struct x_display_info *dpyinfo)
3588 : dpyinfo->x_focus_frame); 3585 : dpyinfo->x_focus_frame);
3589 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame)) 3586 if (! FRAME_LIVE_P (dpyinfo->x_highlight_frame))
3590 { 3587 {
3591 FRAME_FOCUS_FRAME (dpyinfo->x_focus_frame) = Qnil; 3588 FSET (dpyinfo->x_focus_frame, focus_frame, Qnil);
3592 dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame; 3589 dpyinfo->x_highlight_frame = dpyinfo->x_focus_frame;
3593 } 3590 }
3594 } 3591 }
@@ -3713,7 +3710,7 @@ x_find_modifier_meanings (struct x_display_info *dpyinfo)
3713 dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask; 3710 dpyinfo->alt_mod_mask &= ~dpyinfo->meta_mod_mask;
3714 } 3711 }
3715 3712
3716 XFree ((char *) syms); 3713 XFree (syms);
3717 XFreeModifiermap (mods); 3714 XFreeModifiermap (mods);
3718} 3715}
3719 3716
@@ -4635,7 +4632,7 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
4635 Widget widget; 4632 Widget widget;
4636 Arg av[20]; 4633 Arg av[20];
4637 int ac = 0; 4634 int ac = 0;
4638 char const *scroll_bar_name = SCROLL_BAR_NAME; 4635 const char *scroll_bar_name = SCROLL_BAR_NAME;
4639 unsigned long pixel; 4636 unsigned long pixel;
4640 4637
4641 BLOCK_INPUT; 4638 BLOCK_INPUT;
@@ -4665,7 +4662,7 @@ x_create_toolkit_scroll_bar (struct frame *f, struct scroll_bar *bar)
4665 } 4662 }
4666 4663
4667 widget = XmCreateScrollBar (f->output_data.x->edit_widget, 4664 widget = XmCreateScrollBar (f->output_data.x->edit_widget,
4668 scroll_bar_name, av, ac); 4665 (char *) scroll_bar_name, av, ac);
4669 4666
4670 /* Add one callback for everything that can happen. */ 4667 /* Add one callback for everything that can happen. */
4671 XtAddCallback (widget, XmNdecrementCallback, xm_scroll_callback, 4668 XtAddCallback (widget, XmNdecrementCallback, xm_scroll_callback,
@@ -4960,6 +4957,7 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
4960 struct frame *f = XFRAME (w->frame); 4957 struct frame *f = XFRAME (w->frame);
4961 struct scroll_bar *bar 4958 struct scroll_bar *bar
4962 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER); 4959 = ALLOCATE_PSEUDOVECTOR (struct scroll_bar, x_window, PVEC_OTHER);
4960 Lisp_Object barobj;
4963 4961
4964 BLOCK_INPUT; 4962 BLOCK_INPUT;
4965 4963
@@ -5020,7 +5018,8 @@ x_scroll_bar_create (struct window *w, int top, int left, int width, int height)
5020 /* Add bar to its frame's list of scroll bars. */ 5018 /* Add bar to its frame's list of scroll bars. */
5021 bar->next = FRAME_SCROLL_BARS (f); 5019 bar->next = FRAME_SCROLL_BARS (f);
5022 bar->prev = Qnil; 5020 bar->prev = Qnil;
5023 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); 5021 XSETVECTOR (barobj, bar);
5022 FSET (f, scroll_bars, barobj);
5024 if (!NILP (bar->next)) 5023 if (!NILP (bar->next))
5025 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); 5024 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
5026 5025
@@ -5183,7 +5182,7 @@ x_scroll_bar_remove (struct scroll_bar *bar)
5183#endif 5182#endif
5184 5183
5185 /* Dissociate this scroll bar from its window. */ 5184 /* Dissociate this scroll bar from its window. */
5186 XWINDOW (bar->window)->vertical_scroll_bar = Qnil; 5185 WSET (XWINDOW (bar->window), vertical_scroll_bar, Qnil);
5187 5186
5188 UNBLOCK_INPUT; 5187 UNBLOCK_INPUT;
5189} 5188}
@@ -5198,6 +5197,7 @@ static void
5198XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position) 5197XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int position)
5199{ 5198{
5200 struct frame *f = XFRAME (w->frame); 5199 struct frame *f = XFRAME (w->frame);
5200 Lisp_Object barobj;
5201 struct scroll_bar *bar; 5201 struct scroll_bar *bar;
5202 int top, height, left, sb_left, width, sb_width; 5202 int top, height, left, sb_left, width, sb_width;
5203 int window_y, window_height; 5203 int window_y, window_height;
@@ -5395,7 +5395,8 @@ XTset_vertical_scroll_bar (struct window *w, int portion, int whole, int positio
5395 } 5395 }
5396#endif /* not USE_TOOLKIT_SCROLL_BARS */ 5396#endif /* not USE_TOOLKIT_SCROLL_BARS */
5397 5397
5398 XSETVECTOR (w->vertical_scroll_bar, bar); 5398 XSETVECTOR (barobj, bar);
5399 WSET (w, vertical_scroll_bar, barobj);
5399} 5400}
5400 5401
5401 5402
@@ -5419,12 +5420,12 @@ XTcondemn_scroll_bars (FRAME_PTR frame)
5419 { 5420 {
5420 Lisp_Object bar; 5421 Lisp_Object bar;
5421 bar = FRAME_SCROLL_BARS (frame); 5422 bar = FRAME_SCROLL_BARS (frame);
5422 FRAME_SCROLL_BARS (frame) = XSCROLL_BAR (bar)->next; 5423 FSET (frame, scroll_bars, XSCROLL_BAR (bar)->next);
5423 XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame); 5424 XSCROLL_BAR (bar)->next = FRAME_CONDEMNED_SCROLL_BARS (frame);
5424 XSCROLL_BAR (bar)->prev = Qnil; 5425 XSCROLL_BAR (bar)->prev = Qnil;
5425 if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame))) 5426 if (! NILP (FRAME_CONDEMNED_SCROLL_BARS (frame)))
5426 XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar; 5427 XSCROLL_BAR (FRAME_CONDEMNED_SCROLL_BARS (frame))->prev = bar;
5427 FRAME_CONDEMNED_SCROLL_BARS (frame) = bar; 5428 FSET (frame, condemned_scroll_bars, bar);
5428 } 5429 }
5429} 5430}
5430 5431
@@ -5437,6 +5438,7 @@ XTredeem_scroll_bar (struct window *window)
5437{ 5438{
5438 struct scroll_bar *bar; 5439 struct scroll_bar *bar;
5439 struct frame *f; 5440 struct frame *f;
5441 Lisp_Object barobj;
5440 5442
5441 /* We can't redeem this window's scroll bar if it doesn't have one. */ 5443 /* We can't redeem this window's scroll bar if it doesn't have one. */
5442 if (NILP (window->vertical_scroll_bar)) 5444 if (NILP (window->vertical_scroll_bar))
@@ -5455,7 +5457,7 @@ XTredeem_scroll_bar (struct window *window)
5455 return; 5457 return;
5456 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f), 5458 else if (EQ (FRAME_CONDEMNED_SCROLL_BARS (f),
5457 window->vertical_scroll_bar)) 5459 window->vertical_scroll_bar))
5458 FRAME_CONDEMNED_SCROLL_BARS (f) = bar->next; 5460 FSET (f, condemned_scroll_bars, bar->next);
5459 else 5461 else
5460 /* If its prev pointer is nil, it must be at the front of 5462 /* If its prev pointer is nil, it must be at the front of
5461 one or the other! */ 5463 one or the other! */
@@ -5469,7 +5471,8 @@ XTredeem_scroll_bar (struct window *window)
5469 5471
5470 bar->next = FRAME_SCROLL_BARS (f); 5472 bar->next = FRAME_SCROLL_BARS (f);
5471 bar->prev = Qnil; 5473 bar->prev = Qnil;
5472 XSETVECTOR (FRAME_SCROLL_BARS (f), bar); 5474 XSETVECTOR (barobj, bar);
5475 FSET (f, scroll_bars, barobj);
5473 if (! NILP (bar->next)) 5476 if (! NILP (bar->next))
5474 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar); 5477 XSETVECTOR (XSCROLL_BAR (bar->next)->prev, bar);
5475} 5478}
@@ -5486,7 +5489,7 @@ XTjudge_scroll_bars (FRAME_PTR f)
5486 5489
5487 /* Clear out the condemned list now so we won't try to process any 5490 /* Clear out the condemned list now so we won't try to process any
5488 more events on the hapless scroll bars. */ 5491 more events on the hapless scroll bars. */
5489 FRAME_CONDEMNED_SCROLL_BARS (f) = Qnil; 5492 FSET (f, condemned_scroll_bars, Qnil);
5490 5493
5491 for (; ! NILP (bar); bar = next) 5494 for (; ! NILP (bar); bar = next)
5492 { 5495 {
@@ -7832,7 +7835,7 @@ x_connection_closed (Display *dpy, const char *error_message)
7832 { 7835 {
7833 /* Set this to t so that delete_frame won't get confused 7836 /* Set this to t so that delete_frame won't get confused
7834 trying to find a replacement. */ 7837 trying to find a replacement. */
7835 KVAR (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame) = Qt; 7838 KSET (FRAME_KBOARD (XFRAME (frame)), Vdefault_minibuffer_frame, Qt);
7836 delete_frame (frame, Qnoelisp); 7839 delete_frame (frame, Qnoelisp);
7837 } 7840 }
7838 7841
@@ -10112,7 +10115,7 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10112 { 10115 {
10113 terminal->kboard = xmalloc (sizeof *terminal->kboard); 10116 terminal->kboard = xmalloc (sizeof *terminal->kboard);
10114 init_kboard (terminal->kboard); 10117 init_kboard (terminal->kboard);
10115 KVAR (terminal->kboard, Vwindow_system) = Qx; 10118 KSET (terminal->kboard, Vwindow_system, Qx);
10116 10119
10117 /* Add the keyboard to the list before running Lisp code (via 10120 /* Add the keyboard to the list before running Lisp code (via
10118 Qvendor_specific_keysyms below), since these are not traced 10121 Qvendor_specific_keysyms below), since these are not traced
@@ -10134,9 +10137,9 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10134 /* Temporarily hide the partially initialized terminal. */ 10137 /* Temporarily hide the partially initialized terminal. */
10135 terminal_list = terminal->next_terminal; 10138 terminal_list = terminal->next_terminal;
10136 UNBLOCK_INPUT; 10139 UNBLOCK_INPUT;
10137 KVAR (terminal->kboard, Vsystem_key_alist) 10140 KSET (terminal->kboard, Vsystem_key_alist,
10138 = call1 (Qvendor_specific_keysyms, 10141 call1 (Qvendor_specific_keysyms,
10139 vendor ? build_string (vendor) : empty_unibyte_string); 10142 vendor ? build_string (vendor) : empty_unibyte_string));
10140 BLOCK_INPUT; 10143 BLOCK_INPUT;
10141 terminal->next_terminal = terminal_list; 10144 terminal->next_terminal = terminal_list;
10142 terminal_list = terminal; 10145 terminal_list = terminal;
@@ -10402,13 +10405,10 @@ x_term_init (Lisp_Object display_name, char *xrm_option, char *resource_name)
10402 10405
10403 connection = ConnectionNumber (dpyinfo->display); 10406 connection = ConnectionNumber (dpyinfo->display);
10404 dpyinfo->connection = connection; 10407 dpyinfo->connection = connection;
10405 10408 dpyinfo->gray
10406 { 10409 = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window,
10407 dpyinfo->gray 10410 gray_bits, gray_width, gray_height,
10408 = XCreatePixmapFromBitmapData (dpyinfo->display, dpyinfo->root_window, 10411 1, 0, 1);
10409 gray_bits, gray_width, gray_height,
10410 1, 0, 1);
10411 }
10412 10412
10413#ifdef HAVE_X_I18N 10413#ifdef HAVE_X_I18N
10414 xim_initialize (dpyinfo, resource_name); 10414 xim_initialize (dpyinfo, resource_name);