Mercurial > vim
comparison src/mbyte.c @ 574:25a70b1cd2da
updated for version 7.0163
author | vimboss |
---|---|
date | Tue, 06 Dec 2005 19:59:18 +0000 |
parents | da9142bd190a |
children | e93a99ef31d0 |
comparison
equal
deleted
inserted
replaced
573:c85bf6a4999b | 574:25a70b1cd2da |
---|---|
749 | 749 |
750 #ifdef FEAT_AUTOCMD | 750 #ifdef FEAT_AUTOCMD |
751 /* Fire an autocommand to let people do custom font setup. This must be | 751 /* Fire an autocommand to let people do custom font setup. This must be |
752 * after Vim has been setup for the new encoding. */ | 752 * after Vim has been setup for the new encoding. */ |
753 apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf); | 753 apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf); |
754 #endif | |
755 | |
756 #ifdef FEAT_GUI_KDE | |
757 if (gui.in_use) | |
758 gui_mch_update_codec(); | |
759 #endif | 754 #endif |
760 | 755 |
761 #ifdef FEAT_SYN_HL | 756 #ifdef FEAT_SYN_HL |
762 /* Need to reload spell dictionaries */ | 757 /* Need to reload spell dictionaries */ |
763 spell_reload(); | 758 spell_reload(); |
4179 typedef int GdkEventKey; | 4174 typedef int GdkEventKey; |
4180 # define GdkIC int | 4175 # define GdkIC int |
4181 # endif | 4176 # endif |
4182 #endif | 4177 #endif |
4183 | 4178 |
4184 #if defined(FEAT_GUI_GTK) || defined(PROTO) || defined(FEAT_GUI_KDE) | 4179 #if defined(FEAT_GUI_GTK) || defined(PROTO) |
4185 static int preedit_buf_len = 0; | 4180 static int preedit_buf_len = 0; |
4186 static int xim_can_preediting INIT(= FALSE); /* XIM in showmode() */ | 4181 static int xim_can_preediting INIT(= FALSE); /* XIM in showmode() */ |
4187 static int xim_input_style; | 4182 static int xim_input_style; |
4188 #ifndef FEAT_GUI_GTK | 4183 #ifndef FEAT_GUI_GTK |
4189 # define gboolean int | 4184 # define gboolean int |
4315 return; | 4310 return; |
4316 | 4311 |
4317 /* If 'imdisable' is set, XIM is never active. */ | 4312 /* If 'imdisable' is set, XIM is never active. */ |
4318 if (p_imdisable) | 4313 if (p_imdisable) |
4319 active = FALSE; | 4314 active = FALSE; |
4320 #if !defined (FEAT_GUI_GTK) && !defined (FEAT_GUI_KDE) | 4315 #if !defined (FEAT_GUI_GTK) |
4321 else if (input_style & XIMPreeditPosition) | 4316 else if (input_style & XIMPreeditPosition) |
4322 /* There is a problem in switching XIM off when preediting is used, | 4317 /* There is a problem in switching XIM off when preediting is used, |
4323 * and it is not clear how this can be solved. For now, keep XIM on | 4318 * and it is not clear how this can be solved. For now, keep XIM on |
4324 * all the time, like it was done in Vim 5.8. */ | 4319 * all the time, like it was done in Vim 5.8. */ |
4325 active = TRUE; | 4320 active = TRUE; |
4487 #endif | 4482 #endif |
4488 } | 4483 } |
4489 } | 4484 } |
4490 } | 4485 } |
4491 | 4486 |
4492 #ifndef FEAT_GUI_KDE | |
4493 /*ARGSUSED*/ | 4487 /*ARGSUSED*/ |
4494 void | 4488 void |
4495 im_set_position(row, col) | 4489 im_set_position(row, col) |
4496 int row; | 4490 int row; |
4497 int col; | 4491 int col; |
4498 { | 4492 { |
4499 xim_set_preedit(); | 4493 xim_set_preedit(); |
4500 } | 4494 } |
4501 #endif | |
4502 | 4495 |
4503 /* | 4496 /* |
4504 * Set the XIM to the current cursor position. | 4497 * Set the XIM to the current cursor position. |
4505 */ | 4498 */ |
4506 void | 4499 void |
4591 | 4584 |
4592 if (attrmask != 0) | 4585 if (attrmask != 0) |
4593 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); | 4586 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); |
4594 } | 4587 } |
4595 #else /* FEAT_GUI_GTK */ | 4588 #else /* FEAT_GUI_GTK */ |
4596 # ifdef FEAT_GUI_KDE | |
4597 # else | |
4598 { | 4589 { |
4599 XVaNestedList attr_list; | 4590 XVaNestedList attr_list; |
4600 XRectangle spot_area; | 4591 XRectangle spot_area; |
4601 XPoint over_spot; | 4592 XPoint over_spot; |
4602 int line_space; | 4593 int line_space; |
4639 if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL)) | 4630 if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL)) |
4640 EMSG(_("E284: Cannot set IC values")); | 4631 EMSG(_("E284: Cannot set IC values")); |
4641 XFree(attr_list); | 4632 XFree(attr_list); |
4642 } | 4633 } |
4643 } | 4634 } |
4644 # endif /* FEAT_GUI_KDE */ | |
4645 #endif /* FEAT_GUI_GTK */ | 4635 #endif /* FEAT_GUI_GTK */ |
4646 } | 4636 } |
4647 | 4637 |
4648 /* | 4638 /* |
4649 * Set up the status area. | 4639 * Set up the status area. |
4693 if (attrmask != 0) | 4683 if (attrmask != 0) |
4694 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); | 4684 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); |
4695 } | 4685 } |
4696 # endif | 4686 # endif |
4697 #else | 4687 #else |
4698 # ifdef FEAT_GUI_KDE | |
4699 # else | |
4700 { | 4688 { |
4701 XVaNestedList preedit_list = 0, status_list = 0, list = 0; | 4689 XVaNestedList preedit_list = 0, status_list = 0, list = 0; |
4702 XRectangle pre_area, status_area; | 4690 XRectangle pre_area, status_area; |
4703 | 4691 |
4704 if (input_style & XIMStatusArea) | 4692 if (input_style & XIMStatusArea) |
4786 if (status_list) | 4774 if (status_list) |
4787 XFree(status_list); | 4775 XFree(status_list); |
4788 if (preedit_list) | 4776 if (preedit_list) |
4789 XFree(preedit_list); | 4777 XFree(preedit_list); |
4790 } | 4778 } |
4791 # endif /* FEAT_GUI_KDE */ | 4779 #endif |
4792 #endif | 4780 } |
4793 } | 4781 |
4794 | 4782 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) |
4795 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) || defined(FEAT_GUI_KDE) | |
4796 static char e_xim[] = N_("E285: Failed to create input context"); | 4783 static char e_xim[] = N_("E285: Failed to create input context"); |
4797 #endif | 4784 #endif |
4798 | 4785 |
4799 #if defined(FEAT_GUI_X11) || defined(PROTO) | 4786 #if defined(FEAT_GUI_X11) || defined(PROTO) |
4800 # if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(sun) | 4787 # if defined(XtSpecificationRelease) && XtSpecificationRelease >= 6 && !defined(sun) |
5574 { | 5561 { |
5575 #ifdef FEAT_GUI_GTK | 5562 #ifdef FEAT_GUI_GTK |
5576 if (xim_input_style & (int)GDK_IM_STATUS_AREA) | 5563 if (xim_input_style & (int)GDK_IM_STATUS_AREA) |
5577 return gui.char_height; | 5564 return gui.char_height; |
5578 #else | 5565 #else |
5579 # if defined FEAT_GUI_KDE | |
5580 /* always return zero? */ | |
5581 # else | |
5582 if (status_area_enabled) | 5566 if (status_area_enabled) |
5583 return gui.char_height; | 5567 return gui.char_height; |
5584 # endif | |
5585 #endif | 5568 #endif |
5586 return 0; | 5569 return 0; |
5587 } | 5570 } |
5588 | 5571 |
5589 /* | 5572 /* |
5596 im_get_status() | 5579 im_get_status() |
5597 { | 5580 { |
5598 # ifdef FEAT_GUI_GTK | 5581 # ifdef FEAT_GUI_GTK |
5599 if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS) | 5582 if (xim_input_style & (int)GDK_IM_PREEDIT_CALLBACKS) |
5600 return xim_can_preediting; | 5583 return xim_can_preediting; |
5601 # endif | |
5602 # ifdef FEAT_GUI_KDE | |
5603 if (preedit_start_col != MAXCOL) | |
5604 return TRUE; | |
5605 # endif | 5584 # endif |
5606 return xim_has_focus; | 5585 return xim_has_focus; |
5607 } | 5586 } |
5608 | 5587 |
5609 # endif /* !HAVE_GTK2 */ | 5588 # endif /* !HAVE_GTK2 */ |