Lines Matching defs:ve

99     XawVendorShellExtPart* /* ve */ 
106 XawVendorShellExtPart* /* ve */
162 contextData->ve = (Widget)vew;
179 vew = (XawVendorShellExtWidget)contextData->ve;
183 static Boolean IsSharedIC( ve )
184 XawVendorShellExtPart * ve;
186 return( ve->ic.shared_ic );
189 static XawIcTableList GetIcTableShared( w, ve )
191 XawVendorShellExtPart * ve;
195 for (p = ve->ic.ic_table; p; p = p->next) {
197 if (IsSharedIC(ve)) {
198 return(ve->ic.shared_ic_table);
207 static XawIcTableList GetIcTable( w, ve )
209 XawVendorShellExtPart * ve;
213 for (p = ve->ic.ic_table; p; p = p->next) {
221 static XIMStyle GetInputStyleOfIC( ve )
222 XawVendorShellExtPart * ve;
225 if (!ve) return((XIMStyle)0);
226 return(ve->ic.input_style);
251 XawVendorShellExtPart *ve;
261 if (ve = GetExtPart(vw)) {
262 if (IsSharedIC(ve)) return;
263 if ((ve->im.xim == NULL) ||
264 ((p = GetIcTableShared(w, ve)) == NULL) ||
314 static void CloseIM( ve )
315 XawVendorShellExtPart * ve;
317 if (ve->im.xim)
318 XCloseIM(ve->im.xim);
321 static Dimension SetVendorShellHeight( ve, height )
322 XawVendorShellExtPart* ve;
328 if (ve->im.area_height < height || height == 0) {
330 (ve->parent->core.height + height - ve->im.area_height));
331 ve->im.area_height = height;
332 XtSetValues(ve->parent, args, 1);
334 return(ve->im.area_height);
337 static void DestroyAllIM( ve )
338 XawVendorShellExtPart * ve;
346 if (IsSharedIC(ve)) {
347 if ((p = ve->ic.shared_ic_table) && p->xic) {
348 DestroyIC(p->widget, ve);
353 for (p = ve->ic.ic_table; p; p = p->next) {
355 DestroyIC(p->widget, ve);
360 if (!ve->im.xim) return;
364 CloseIM(ve);
365 if (!XFindContext(XDisplayOfIM(ve->im.xim), (Window)ve->im.xim, errContext,
369 XDeleteContext(XDisplayOfIM(ve->im.xim), (Window)ve->im.xim, errContext);
370 ve->im.xim = NULL;
375 (void) SetVendorShellHeight(ve, 0);
382 static void FreeAllDataOfVendorShell(ve, vw)
383 XawVendorShellExtPart * ve;
394 if (ve->im.im_list) {
395 XtFree((char *)ve->im.im_list[0]);
396 XtFree((char *)ve->im.im_list);
398 if (ve->ic.ic_list) {
399 XtFree((char *)ve->ic.ic_list[0]);
400 XtFree((char *)ve->ic.ic_list);
402 if (ve->ic.shared_ic_table)
403 XtFree((char *)ve->ic.shared_ic_table);
404 if (ve->im.resources) XtFree((char *)ve->im.resources);
405 for (p = ve->ic.ic_table; p; p = next) {
407 XtFree((char *)ve->ic.ic_table);
415 XawVendorShellExtPart *ve;
417 if ( ( ve = GetExtPart( (VendorShellWidget) w ) ) == NULL ) return;
418 DestroyAllIM( ve );
419 FreeAllDataOfVendorShell( ve, (VendorShellWidget) w );
427 XawVendorShellExtPart * ve;
430 || (ve = GetExtPart(vw)) == NULL) return(0);
432 DestroyAllIM(ve);
440 static void OpenIM(ve)
441 XawVendorShellExtPart * ve;
449 if (ve->im.open_im == False) return;
450 ve->im.xim = NULL;
452 if ((int)ve->im.im_list_num <= 0) {
454 xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);
456 for (i = 0; i < (int)ve->im.im_list_num; i++) {
458 strcat(modifiers, ve->im.im_list[i]);
460 (xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL)) != NULL)
466 xim = XOpenIM(XtDisplay(ve->parent), NULL, NULL, NULL);
470 XtAppWarning(XtWidgetToApplicationContext(ve->parent),
476 XtAppWarning(XtWidgetToApplicationContext(ve->parent),
481 for (j = 0; j < (int)ve->ic.ic_list_num; j++) {
482 input_style = GetInputStyleOfIM(ve->ic.ic_list[j]);
486 ve->ic.input_style = input_style;
487 SetErrCnxt(ve->parent, xim);
489 ve->im.xim = xim;
496 XtAppWarning(XtWidgetToApplicationContext(ve->parent),
501 static Boolean ResizeVendorShell_Core(vw, ve, p)
503 XawVendorShellExtPart * ve;
519 st_area.y = vw->core.height - ve->im.area_height;
538 pe_area.y = vw->core.height - ve->im.area_height;
552 static void ResizeVendorShell(vw, ve)
554 XawVendorShellExtPart * ve;
558 if (IsSharedIC(ve)) {
559 p = ve->ic.shared_ic_table;
561 ResizeVendorShell_Core(vw, ve, p);
564 for (p = ve->ic.ic_table; p; p = p->next) {
566 if (ResizeVendorShell_Core(vw, ve, p) == FALSE) return;
570 static XawIcTableList CreateIcTable( w, ve )
572 XawVendorShellExtPart * ve;
591 static Boolean RegisterToVendorShell( w, ve )
593 XawVendorShellExtPart * ve;
597 if ((table = CreateIcTable(w, ve)) == NULL) return(FALSE);
598 table->next = ve->ic.ic_table;
599 ve->ic.ic_table = table;
603 static void UnregisterFromVendorShell(w, ve)
605 XawVendorShellExtPart * ve;
609 for (prev = &ve->ic.ic_table; p = *prev; prev = &p->next) {
619 static void SetICValuesShared(w, ve, p, check)
621 XawVendorShellExtPart * ve;
627 if ((pp = GetIcTable(w, ve)) == NULL) return;
628 if (check == TRUE && CurrentSharedIcTable(ve) != pp) return;
656 static Boolean IsCreatedIC(w, ve)
658 XawVendorShellExtPart * ve;
662 if (ve->im.xim == NULL) return(FALSE);
663 if ((p = GetIcTableShared(w, ve)) == NULL) return(FALSE);
741 static void CreateIC( w, ve )
743 XawVendorShellExtPart* ve;
755 if (((ve->im.xim == NULL) || (p = GetIcTableShared(w, ve)) == NULL) ||
758 p->input_style = GetInputStyleOfIC(ve);
760 if (IsSharedIC(ve)) SetICValuesShared(w, ve, p, FALSE);
771 height = SetVendorShellHeight(ve, height);
800 pe_area.y = ve->parent->core.height - height;
801 pe_area.width = ve->parent->core.width;
828 st_area.y = ve->parent->core.height - height;
829 st_area.width = ve->parent->core.width;
838 SetVaArg( &ic_a[ic_cnt], (XPointer) XtWindow(ve->parent)); ic_cnt++;
865 p->xic = XCreateIC(ve->im.xim, ic_a[0], ic_a[1], ic_a[2], ic_a[3],
877 SizeNegotiation(p, ve->parent->core.width, ve->parent->core.height);
881 if (!IsSharedIC(ve)) {
889 static void SetICValues( w, ve, focus )
891 XawVendorShellExtPart *ve;
903 if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
906 if (IsSharedIC(ve)) SetICValuesShared(w, ve, p, TRUE);
913 && ((!IsSharedIC(ve) && ((p->flg & ~CIICFocus) == CICursorP))
914 || (IsSharedIC(ve) && p->flg == CICursorP))) {
930 height = SetVendorShellHeight(ve, height);
964 if (IsSharedIC(ve)) {
1014 if (IsSharedIC(ve) && p->flg & CIFontSet)
1015 SizeNegotiation(p, ve->parent->core.width, ve->parent->core.height);
1020 static void SharedICChangeFocusWindow(w, ve, p)
1022 XawVendorShellExtPart *ve;
1028 ve->ic.current_ic_table = NULL;
1031 if ((pp = GetIcTable(w, ve)) == NULL) return;
1032 ve->ic.current_ic_table = pp;
1033 SetICValues(w, ve, TRUE);
1036 static XawIcTableList CurrentSharedIcTable( ve )
1037 XawVendorShellExtPart * ve;
1039 return(ve->ic.current_ic_table);
1042 static void SetICFocus(w, ve)
1044 XawVendorShellExtPart * ve;
1048 if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
1051 if (IsSharedIC(ve)) {
1052 pp = CurrentSharedIcTable(ve);
1054 SharedICChangeFocusWindow(w, ve, p);
1064 static void UnsetICFocus(w, ve)
1066 XawVendorShellExtPart * ve;
1070 if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
1073 if (IsSharedIC(ve) && (pp = CurrentSharedIcTable(ve))) {
1077 SharedICChangeFocusWindow(NULL, ve, p);
1085 static void SetValues( w, ve, args, num_args )
1087 XawVendorShellExtPart * ve;
1099 if ((p = GetIcTable(w, ve)) == NULL) return;
1105 for (xrmres = (XrmResourceList)ve->im.resources, i = 0;
1106 i < (int)ve->im.num_resources; i++, xrmres++) {
1136 static void SetFocus( w, ve )
1138 XawVendorShellExtPart *ve;
1141 if ((p = GetIcTableShared(w, ve)) == NULL) return;
1143 if ( p->ic_focused == FALSE || IsSharedIC(ve)) {
1149 static void DestroyIC(w, ve)
1151 XawVendorShellExtPart *ve;
1155 if ((ve->im.xim == NULL) || ((p = GetIcTableShared(w, ve)) == NULL) ||
1157 if (IsSharedIC(ve)) {
1158 if (GetIcTable(w, ve) == ve->ic.current_ic_table) {
1159 UnsetICFocus(w, ve);
1164 if (!IsSharedIC(ve)) {
1178 XawVendorShellExtPart *ve;
1182 if (ve = GetExtPart(vw)) {
1183 if (num_args > 0) SetValues(inwidg, ve, args, num_args);
1184 if (focus) SetFocus(inwidg, ve);
1185 if (XtIsRealized((Widget)vw) && ve->im.xim) {
1186 if (IsCreatedIC(inwidg, ve)) {
1187 SetICValues(inwidg, ve, FALSE);
1188 if (focus) SetICFocus(inwidg, ve);
1190 CreateIC(inwidg, ve);
1191 SetICFocus(inwidg, ve);
1200 XawVendorShellExtPart *ve;
1205 if (ve = GetExtPart(vw)) {
1206 if ((p = GetIcTableShared(inwidg, ve)) == NULL) return;
1211 if (ve->im.xim && XtIsRealized((Widget)vw) && p->xic) {
1212 UnsetICFocus(inwidg, ve);
1217 static Boolean IsRegistered( w, ve )
1219 XawVendorShellExtPart* ve;
1223 for (p = ve->ic.ic_table; p; p = p->next)
1230 static void Register(inwidg, ve)
1232 XawVendorShellExtPart* ve;
1234 if (ve->im.xim == NULL)
1236 OpenIM(ve);
1239 if (IsRegistered(inwidg, ve)) return;
1241 if (RegisterToVendorShell(inwidg, ve) == FALSE) return;
1243 if (ve->im.xim == NULL) return;
1245 if (XtIsRealized(ve->parent))
1247 CreateIC(inwidg, ve);
1248 SetICFocus(inwidg, ve);
1252 static Boolean NoRegistered(ve)
1253 XawVendorShellExtPart* ve;
1255 if (ve->ic.ic_table == NULL) return(TRUE);
1259 static void Unregister(inwidg, ve)
1261 XawVendorShellExtPart* ve;
1263 if (!IsRegistered(inwidg, ve)) return;
1265 DestroyIC(inwidg, ve);
1267 UnregisterFromVendorShell(inwidg, ve);
1269 if (NoRegistered(ve))
1271 CloseIM(ve);
1272 ve->im.xim = NULL;
1276 (void) SetVendorShellHeight(ve, 0);
1280 static void AllCreateIC( ve )
1281 XawVendorShellExtPart* ve;
1285 if (ve->im.xim == NULL) return;
1286 if (IsSharedIC(ve) && ve->ic.ic_table[0].widget) {
1287 p = ve->ic.shared_ic_table;
1289 CreateIC(ve->ic.ic_table[0].widget, ve);
1290 SetICFocus(ve->ic.ic_table[0].widget, ve);
1293 for (p = ve->ic.ic_table; p; p = p->next) {
1295 CreateIC(p->widget, ve);
1297 for (p = ve->ic.ic_table; p; p = p->next) {
1298 SetICFocus(p->widget, ve);
1303 static void Reconnect(ve)
1304 XawVendorShellExtPart* ve;
1308 ve->im.open_im = True;
1309 if (ve->im.xim == NULL) {
1310 OpenIM(ve);
1312 if (ve->im.xim == NULL) return;
1314 if (IsSharedIC(ve)) {
1315 p = ve->ic.shared_ic_table;
1319 for (p = ve->ic.ic_table; p; p = p->next) {
1324 AllCreateIC(ve);
1387 static Boolean Initialize( vw, ve )
1389 XawVendorShellExtPart* ve;
1394 ve->parent = (Widget)vw;
1395 ve->im.xim = NULL;
1396 ve->im.area_height = 0;
1397 ve->im.resources = (XrmResourceList)XtMalloc(sizeof(resources));
1398 if (ve->im.resources == NULL) return(FALSE);
1399 memcpy((char *)ve->im.resources, (char *)resources, sizeof(resources));
1400 ve->im.num_resources = XtNumber(resources);
1401 CompileResourceList( (XtResourceList) ve->im.resources,
1402 ve->im.num_resources );
1403 if ((ve->ic.shared_ic_table = CreateIcTable( (Widget)vw, ve)) == NULL)
1405 ve->ic.current_ic_table = NULL;
1406 ve->ic.ic_table = NULL;
1407 ve->im.im_list = ParseIMNameList(ve->im.input_method, &i);
1408 ve->im.im_list_num = i;
1409 ve->ic.ic_list = ParseIMNameList(ve->im.preedit_type, &i);
1410 ve->ic.ic_list_num = i;
1421 static void Destroy( w, ve )
1423 XawVendorShellExtPart* ve;
1430 XtFree( (char*) ve->im.resources );
1438 !XFindContext (XDisplayOfIM( ve->im.xim ), (Window) ve->im.xim,
1459 XawVendorShellExtPart *ve;
1461 if ( ( ve = GetExtPart( (VendorShellWidget) w ) ) && ve->im.xim ) {
1462 ResizeVendorShell( (VendorShellWidget) w, ve );
1476 XawVendorShellExtPart *ve;
1479 if ( ve = GetExtPart( (VendorShellWidget) w ) ) {
1480 return( w->core.height - ve->im.area_height );
1494 XawVendorShellExtPart *ve;
1498 if ( ve = GetExtPart( (VendorShellWidget) w ) ) {
1501 AllCreateIC(ve);
1515 XawVendorShellExtPart *ve;
1518 if ( ve = SetExtPart( (VendorShellWidget) w, (XawVendorShellExtWidget)ext ) ) {
1519 if ( Initialize( (VendorShellWidget) w, ve ) == FALSE ) return;
1534 XawVendorShellExtPart *ve;
1538 if (ve = GetExtPart(vw)) {
1539 Reconnect(ve);
1552 XawVendorShellExtPart *ve;
1556 if (ve = GetExtPart(vw)) {
1557 Register(inwidg, ve);
1570 XawVendorShellExtPart *ve;
1574 if (ve = GetExtPart(vw)) {
1575 Unregister(inwidg, ve);
1699 XawVendorShellExtPart* ve;
1706 if ((vw = SearchVendorShell(inwidg)) && (ve = GetExtPart(vw)) &&
1707 ve->im.xim && (p = GetIcTableShared(inwidg, ve)) && p->xic) {
1728 XawVendorShellExtPart *ve;
1731 if ((vw = SearchVendorShell(w)) && (ve = GetExtPart(vw))) {
1732 return(ve->im.area_height);
1746 XawVendorShellExtPart *ve;
1750 if ((vw = SearchVendorShell(w)) && (ve = GetExtPart(vw))) {
1772 XawVendorShellExtPart *ve;
1775 if ( ve = GetExtPart( (VendorShellWidget) w ) )
1776 Destroy( w, ve );