Mercurial > vim
comparison src/mbyte.c @ 11:4424b47a0797
updated for version 7.0003
author | vimboss |
---|---|
date | Wed, 30 Jun 2004 16:16:41 +0000 |
parents | 3fc0f57ecb91 |
children | 293621502c4d |
comparison
equal
deleted
inserted
replaced
10:4e2284e71352 | 11:4424b47a0797 |
---|---|
688 /* Fire an autocommand to let people do custom font setup. This must be | 688 /* Fire an autocommand to let people do custom font setup. This must be |
689 * after Vim has been setup for the new encoding. */ | 689 * after Vim has been setup for the new encoding. */ |
690 apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf); | 690 apply_autocmds(EVENT_ENCODINGCHANGED, NULL, (char_u *)"", FALSE, curbuf); |
691 #endif | 691 #endif |
692 | 692 |
693 #ifdef FEAT_GUI_KDE | |
694 if (gui.in_use) | |
695 gui_mch_update_codec(); | |
696 #endif | |
697 | |
693 return NULL; | 698 return NULL; |
694 } | 699 } |
695 | 700 |
696 /* | 701 /* |
697 * Return the size of the BOM for the current buffer: | 702 * Return the size of the BOM for the current buffer: |
3974 typedef int GdkEventKey; | 3979 typedef int GdkEventKey; |
3975 # define GdkIC int | 3980 # define GdkIC int |
3976 # endif | 3981 # endif |
3977 #endif | 3982 #endif |
3978 | 3983 |
3979 #if defined(FEAT_GUI_GTK) || defined(PROTO) | 3984 #if defined(FEAT_GUI_GTK) || defined(PROTO) || defined(FEAT_GUI_KDE) |
3980 static int preedit_buf_len = 0; | 3985 static int preedit_buf_len = 0; |
3981 static int xim_can_preediting INIT(= FALSE); /* XIM in showmode() */ | 3986 static int xim_can_preediting INIT(= FALSE); /* XIM in showmode() */ |
3982 static int xim_input_style; | 3987 static int xim_input_style; |
3983 #ifndef FEAT_GUI_GTK | 3988 #ifndef FEAT_GUI_GTK |
3984 # define gboolean int | 3989 # define gboolean int |
4110 return; | 4115 return; |
4111 | 4116 |
4112 /* If 'imdisable' is set, XIM is never active. */ | 4117 /* If 'imdisable' is set, XIM is never active. */ |
4113 if (p_imdisable) | 4118 if (p_imdisable) |
4114 active = FALSE; | 4119 active = FALSE; |
4115 #ifndef FEAT_GUI_GTK | 4120 #if !defined (FEAT_GUI_GTK) && !defined (FEAT_GUI_KDE) |
4116 else if (input_style & XIMPreeditPosition) | 4121 else if (input_style & XIMPreeditPosition) |
4117 /* There is a problem in switching XIM off when preediting is used, | 4122 /* There is a problem in switching XIM off when preediting is used, |
4118 * and it is not clear how this can be solved. For now, keep XIM on | 4123 * and it is not clear how this can be solved. For now, keep XIM on |
4119 * all the time, like it was done in Vim 5.8. */ | 4124 * all the time, like it was done in Vim 5.8. */ |
4120 active = TRUE; | 4125 active = TRUE; |
4384 | 4389 |
4385 if (attrmask != 0) | 4390 if (attrmask != 0) |
4386 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); | 4391 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); |
4387 } | 4392 } |
4388 #else /* FEAT_GUI_GTK */ | 4393 #else /* FEAT_GUI_GTK */ |
4394 # ifdef FEAT_GUI_KDE | |
4395 # else | |
4389 { | 4396 { |
4390 XVaNestedList attr_list; | 4397 XVaNestedList attr_list; |
4391 XRectangle spot_area; | 4398 XRectangle spot_area; |
4392 XPoint over_spot; | 4399 XPoint over_spot; |
4393 int line_space; | 4400 int line_space; |
4430 if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL)) | 4437 if (XSetICValues(xic, XNPreeditAttributes, attr_list, NULL)) |
4431 EMSG(_("E284: Cannot set IC values")); | 4438 EMSG(_("E284: Cannot set IC values")); |
4432 XFree(attr_list); | 4439 XFree(attr_list); |
4433 } | 4440 } |
4434 } | 4441 } |
4442 # endif /* FEAT_GUI_KDE */ | |
4435 #endif /* FEAT_GUI_GTK */ | 4443 #endif /* FEAT_GUI_GTK */ |
4436 } | 4444 } |
4437 | 4445 |
4438 /* | 4446 /* |
4439 * Set up the status area. | 4447 * Set up the status area. |
4483 if (attrmask != 0) | 4491 if (attrmask != 0) |
4484 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); | 4492 gdk_ic_set_attr(xic, attr, (GdkICAttributesType)attrmask); |
4485 } | 4493 } |
4486 # endif | 4494 # endif |
4487 #else | 4495 #else |
4496 # ifdef FEAT_GUI_KDE | |
4497 # else | |
4488 { | 4498 { |
4489 XVaNestedList preedit_list = 0, status_list = 0, list = 0; | 4499 XVaNestedList preedit_list = 0, status_list = 0, list = 0; |
4490 XRectangle pre_area, status_area; | 4500 XRectangle pre_area, status_area; |
4491 | 4501 |
4492 if (input_style & XIMStatusArea) | 4502 if (input_style & XIMStatusArea) |
4574 if (status_list) | 4584 if (status_list) |
4575 XFree(status_list); | 4585 XFree(status_list); |
4576 if (preedit_list) | 4586 if (preedit_list) |
4577 XFree(preedit_list); | 4587 XFree(preedit_list); |
4578 } | 4588 } |
4589 # endif /* FEAT_GUI_KDE */ | |
4579 #endif | 4590 #endif |
4580 } | 4591 } |
4581 | 4592 |
4582 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) | 4593 #if defined(FEAT_GUI_X11) || defined(FEAT_GUI_GTK) |
4583 static char e_xim[] = N_("E285: Failed to create input context"); | 4594 static char e_xim[] = N_("E285: Failed to create input context"); |
5348 xim_get_status_area_height() | 5359 xim_get_status_area_height() |
5349 { | 5360 { |
5350 #ifdef FEAT_GUI_GTK | 5361 #ifdef FEAT_GUI_GTK |
5351 if (xim_input_style & (int)GDK_IM_STATUS_AREA) | 5362 if (xim_input_style & (int)GDK_IM_STATUS_AREA) |
5352 return gui.char_height; | 5363 return gui.char_height; |
5364 #elif defined FEAT_GUI_KDE | |
5365 #warning FIXME | |
5353 #else | 5366 #else |
5354 if (status_area_enabled) | 5367 if (status_area_enabled) |
5355 return gui.char_height; | 5368 return gui.char_height; |
5356 #endif | 5369 #endif |
5357 return 0; | 5370 return 0; |