*** attr.c.orig Sun Feb 28 17:09:32 1999 --- attr.c Sun Feb 28 17:09:32 1999 *************** *** 135,167 **** } ! static ! void ParseAttrStr(Str, name, s) ! char *Str, *name, *s; { ! char *eq_ptr, *str_ptr, *ptr; ! if ((eq_ptr=FindEqual(Str)) != NULL) { eq_ptr++; ! ptr = name; ! str_ptr = Str; ! do { ! *ptr = *str_ptr; ! ptr++; ! str_ptr++; ! } while (str_ptr != eq_ptr); ! ! *ptr = '\0'; ! ptr = s; ! do { ! *ptr = *str_ptr; ! ptr++; ! str_ptr++; ! } while (*str_ptr != '\0'); ! *ptr = '\0'; } else { ! *name = '\0'; ! strcpy(s, Str); } } --- 135,182 ---- } ! void ParseAttrStr(buf, name, name_sz, value, value_sz) ! char *buf, *name, *value; ! int name_sz, value_sz; { ! char *eq_ptr=NULL, *str_ptr=NULL, *psz=NULL; ! if ((eq_ptr=FindEqual(buf)) != NULL) { eq_ptr++; ! if (name != NULL) { ! int index=0; ! psz = name; ! str_ptr = buf; ! for (;;) { ! *psz = *str_ptr; ! psz++; ! str_ptr++; ! index++; ! if (str_ptr == eq_ptr) { ! break; ! } else if (index >= name_sz-2) { ! *psz++ = '='; ! break; ! } ! } ! *psz = '\0'; ! } ! if (value != NULL) { ! int index=0; ! str_ptr = eq_ptr; ! psz = value; ! do { ! *psz = *str_ptr; ! psz++; ! str_ptr++; ! index++; ! } while (*str_ptr != '\0' && index < value_sz-1); ! ! *psz = '\0'; ! } } else { ! if (name != NULL) *name = '\0'; ! if (value != NULL) UtilStrCpyN(value, value_sz, buf); } } *************** *** 177,181 **** if (AttrPtr->nameshown) { ParseAttrStr(TextPtr->minilines.first->first_block->seg->dyn_str.s, ! name, value); DynStrSet(&AttrPtr->attr_value, value); DynStrSet(&AttrPtr->attr_name, name); --- 192,196 ---- if (AttrPtr->nameshown) { ParseAttrStr(TextPtr->minilines.first->first_block->seg->dyn_str.s, ! name, sizeof(name), value, sizeof(value)); DynStrSet(&AttrPtr->attr_value, value); DynStrSet(&AttrPtr->attr_name, name); *************** *** 391,395 **** ParseAttrStr(text_ptr->minilines.first->first_block->seg->dyn_str.s, ! name, value); topAttr = ObjPtr->fattr; botAttr = ObjPtr->lattr; --- 406,410 ---- ParseAttrStr(text_ptr->minilines.first->first_block->seg->dyn_str.s, ! name, sizeof(name), value, sizeof(value)); topAttr = ObjPtr->fattr; botAttr = ObjPtr->lattr; *************** *** 993,997 **** *TopSelPtr = new_sel_ptr; ! free(attr_ptr); } } --- 1008,1012 ---- *TopSelPtr = new_sel_ptr; ! FreeAttr(attr_ptr); } } *************** *** 1027,1031 **** attr_ptr->obj->detail.t->attr = NULL; AddObj(obj_ptr->prev, obj_ptr, attr_ptr->obj); ! free(attr_ptr); } obj_ptr->fattr = obj_ptr->lattr = NULL; --- 1042,1046 ---- attr_ptr->obj->detail.t->attr = NULL; AddObj(obj_ptr->prev, obj_ptr, attr_ptr->obj); ! FreeAttr(attr_ptr); } obj_ptr->fattr = obj_ptr->lattr = NULL; *************** *** 1100,1104 **** new_sel_ptr->obj = obj_ptr->prev; AddSel(sel_ptr->prev, sel_ptr, new_sel_ptr); ! free(attr_ptr); } obj_ptr->fattr = topAttr; --- 1115,1119 ---- new_sel_ptr->obj = obj_ptr->prev; AddSel(sel_ptr->prev, sel_ptr, new_sel_ptr); ! FreeAttr(attr_ptr); } obj_ptr->fattr = topAttr; *************** *** 1699,1703 **** attr_ptr->obj->detail.t->attr = NULL; AddObj(topObj, topObj->next, attr_ptr->obj); ! free(attr_ptr); } topObj->fattr = topObj->lattr = NULL; --- 1714,1718 ---- attr_ptr->obj->detail.t->attr = NULL; AddObj(topObj, topObj->next, attr_ptr->obj); ! FreeAttr(attr_ptr); } topObj->fattr = topObj->lattr = NULL; *** auxtext.c.orig Sun Feb 28 17:09:34 1999 --- auxtext.c Sun Feb 28 17:09:34 1999 *************** *** 1340,1343 **** --- 1340,1344 ---- MiniLinesInfo *minilines=(&text_ptr->minilines); int pen=text_ptr->pen, fill=text_ptr->fill, trans_pat=ObjPtr->trans_pat; + int underline_y_offset=text_ptr->underline_y_offset; if ((fill == NONEPAT || (trans_pat && fill == BACKPAT)) && *************** *** 1346,1349 **** --- 1347,1351 ---- } fprintf(FP, "%% TEXT\n"); + fprintf(FP, "%s\n", gPsCmd[PS_NEWPATH]); if (!PRTGIF) SaveCurFont(); *************** *** 1354,1357 **** --- 1356,1360 ---- transPat = trans_pat; objFill = fill; + curUnderlineYOffset = underline_y_offset; if (PRTGIF || text_ptr->read_only) { *** convxim.c.orig Sun Feb 28 17:09:37 1999 --- convxim.c Sun Feb 28 17:09:37 1999 *************** *** 59,68 **** static XIC ic = NULL; ! static void (*oldhandler)() = NULL; ! static Bool _XIMErrorFlag = False; #ifndef _NO_XIMP ! static void (*_XipSetIOErrorHandler(handler))() ! void (*handler)(); { return NULL; --- 59,70 ---- static XIC ic = NULL; ! typedef void (MYIOErrHandler)ARGS_DECL((void)); + static MYIOErrHandler *oldhandler = NULL; + static Bool _XIMErrorFlag = False; + #ifndef _NO_XIMP ! static MYIOErrHandler *_XipSetIOErrorHandler(new_handler) ! MYIOErrHandler *new_handler; { return NULL; *** exec.c.orig Sun Feb 28 17:09:42 1999 --- exec.c Sun Feb 28 17:09:42 1999 *************** *** 1049,1059 **** for (pMiniLine=launch_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! struct AttrRec *attr_ptr; if (first_time) { first_time = FALSE; ! c_ptr = launch_attr->attr_value.s; } else { ! c_ptr = pMiniLine->first_block->seg->dyn_str.s; } for ( ; *c_ptr != '\0'; c_ptr++, count++) { --- 1049,1070 ---- for (pMiniLine=launch_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! struct AttrRec *attr_ptr=NULL; ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=NULL; if (first_time) { + char *attr_value=NULL; + first_time = FALSE; ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! attr_value = UtilStrDup(tmp_buf); ! if (attr_value == NULL) FailAllocMessage(); ! ParseAttrStr(tmp_buf, NULL, 0, attr_value, strlen(attr_value)+1); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); ! need_to_free_tmp_buf = TRUE; ! c_ptr = tmp_buf = attr_value; } else { ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! c_ptr = tmp_buf; } for ( ; *c_ptr != '\0'; c_ptr++, count++) { *************** *** 1096,1099 **** --- 1107,1112 ---- } } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); + if (count != 0) { *buf_ptr = '\0'; *************** *** 1203,1207 **** /* obj_ptr better be a top-level object */ { ! int value_len, same=FALSE; value_len = strlen(new_value); --- 1216,1221 ---- /* obj_ptr better be a top-level object */ { ! int value_len=0, same=FALSE; ! MiniLineInfo *pFirstMiniLine=attr_ptr->obj->detail.t->minilines.first; value_len = strlen(new_value); *************** *** 1209,1213 **** new_value[value_len-1] == *new_value) { new_value[value_len-1] = '\0'; ! if (strcmp(attr_ptr->attr_value.s, &new_value[1]) == 0) { same = TRUE; } --- 1223,1228 ---- new_value[value_len-1] == *new_value) { new_value[value_len-1] = '\0'; ! if (strcmp(attr_ptr->attr_value.s, &new_value[1]) == 0 && ! (obj_ptr == tgifObj || pFirstMiniLine->first_block->next == NULL)) { same = TRUE; } *************** *** 1214,1218 **** new_value[value_len-1] = *new_value; } else { ! if (strcmp(attr_ptr->attr_value.s, new_value) == 0) { same = TRUE; } --- 1229,1234 ---- new_value[value_len-1] = *new_value; } else { ! if (strcmp(attr_ptr->attr_value.s, new_value) == 0 && ! (obj_ptr == tgifObj || pFirstMiniLine->first_block->next == NULL)) { same = TRUE; } *************** *** 1245,1248 **** --- 1261,1267 ---- DynStrSet(&attr_ptr->attr_value, new_value); } + FreeStrBlockList(pFirstMiniLine->first_block->next); + pFirstMiniLine->first_block->next = NULL; + pFirstMiniLine->last_block = pFirstMiniLine->first_block; UpdAttr(attr_ptr); *************** *** 1483,1522 **** } - static - void RecursivelyAdjAnObjBBox(target_obj, owner_obj) - struct ObjRec *target_obj, *owner_obj; - { - if (target_obj == owner_obj) { - AdjObjBBox(target_obj); - } else { - struct ObjRec *obj_ptr; - - switch (owner_obj->type) { - case OBJ_GROUP: - case OBJ_ICON: - case OBJ_SYM: - case OBJ_PIN: - for (obj_ptr=owner_obj->detail.r->first; obj_ptr!=NULL; - obj_ptr=obj_ptr->next) { - RecursivelyAdjAnObjBBox(target_obj, obj_ptr); - } - AdjObjBBox(owner_obj); - break; - default: break; - } - } - } - - static - void RecursivelyAdjObjBBox(sub_obj, owner_obj, top_owner) - struct ObjRec *sub_obj, *owner_obj, *top_owner; - { - if (owner_obj == NULL) { - RecursivelyAdjAnObjBBox(sub_obj, sub_obj); - } else { - RecursivelyAdjAnObjBBox(sub_obj, top_owner); - } - } - /* --------------------- Exec Routines --------------------- */ --- 1502,1505 ---- *************** *** 1643,1650 **** for (pMiniLine=text_ptr->minilines.first->next; pMiniLine != NULL; pMiniLine = pMiniLine->next) { ! if (fprintf(out_fp,"%s\n", ! pMiniLine->first_block->seg->dyn_str.s) == EOF) { writeFileFailed = TRUE; } } } --- 1626,1638 ---- for (pMiniLine=text_ptr->minilines.first->next; pMiniLine != NULL; pMiniLine = pMiniLine->next) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, ! &need_to_free_tmp_buf); ! ! if (fprintf(out_fp, "%s\n", tmp_buf) == EOF) { writeFileFailed = TRUE; } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); + if (writeFileFailed) break; } } *************** *** 1665,1672 **** for (pMiniLine=text_ptr->minilines.first->next; pMiniLine != NULL; pMiniLine = pMiniLine->next) { ! if (fprintf(out_fp, "%s\n", ! pMiniLine->first_block->seg->dyn_str.s) == EOF) { writeFileFailed = TRUE; } } } --- 1653,1665 ---- for (pMiniLine=text_ptr->minilines.first->next; pMiniLine != NULL; pMiniLine = pMiniLine->next) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, ! &need_to_free_tmp_buf); ! ! if (fprintf(out_fp, "%s\n", tmp_buf) == EOF) { writeFileFailed = TRUE; } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); + if (writeFileFailed) break; } } *************** *** 1676,1682 **** } if (writeFileFailed) { ! sprintf(msg, "Fail to write to '%s'.\n\nFile system may be full.", ! file_name); ! MsgBox(msg, TOOL_NAME, INFO_MB); rc = FALSE; } --- 1669,1673 ---- } if (writeFileFailed) { ! FailToWriteFileMessage(file_name); rc = FALSE; } *************** *** 2325,2331 **** DynStrSet(&attr_ptr->attr_value, ""); } else { ! if (text_obj_ptr->detail.t->minilines.first != NULL) { ! DynStrCpy(&attr_ptr->attr_value, ! &text_obj_ptr->detail.t->minilines.first->first_block->seg->dyn_str); } else { DynStrSet(&attr_ptr->attr_value, ""); --- 2316,2328 ---- DynStrSet(&attr_ptr->attr_value, ""); } else { ! MiniLineInfo *pMiniLine=text_obj_ptr->detail.t->minilines.first; ! ! if (pMiniLine != NULL) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, ! &need_to_free_tmp_buf); ! ! DynStrSet(&attr_ptr->attr_value, tmp_buf); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); } else { DynStrSet(&attr_ptr->attr_value, ""); *************** *** 2396,2399 **** --- 2393,2398 ---- return FALSE; } + writeFileFailed = FALSE; + fprintf(fp, "%s\n", attr_ptr->attr_value.s); if (attr_ptr->obj->detail.t->minilines.first != NULL) { *************** *** 2402,2406 **** for (pMiniLine=attr_ptr->obj->detail.t->minilines.first->next; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! fprintf(fp, "%s\n", pMiniLine->first_block->seg->dyn_str.s); } } --- 2401,2413 ---- for (pMiniLine=attr_ptr->obj->detail.t->minilines.first->next; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, ! &need_to_free_tmp_buf); ! ! if (fprintf(fp, "%s\n", tmp_buf) == EOF) { ! writeFileFailed = TRUE; ! } ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); ! if (writeFileFailed) break; } } *************** *** 2407,2410 **** --- 2414,2418 ---- fclose(fp); + if (writeFileFailed) return FailToWriteFileMessage(file_name); return TRUE; } *************** *** 2620,2624 **** for (pMiniLine=list_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! tmp_sz += strlen(pMiniLine->first_block->seg->dyn_str.s)+1; } tmp_buf = (char*)malloc((tmp_sz+2)*sizeof(char)); --- 2628,2636 ---- for (pMiniLine=list_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! ! tmp_sz += strlen(tmp_buf)+1; ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); } tmp_buf = (char*)malloc((tmp_sz+2)*sizeof(char)); *************** *** 2631,2639 **** for (pMiniLine=list_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { if (found_name) { ! strcpy(&tmp_buf[tmp_sz], pMiniLine->first_block->seg->dyn_str.s); ! tmp_sz += strlen(pMiniLine->first_block->seg->dyn_str.s); ! } else if ((c_ptr=strchr(pMiniLine->first_block->seg->dyn_str.s, '=')) != ! NULL) { found_name = TRUE; strcpy(&tmp_buf[tmp_sz], ++c_ptr); --- 2643,2653 ---- for (pMiniLine=list_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { + int need_to_free_tmp_buf=FALSE; + char *tmp_buf=ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); + if (found_name) { ! strcpy(&tmp_buf[tmp_sz], tmp_buf); ! tmp_sz += strlen(tmp_buf); ! } else if ((c_ptr=strchr(tmp_buf, '=')) != NULL) { found_name = TRUE; strcpy(&tmp_buf[tmp_sz], ++c_ptr); *************** *** 2642,2645 **** --- 2656,2661 ---- continue; } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); + tmp_buf[tmp_sz++] = '\n'; } *************** *** 2661,2668 **** for (pMiniLine=attr_ptr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { ! len += strlen(attr_ptr->attr_value.s)+1; } else { ! len += strlen(pMiniLine->first_block->seg->dyn_str.s)+1; } } --- 2677,2697 ---- for (pMiniLine=attr_ptr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { + int need_to_free_tmp_buf=FALSE; + char *tmp_buf=NULL; + if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { ! char *attr_value=NULL; ! ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! attr_value = UtilStrDup(tmp_buf); ! if (attr_value == NULL) FailAllocMessage(); ! ParseAttrStr(tmp_buf, NULL, 0, attr_value, strlen(attr_value)+1); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); ! len += strlen(attr_value)+1; ! UtilFree(attr_value); } else { ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! len += strlen(tmp_buf)+1; ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); } } *************** *** 2684,2693 **** for (pMiniLine=attr_ptr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { buf1_index += MapCGIChars(&buf1[buf1_index], len-buf1_index, ! attr_ptr->attr_value.s); } else { buf1_index += MapCGIChars(&buf1[buf1_index], len-buf1_index, ! pMiniLine->first_block->seg->dyn_str.s); } if (pMiniLine->next != NULL && buf1_index < len-1) { --- 2713,2735 ---- for (pMiniLine=attr_ptr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { + int need_to_free_tmp_buf=FALSE; + char *tmp_buf=NULL; + if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { + char *attr_value=NULL; + + tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); + attr_value = UtilStrDup(tmp_buf); + if (attr_value == NULL) FailAllocMessage(); + ParseAttrStr(tmp_buf, NULL, 0, attr_value, strlen(attr_value)+1); + if (need_to_free_tmp_buf) UtilFree(tmp_buf); buf1_index += MapCGIChars(&buf1[buf1_index], len-buf1_index, ! attr_value); ! UtilFree(attr_value); } else { + tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); buf1_index += MapCGIChars(&buf1[buf1_index], len-buf1_index, ! tmp_buf); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); } if (pMiniLine->next != NULL && buf1_index < len-1) { *************** *** 4692,4699 **** for (pMiniLine=query_attr->obj->detail.t->minilines.first->next; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! if (fprintf(fp, "%s\r\n", ! pMiniLine->first_block->seg->dyn_str.s) == EOF) { writeFileFailed = TRUE; } } } --- 4734,4746 ---- for (pMiniLine=query_attr->obj->detail.t->minilines.first->next; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, ! &need_to_free_tmp_buf); ! ! if (fprintf(fp, "%s\r\n", tmp_buf) == EOF) { writeFileFailed = TRUE; } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); + if (writeFileFailed) break; } } *************** *** 5312,5324 **** pMiniLine != NULL; pMiniLine=pMiniLine->next) { char *c_ptr, *buf=NULL; ! if (pMiniLine==src_attr_ptr->obj->detail.t->minilines.first) { ! buf = src_attr_ptr->attr_value.s; } else { ! buf = pMiniLine->first_block->seg->dyn_str.s; } for (c_ptr=strstr(buf, pattern_str); c_ptr != NULL; c_ptr=strstr(buf, pattern_str)) { ! char saved_ch=(*c_ptr), *buf1; MiniLineInfo *pReplaceMiniLine=NULL; --- 5359,5382 ---- pMiniLine != NULL; pMiniLine=pMiniLine->next) { char *c_ptr, *buf=NULL; + int need_to_free_tmp_buf=FALSE; + char *tmp_buf=NULL; ! if (pMiniLine == src_attr_ptr->obj->detail.t->minilines.first) { ! char *attr_value=NULL; ! ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! attr_value = UtilStrDup(tmp_buf); ! if (attr_value == NULL) FailAllocMessage(); ! ParseAttrStr(tmp_buf, NULL, 0, attr_value, strlen(attr_value)+1); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); ! need_to_free_tmp_buf = TRUE; ! buf = tmp_buf = attr_value; } else { ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! buf = tmp_buf; } for (c_ptr=strstr(buf, pattern_str); c_ptr != NULL; c_ptr=strstr(buf, pattern_str)) { ! char saved_ch=(*c_ptr); MiniLineInfo *pReplaceMiniLine=NULL; *************** *** 5330,5338 **** pReplaceMiniLine != NULL; pReplaceMiniLine=pReplaceMiniLine->next) { if (pReplaceMiniLine == replace_attr_ptr->obj->detail.t->minilines.first) { ! buf1 = replace_attr_ptr->attr_value.s; } else { ! buf1 = pReplaceMiniLine->first_block->seg->dyn_str.s; } if (fprintf(fp, "%s%s", buf1, --- 5388,5413 ---- pReplaceMiniLine != NULL; pReplaceMiniLine=pReplaceMiniLine->next) { + char *buf1=NULL; + int need_to_free_tmp_buf1=FALSE; + char *tmp_buf1=ConvertMiniLineToString(pMiniLine, + &need_to_free_tmp_buf1); + if (pReplaceMiniLine == replace_attr_ptr->obj->detail.t->minilines.first) { ! char *attr_value=NULL; ! ! tmp_buf1 = ConvertMiniLineToString(pReplaceMiniLine, ! &need_to_free_tmp_buf1); ! attr_value = UtilStrDup(tmp_buf1); ! if (attr_value == NULL) FailAllocMessage(); ! ParseAttrStr(tmp_buf1, NULL, 0, attr_value, ! strlen(attr_value)+1); ! if (need_to_free_tmp_buf1) UtilFree(tmp_buf1); ! need_to_free_tmp_buf1 = TRUE; ! buf1 = tmp_buf1 = attr_value; } else { ! tmp_buf1 = ConvertMiniLineToString(pReplaceMiniLine, ! &need_to_free_tmp_buf1); ! buf1 = tmp_buf1; } if (fprintf(fp, "%s%s", buf1, *************** *** 5340,5343 **** --- 5415,5420 ---- writeFileFailed = TRUE; } + if (need_to_free_tmp_buf1) UtilFree(tmp_buf1); + if (writeFileFailed) break; } *c_ptr = saved_ch; *************** *** 5349,5352 **** --- 5426,5431 ---- } } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); + if (writeFileFailed) break; } fclose(fp); *************** *** 5544,5551 **** pMiniLine != NULL; pMiniLine=pMiniLine->next) { if (count == line_number) { if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { ! psz = UtilStrDup(attr_ptr->attr_value.s); } else { ! psz = UtilStrDup(pMiniLine->first_block->seg->dyn_str.s); } if (psz == NULL) FailAllocMessage(); --- 5623,5643 ---- pMiniLine != NULL; pMiniLine=pMiniLine->next) { if (count == line_number) { + int need_to_free_tmp_buf=FALSE; + char *tmp_buf=NULL; + if (pMiniLine == attr_ptr->obj->detail.t->minilines.first) { ! char *attr_value=NULL; ! ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! attr_value = UtilStrDup(tmp_buf); ! if (attr_value == NULL) FailAllocMessage(); ! ParseAttrStr(tmp_buf, NULL, 0, attr_value, strlen(attr_value)+1); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); ! psz = UtilStrDup(attr_value); ! UtilFree(attr_value); } else { ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! psz = UtilStrDup(tmp_buf); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); } if (psz == NULL) FailAllocMessage(); *************** *** 5730,5733 **** --- 5822,5826 ---- &topTmpStr, &botTmpStr); } + free(count_buf); } CleanTmpStr(); *************** *** 5890,5910 **** } if (dx != 0 || dy != 0) { ! struct ObjRec *text_obj_ptr=attr_ptr->obj; ! int ltx, lty, rbx, rby; ! ! ltx = attr_owner_obj->bbox.ltx; ! lty = attr_owner_obj->bbox.lty; ! rbx = attr_owner_obj->bbox.rbx; ! rby = attr_owner_obj->bbox.rby; ! PrepareToReplaceAnObj(attr_owner_obj); ! MoveObj(text_obj_ptr, dx, dy); ! RecursivelyAdjObjBBox(attr_ptr->owner, attr_ptr->owner, attr_owner_obj); ! RecordReplaceAnObj(attr_owner_obj); ! RedrawAreas(botObj, ltx-GRID_ABS_SIZE(1), lty-GRID_ABS_SIZE(1), ! rbx+GRID_ABS_SIZE(1), rby+GRID_ABS_SIZE(1), ! attr_owner_obj->bbox.ltx-GRID_ABS_SIZE(1), ! attr_owner_obj->bbox.lty-GRID_ABS_SIZE(1), ! attr_owner_obj->bbox.rbx+GRID_ABS_SIZE(1), ! attr_owner_obj->bbox.rby+GRID_ABS_SIZE(1)); SetFileModified(TRUE); } --- 5983,5987 ---- } if (dx != 0 || dy != 0) { ! MoveAnAttr(attr_ptr, attr_owner_obj, dx, dy); SetFileModified(TRUE); } *************** *** 6175,6179 **** values = tgGetProfileString((*section=='\0' ? NULL : section), ! (key=='\0' ? NULL : key), ini_path); if (values != NULL) { --- 6252,6256 ---- values = tgGetProfileString((*section=='\0' ? NULL : section), ! (*key=='\0' ? NULL : key), ini_path); if (values != NULL) { *************** *** 6200,6203 **** --- 6277,6281 ---- } } + free(count_buf); CleanTmpStr(); } else { *************** *** 7063,7071 **** for (pMiniLine=exec_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { if (first_time) { first_time = FALSE; ! c_ptr = exec_attr->attr_value.s; } else { ! c_ptr = pMiniLine->first_block->seg->dyn_str.s; } if ((count=strlen(c_ptr)) != 0) { --- 7141,7161 ---- for (pMiniLine=exec_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { + int need_to_free_tmp_buf=FALSE; + char *tmp_buf=NULL; + if (first_time) { + char *attr_value=NULL; + first_time = FALSE; ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! attr_value = UtilStrDup(tmp_buf); ! if (attr_value == NULL) FailAllocMessage(); ! ParseAttrStr(tmp_buf, NULL, 0, attr_value, strlen(attr_value)+1); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); ! need_to_free_tmp_buf = TRUE; ! c_ptr = tmp_buf = attr_value; } else { ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! c_ptr = tmp_buf; } if ((count=strlen(c_ptr)) != 0) { *************** *** 7086,7089 **** --- 7176,7180 ---- } } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); } *cmd_ptr = '\0'; *** file.c.orig Sun Feb 28 17:09:46 1999 --- file.c Sun Feb 28 17:09:46 1999 *************** *** 5367,5376 **** if (strstr(printCommand, "%s") == NULL) { if (lastFile) { ! sprintf(cmd,"%s %s%s",printCommand,tmpFile,PRINT_TRAILER); } else { ! sprintf(cmd,"%s -h %s%s",printCommand,tmpFile,PRINT_TRAILER); } } else { sprintf(cmd, printCommand, tmpFile); strcat(cmd, PRINT_TRAILER); } --- 5367,5378 ---- if (strstr(printCommand, "%s") == NULL) { if (lastFile) { ! sprintf(cmd,"%s %s",printCommand,tmpFile); } else { ! sprintf(cmd,"%s -h %s",printCommand,tmpFile); } } else { sprintf(cmd, printCommand, tmpFile); + } + if (strcmp(printCommand, "cat") != 0) { strcat(cmd, PRINT_TRAILER); } *************** *** 5378,5391 **** } else { if (strstr(printCommand, "%s") == NULL) { ! sprintf(cmd,"%s %s%s",printCommand,tmpFile,PRINT_TRAILER); ! sprintf(gszMsgBox, "Printing with '%s' command.", printCommand); } else { sprintf(cmd, printCommand, tmpFile); strcat(cmd, PRINT_TRAILER); - sprintf(gszMsgBox, "Printing with '%s' command.", printCommand); } Msg(gszMsgBox); } ! if (!ExecuteCmd(cmd)) { if (PRTGIF) { fprintf(stderr, "Cannot execute '%s', print aborted.\n", cmd); --- 5380,5411 ---- } else { if (strstr(printCommand, "%s") == NULL) { ! sprintf(cmd,"%s %s",printCommand,tmpFile); } else { sprintf(cmd, printCommand, tmpFile); + } + sprintf(gszMsgBox, "Printing with '%s' command.", printCommand); + if (strcmp(printCommand, "cat") != 0) { strcat(cmd, PRINT_TRAILER); } Msg(gszMsgBox); } ! if (strcmp(printCommand, "cat") == 0) { ! /* ! * Well, you can't really "cat" to a printer (without piping to ! * anything else), so you must mean "catting" to stdout! ! */ ! FILE *pfp=NULL; ! ! sprintf(gszMsgBox, "Executing '%s'...", cmd); ! SetStringStatus(gszMsgBox); ! if (!PRTGIF) XSync(mainDisplay, False); ! if ((pfp=(FILE*)popen(cmd, "r")) == NULL) return FALSE; ! ! while (fgets(gszMsgBox, sizeof(gszMsgBox)-1, pfp) != NULL) { ! printf("%s", gszMsgBox); ! } ! pclose(pfp); ! SetStringStatus("...Done"); ! } else if (!ExecuteCmd(cmd)) { if (PRTGIF) { fprintf(stderr, "Cannot execute '%s', print aborted.\n", cmd); *** grid.c.orig Sun Feb 28 17:09:51 1999 --- grid.c Sun Feb 28 17:09:51 1999 *************** *** 1450,1454 **** if (ev->type == MotionNotify) { ! prev_diag_state = (ev->xmotion.state & ShiftMask); } else if (ev->type == KeyPress || ev->type == KeyRelease) { char s[80]; --- 1450,1455 ---- if (ev->type == MotionNotify) { ! prev_diag_state = (ev->xmotion.state & ShiftMask) && ! (!(ev->xmotion.state & ControlMask)); } else if (ev->type == KeyPress || ev->type == KeyRelease) { char s[80]; *** group.c.orig Sun Feb 28 17:09:52 1999 --- group.c Sun Feb 28 17:09:52 1999 *************** *** 491,494 **** --- 491,499 ---- } free(sel_ptr); + /* + * What about obj_ptr->detail.r->first_conn and + * obj_ptr->detail.r->last_conn? + */ + free(obj_ptr->detail.r); free(obj_ptr); } *** mainmenu.c.orig Sun Feb 28 17:09:53 1999 --- mainmenu.c Sun Feb 28 17:09:53 1999 *************** *** 233,238 **** *px += win_attrs.x; *py += win_attrs.y; ! XQueryTree(mainDisplay, win, &root_win, ! &parent_win, &child_wins, &num_child); if (parent_win != rootWindow) { XGetWindowAttributes(mainDisplay, parent_win, &win_attrs); --- 233,241 ---- *px += win_attrs.x; *py += win_attrs.y; ! if (XQueryTree(mainDisplay, win, &root_win, ! &parent_win, &child_wins, &num_child) == 0) { ! return; ! } ! if (child_wins != NULL) XFree((void*)child_wins); if (parent_win != rootWindow) { XGetWindowAttributes(mainDisplay, parent_win, &win_attrs); *************** *** 241,245 **** break; } - if (child_wins != NULL) XFree((void*)child_wins); } } --- 244,247 ---- *** menu.c.orig Sun Feb 28 17:09:55 1999 --- menu.c Sun Feb 28 17:09:55 1999 *************** *** 996,999 **** --- 996,1000 ---- XEvent ev; XWMHints wmhints; + XSizeHints sizehints; XSetWindowAttributes win_attrs; int pinned_x=0, pinned_y=0, menu_pinned=FALSE; *************** *** 1036,1039 **** --- 1037,1051 ---- XSetWMHints(mainDisplay, menu->window, &wmhints); + sizehints.flags = PPosition | PSize | USPosition | PMinSize | PMaxSize; + sizehints.x = orig_x+windowPadding; + sizehints.y = orig_y+windowPadding; + sizehints.width = sizehints.min_width = sizehints.max_width = menu_w; + sizehints.height = sizehints.min_height = sizehints.max_height = menu_h; + #ifdef NOTR4MODE + XSetNormalHints(mainDisplay, menu->window, &sizehints); + #else + XSetWMNormalHints(mainDisplay, menu->window, &sizehints); + #endif + menu->selected_index = INVALID; *************** *** 1045,1053 **** XSelectInput(mainDisplay, menu->window, StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | ! EnterWindowMask | LeaveWindowMask); #else XSelectInput(mainDisplay, menu->window, StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | ! EnterWindowMask | LeaveWindowMask); XMapWindow(mainDisplay, menu->window); #endif --- 1057,1065 ---- XSelectInput(mainDisplay, menu->window, StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | ! PointerMotionMask | EnterWindowMask | LeaveWindowMask); #else XSelectInput(mainDisplay, menu->window, StructureNotifyMask | ExposureMask | KeyPressMask | ButtonPressMask | ButtonReleaseMask | ! PointerMotionMask | EnterWindowMask | LeaveWindowMask); XMapWindow(mainDisplay, menu->window); #endif *************** *** 1057,1074 **** XWarpPointer(mainDisplay,None,rootWindow,0,0,0,0,orig_x-2,orig_y-2); } - XFlush(mainDisplay); - XSync(mainDisplay, False); - XQueryPointer(mainDisplay, menu->window, &root_win, &child_win, &saved_root_x, &saved_root_y, &x, &y, &status); - while (XCheckWindowEvent(mainDisplay, menu->window, ExposureMask, &ev)) ; - while (XCheckWindowEvent(mainDisplay, menu->window, StructureNotifyMask, - &ev)) { - } - TgDrawEntireMenu(menu); - if (parent_menu == NULL && !debugNoPointerGrab) { ! XGrabPointer(mainDisplay, menu->window, FALSE, None, GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime); } --- 1069,1078 ---- XWarpPointer(mainDisplay,None,rootWindow,0,0,0,0,orig_x-2,orig_y-2); } XQueryPointer(mainDisplay, menu->window, &root_win, &child_win, &saved_root_x, &saved_root_y, &x, &y, &status); if (parent_menu == NULL && !debugNoPointerGrab) { ! XGrabPointer(mainDisplay, menu->window, FALSE, ! PointerMotionMask | ButtonPressMask | ButtonReleaseMask, GrabModeAsync, GrabModeAsync, None, handCursor, CurrentTime); } *************** *** 1076,1079 **** --- 1080,1091 ---- int root_x, root_y, any_button_down; + XNextEvent(mainDisplay, &ev); + if (ev.type == Expose || ev.type == VisibilityNotify) { + if (ev.xany.window == menu->window) { + TgDrawEntireMenu(menu); + } else { + ExposeEventHandler(&ev, FALSE); + } + } XQueryPointer(mainDisplay, menu->window, &root_win, &child_win, &root_x, &root_y, &x, &y, &status); *************** *** 1221,1225 **** if (menu->window != None) XDestroyWindow(mainDisplay, menu->window); - XFlush(mainDisplay); XSync(mainDisplay, False); --- 1233,1236 ---- *************** *** 2370,2374 **** TRUE); excludeMenubarWinBBox.ltx = text_bbox->ltx-2; ! excludeMenubarWinBBox.lty = text_bbox->lty; excludeMenubarWinBBox.rbx = text_bbox->rbx+exclude_gap+2; excludeMenubarWinBBox.rby = text_bbox->rby+2; --- 2381,2385 ---- TRUE); excludeMenubarWinBBox.ltx = text_bbox->ltx-2; ! excludeMenubarWinBBox.lty = text_bbox->lty-2; excludeMenubarWinBBox.rbx = text_bbox->rbx+exclude_gap+2; excludeMenubarWinBBox.rby = text_bbox->rby+2; *** miniline.c.orig Sun Feb 28 17:09:58 1999 --- miniline.c Sun Feb 28 17:09:58 1999 *************** *** 466,483 **** } - void SetTextFirstDynStr(obj_ptr, buf) - struct ObjRec *obj_ptr; - char *buf; - { - MiniLineInfo *pMiniLine=obj_ptr->detail.t->minilines.first; - - FreeStrBlockList(pMiniLine->first_block); - - pMiniLine->first_block = pMiniLine->last_block = NewStrBlock(); - pMiniLine->first_block->type = SB_SIMPLE; - pMiniLine->first_block->seg = NewStrSeg(); - DynStrSet(&pMiniLine->first_block->seg->dyn_str, buf); - } - /* --------------------- TextRec Routines --------------------- */ --- 466,469 ---- *************** *** 1439,1443 **** values.stipple = patPixmap[penPat]; values.font = canvasFontPtr->fid; ! XChangeGC (mainDisplay, gc, GCForeground | GCFunction | GCFillStyle | GCStipple | GCFont, &values); if (use_highlight && depth != 1) { --- 1425,1429 ---- values.stipple = patPixmap[penPat]; values.font = canvasFontPtr->fid; ! XChangeGC(mainDisplay, gc, GCForeground | GCFunction | GCFillStyle | GCStipple | GCFont, &values); if (use_highlight && depth != 1) { *************** *** 4724,4725 **** --- 4710,4795 ---- } + /* --------------------- ConvertMiniLineToString() --------------------- */ + + static + void ConvertStrSegToString(pStrSeg, ppsz_buf, pn_len) + StrSegInfo *pStrSeg; + char **ppsz_buf; + int *pn_len; + { + int len=0; + + if (*pStrSeg->dyn_str.s == '\0') return; + + len = strlen(pStrSeg->dyn_str.s); + (*ppsz_buf) = realloc(*ppsz_buf, ((*pn_len)+len+1)*sizeof(char)); + if ((*ppsz_buf) == NULL) FailAllocMessage(); + strcpy(&(*ppsz_buf)[*pn_len], pStrSeg->dyn_str.s); + *pn_len += len; + } + + static + int ConvertStrBlockToString(pStrBlock, ppsz_buf, pn_len) + StrBlockInfo *pStrBlock; + char **ppsz_buf; + int *pn_len; + /* returns TRUE to continue to the next block */ + /* returns FALSE if this string block contains super/subscripts */ + { + switch (pStrBlock->type) { + case SB_SIMPLE: + ConvertStrSegToString(pStrBlock->seg, ppsz_buf, pn_len); + break; + + case SB_CHAR_SPACE: + if (pStrBlock->special_char_w > 0) { + /* only generate a space if the width of the thin space is > 0 */ + (*ppsz_buf) = realloc(*ppsz_buf, ((*pn_len)+2)*sizeof(char)); + if ((*ppsz_buf) == NULL) FailAllocMessage(); + strcpy(&(*ppsz_buf)[*pn_len], " "); + (*pn_len)++; + } + break; + + case SB_SUPSUB_LEFT: + case SB_SUPSUB_CENTER: + case SB_SUPSUB_RIGHT: + if (!BlankMiniLines(pStrBlock->sup) || !BlankMiniLines(pStrBlock->sub)) { + return FALSE; + } + if (pStrBlock->type == SB_SUPSUB_CENTER) { + /* pStrBlock->seg better not be NULL or it will crash */ + ConvertStrSegToString(pStrBlock->seg, ppsz_buf, pn_len); + } + break; + } + return TRUE; + } + + char *ConvertMiniLineToString(pMiniLine, pnNeedToFree) + MiniLineInfo *pMiniLine; + int *pnNeedToFree; + /* must free the returned string with UtilFree() */ + { + char *buf=NULL; + int len=0; + StrBlockInfo *pStrBlock=NULL; + + *pnNeedToFree = FALSE; + if (pMiniLine->first_block->next == NULL) { + return pMiniLine->first_block->seg->dyn_str.s; + } + buf = UtilStrDup(pMiniLine->first_block->seg->dyn_str.s); + if (buf == NULL) FailAllocMessage(); + len = strlen(buf); + for (pStrBlock=pMiniLine->first_block->next; pStrBlock != NULL; + pStrBlock=pStrBlock->next) { + if (!ConvertStrBlockToString(pStrBlock, &buf, &len)) { + break; + } + } + *pnNeedToFree = TRUE; + + return buf; + } + *** move.c.orig Sun Feb 28 17:10:00 1999 --- move.c Sun Feb 28 17:10:00 1999 *************** *** 38,41 **** --- 38,42 ---- #include "arc.e" #include "attr.e" + #include "choice.e" #include "cmd.e" #include "cursor.e" *************** *** 565,570 **** if (execCurDepth <= 0) { #ifdef _TGIF_DBG ! sprintf(gszMsgBox, "MoveAnObj() called not from an internal command!"); ! MsgBox(gszMsgBox, TOOL_NAME, STOP_MB); return; #endif /* _TGIF_DBG */ --- 566,571 ---- if (execCurDepth <= 0) { #ifdef _TGIF_DBG ! TgAssert(FALSE, ! "MoveAnObj() called not from an internal command!", NULL); return; #endif /* _TGIF_DBG */ *************** *** 572,577 **** if (ObjPtr == TopOwner) { struct SelRec *saved_top_sel=topSel, *saved_bot_sel=botSel; ! int ltx=TopOwner->bbox.ltx, lty=TopOwner->bbox.lty; ! int rbx=TopOwner->bbox.rbx, rby=TopOwner->bbox.rby; struct MoveSubCmdRec *move_cmd; struct SubCmdRec *sub_cmd; --- 573,578 ---- if (ObjPtr == TopOwner) { struct SelRec *saved_top_sel=topSel, *saved_bot_sel=botSel; ! int ltx=ObjPtr->bbox.ltx, lty=ObjPtr->bbox.lty; ! int rbx=ObjPtr->bbox.rbx, rby=ObjPtr->bbox.rby; struct MoveSubCmdRec *move_cmd; struct SubCmdRec *sub_cmd; *************** *** 581,588 **** memset(topSel, 0, sizeof(struct SelRec)); topSel->next = topSel->prev = NULL; ! topSel->obj = TopOwner; UpdSelBBox(); ! move_cmd = (struct MoveSubCmdRec *)malloc(sizeof(struct MoveSubCmdRec)); sub_cmd = (struct SubCmdRec *)malloc(sizeof(struct SubCmdRec)); if (move_cmd == NULL || sub_cmd == NULL) FailAllocMessage(); --- 582,590 ---- memset(topSel, 0, sizeof(struct SelRec)); topSel->next = topSel->prev = NULL; ! topSel->obj = ObjPtr; UpdSelBBox(); ! move_cmd = (struct MoveSubCmdRec *)malloc( ! sizeof(struct MoveSubCmdRec)); sub_cmd = (struct SubCmdRec *)malloc(sizeof(struct SubCmdRec)); if (move_cmd == NULL || sub_cmd == NULL) FailAllocMessage(); *************** *** 634,693 **** } ! void MoveSel(OrigX, OrigY, ObjPtr, down_button_ev) ! int OrigX, OrigY; ! struct ObjRec *ObjPtr; ! XButtonEvent *down_button_ev; ! { ! register int i, num_pts=0; ! struct PolyRec *poly_ptr=NULL; ! struct PolygonRec *polygon_ptr=NULL; ! struct ArcRec *arc_ptr=NULL; ! struct ObjRec *arc_obj_ptr=NULL; ! struct BBRec bbox, o_bbox; ! IntPoint *cntrlv=NULL, *polyv=NULL; ! XPoint obj_obbox_vs[5], *v=NULL, *sv=NULL, *pv=NULL; ! int ltx=0, lty=0, rbx=0, rby=0, sn=0; ! int sel_ltx, sel_lty, sel_rbx, sel_rby, curved=FALSE; ! int ruler_ltx, ruler_lty, ruler_rbx, ruler_rby; ! int x, y, moving=TRUE, dx, dy; ! int w=0, h=0, angle1=0, angle2=0; ! int xc=0, yc=0, x1=0, y1=0, x2=0, y2=0; ! int grid_x=OrigX, grid_y=OrigY, radius=0; ! int saved_xc=0, saved_yc=0, saved_x1=0, saved_y1=0; ! int saved_x2=0, saved_y2=0; ! int saved_ltx=0, saved_lty=0, intn=0; ! char buf[80], x_buf[80], y_buf[80], *smooth=NULL; ! XEvent ev; ! Time down_click_time=(Time)0; ! if (down_button_ev != NULL) { ! down_click_time = down_button_ev->time; ! } ! if (numObjSelected == numObjLocked || ObjPtr->locked) { ! MsgBox("Locked object(s) cannot be moved.", TOOL_NAME, INFO_MB); ! return; ! } ! XFlush(mainDisplay); ! XSync(mainDisplay, False); ! if (XCheckMaskEvent(mainDisplay, ExposureMask, &ev) || ! XCheckMaskEvent(mainDisplay, VisibilityChangeMask, &ev)) { ! ExposeEventHandler(&ev, TRUE); ! } ! sel_ltx = OFFSET_X(selNoLockLtX) - 1; sel_lty = OFFSET_Y(selNoLockLtY) - 1; ! sel_rbx = OFFSET_X(selNoLockRbX) + 1; sel_rby = OFFSET_Y(selNoLockRbY) + 1; ! ruler_ltx = OFFSET_X(selNoLockObjLtX); ruler_lty = OFFSET_Y(selNoLockObjLtY); ! ruler_rbx = OFFSET_X(selNoLockObjRbX); ruler_rby = OFFSET_Y(selNoLockObjRbY); ! SelBox(drawWindow, revDefaultGC, sel_ltx, sel_lty, sel_rbx, sel_rby); ! PixelToMeasurementUnit(x_buf, 0); ! PixelToMeasurementUnit(y_buf, 0); ! sprintf(buf, "dx=%s\ndy=%s", x_buf, y_buf); ! StartShowMeasureCursor(OrigX, OrigY, buf, TRUE); ! BeginIntervalRulers(ruler_ltx, ruler_lty, ruler_rbx, ruler_rby); ! switch (ObjPtr->type) { case OBJ_BOX: case OBJ_XBM: --- 636,704 ---- } ! typedef struct tagRubberRec { ! struct BBRec obbox; ! XPoint *sv, *pv; ! int sn; ! int radius; /* for rcbox */ ! XPoint *v; /* for oval, poly or polygon */ ! int num_pts, curved, intn; /* for oval, poly or polygon */ ! IntPoint *cntrlv, *polyv; /* for poly or polygon */ ! char *smooth; /* for poly or polygon */ ! int ltx, lty, w, h, angle1, angle2, fill; /* for arc */ ! int saved_xc, saved_yc, saved_x1, saved_y1; /* for arc */ ! int saved_x2, saved_y2, saved_ltx, saved_lty; /* for arc */ ! int xc, yc, x1, y1, x2, y2; /* for arc */ ! } RubberInfo; ! static ! void FreeRubberInfo(pInnerObj, pRubberInfo) ! struct ObjRec *pInnerObj; ! RubberInfo *pRubberInfo; ! { ! switch (pInnerObj->type) { ! case OBJ_ARC: ! if (pInnerObj->ctm != NULL) { ! free(pRubberInfo->sv); ! free(pRubberInfo->pv); ! } ! break; ! case OBJ_RCBOX: ! case OBJ_OVAL: ! if (pInnerObj->ctm != NULL) { ! free(pRubberInfo->sv); ! free(pRubberInfo->pv); ! } ! break; ! case OBJ_POLY: ! case OBJ_POLYGON: ! if (splineRubberband) { ! if (pRubberInfo->sv != NULL) free(pRubberInfo->sv); ! if (pRubberInfo->polyv != NULL) free(pRubberInfo->polyv); ! if (pRubberInfo->smooth != NULL) free(pRubberInfo->smooth); ! if (pRubberInfo->curved == LT_INTSPLINE && ! pRubberInfo->cntrlv != NULL) { ! free(pRubberInfo->cntrlv); ! } ! } else { ! free(pRubberInfo->v); ! } ! break; ! } ! } ! static ! void SetRubberInfo(pInnerObj, pRubberInfo) ! struct ObjRec *pInnerObj; ! RubberInfo *pRubberInfo; ! { ! int i=0; ! struct PolyRec *poly_ptr=NULL; ! struct PolygonRec *polygon_ptr=NULL; ! ! switch (pInnerObj->type) { case OBJ_BOX: case OBJ_XBM: *************** *** 694,771 **** case OBJ_XPM: case OBJ_TEXT: ! if (ObjPtr->ctm == NULL) { ! ltx = OFFSET_X(ObjPtr->obbox.ltx); ! lty = OFFSET_Y(ObjPtr->obbox.lty); ! rbx = OFFSET_X(ObjPtr->obbox.rbx); ! rby = OFFSET_Y(ObjPtr->obbox.rby); ! SelBox(drawWindow, revDefaultGC, ltx, lty, rbx, rby); } else { ! memcpy(obj_obbox_vs, ObjPtr->rotated_obbox, 5*sizeof(XPoint)); ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, obj_obbox_vs, 5, ! CoordModeOrigin); } break; case OBJ_RCBOX: ! if (ObjPtr->ctm == NULL) { ! ltx = OFFSET_X(ObjPtr->obbox.ltx); ! lty = OFFSET_Y(ObjPtr->obbox.lty); ! rbx = OFFSET_X(ObjPtr->obbox.rbx); ! rby = OFFSET_Y(ObjPtr->obbox.rby); ! radius = ObjPtr->detail.rcb->radius; ! SetRCBoxVertex(ltx, lty, rbx, rby, radius); ! MyRCBox(drawWindow, revDefaultGC, ltx, lty, rbx, rby, radius); } else { ! sn = ObjPtr->detail.rcb->rotated_n; ! sv = (XPoint*)malloc(sn*sizeof(XPoint)); ! pv = (XPoint*)malloc(sn*sizeof(XPoint)); ! if (sv == NULL || pv == NULL) FailAllocMessage(); ! for (i=0; i < sn; i++) { ! pv[i].x = sv[i].x = ObjPtr->detail.rcb->rotated_vlist[i].x; ! pv[i].y = sv[i].y = ObjPtr->detail.rcb->rotated_vlist[i].y; } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); } break; case OBJ_ARC: ! if (ObjPtr->ctm == NULL) { ! arc_obj_ptr = DupObj(ObjPtr); ! arc_ptr = arc_obj_ptr->detail.a; ! ltx = OFFSET_X(arc_ptr->ltx); lty = OFFSET_Y(arc_ptr->lty); ! w = OFFSET_X(arc_ptr->ltx+arc_ptr->w)-ltx; ! h = OFFSET_Y(arc_ptr->lty+arc_ptr->h)-lty; ! angle1 = arc_ptr->angle1; angle2 = arc_ptr->angle2; ! xc = OFFSET_X(arc_ptr->xc); yc = OFFSET_Y(arc_ptr->yc); ! x1 = OFFSET_X(arc_ptr->x1); y1 = OFFSET_Y(arc_ptr->y1); ! ArcRealX2Y2(arc_ptr, &x2, &y2); ! x2 = OFFSET_X(x2); y2 = OFFSET_Y(y2); ! saved_xc = xc; saved_yc = yc; ! saved_x1 = x1; saved_y1 = y1; ! saved_x2 = x2; saved_y2 = y2; ! saved_ltx = ltx; saved_lty = lty; ! if (!(arc_ptr->fill == NONEPAT || ! (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, xc, yc, x1, y1); ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, xc, yc, x2, y2); ! } ! XDrawArc(mainDisplay, drawWindow, revDefaultGC, ltx, lty, w, h, ! angle1, angle2); } else { ! arc_ptr = ObjPtr->detail.a; ! sn = ObjPtr->detail.a->rotated_n; ! sv = (XPoint*)malloc((sn+2)*sizeof(XPoint)); ! pv = (XPoint*)malloc((sn+2)*sizeof(XPoint)); ! if (sv == NULL || pv == NULL) FailAllocMessage(); ! for (i=0; i < sn+2; i++) { ! pv[i].x = sv[i].x = ObjPtr->detail.a->rotated_vlist[i].x; ! pv[i].y = sv[i].y = ObjPtr->detail.a->rotated_vlist[i].y; } ! if (!(arc_ptr->fill == NONEPAT || ! (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn+2, ! CoordModeOrigin); ! } else { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); } } --- 705,776 ---- case OBJ_XPM: case OBJ_TEXT: ! if (pInnerObj->ctm == NULL) { ! pRubberInfo->obbox.ltx = OFFSET_X(pInnerObj->obbox.ltx); ! pRubberInfo->obbox.lty = OFFSET_Y(pInnerObj->obbox.lty); ! pRubberInfo->obbox.rbx = OFFSET_X(pInnerObj->obbox.rbx); ! pRubberInfo->obbox.rby = OFFSET_Y(pInnerObj->obbox.rby); } else { ! /* no need to do anything here, everything is computed */ } break; case OBJ_RCBOX: ! if (pInnerObj->ctm == NULL) { ! pRubberInfo->obbox.ltx = OFFSET_X(pInnerObj->obbox.ltx); ! pRubberInfo->obbox.lty = OFFSET_Y(pInnerObj->obbox.lty); ! pRubberInfo->obbox.rbx = OFFSET_X(pInnerObj->obbox.rbx); ! pRubberInfo->obbox.rby = OFFSET_Y(pInnerObj->obbox.rby); ! pRubberInfo->radius = pInnerObj->detail.rcb->radius; } else { ! pRubberInfo->sn = pInnerObj->detail.rcb->rotated_n; ! pRubberInfo->sv = (XPoint*)malloc(pRubberInfo->sn*sizeof(XPoint)); ! pRubberInfo->pv = (XPoint*)malloc(pRubberInfo->sn*sizeof(XPoint)); ! if (pRubberInfo->sv == NULL || pRubberInfo->pv == NULL) { ! FailAllocMessage(); } ! for (i=0; i < pRubberInfo->sn; i++) { ! pRubberInfo->pv[i].x = pInnerObj->detail.rcb->rotated_vlist[i].x; ! pRubberInfo->pv[i].y = pInnerObj->detail.rcb->rotated_vlist[i].y; ! } } break; case OBJ_ARC: ! if (pInnerObj->ctm == NULL) { ! struct ObjRec *arc_obj_ptr=DupObj(pInnerObj); ! struct ArcRec *arc_ptr=arc_obj_ptr->detail.a; ! ! pRubberInfo->fill = arc_ptr->fill; ! pRubberInfo->ltx = OFFSET_X(arc_ptr->ltx); ! pRubberInfo->lty = OFFSET_Y(arc_ptr->lty); ! pRubberInfo->w = OFFSET_X(arc_ptr->ltx+arc_ptr->w)-pRubberInfo->ltx; ! pRubberInfo->h = OFFSET_Y(arc_ptr->lty+arc_ptr->h)-pRubberInfo->lty; ! pRubberInfo->angle1 = arc_ptr->angle1; ! pRubberInfo->angle2 = arc_ptr->angle2; ! pRubberInfo->xc = OFFSET_X(arc_ptr->xc); ! pRubberInfo->yc = OFFSET_Y(arc_ptr->yc); ! pRubberInfo->x1 = OFFSET_X(arc_ptr->x1); ! pRubberInfo->y1 = OFFSET_Y(arc_ptr->y1); ! ArcRealX2Y2(arc_ptr, &pRubberInfo->x2, &pRubberInfo->y2); ! pRubberInfo->x2 = OFFSET_X(pRubberInfo->x2); ! pRubberInfo->y2 = OFFSET_Y(pRubberInfo->y2); ! pRubberInfo->saved_xc = pRubberInfo->xc; ! pRubberInfo->saved_yc = pRubberInfo->yc; ! pRubberInfo->saved_x1 = pRubberInfo->x1; ! pRubberInfo->saved_y1 = pRubberInfo->y1; ! pRubberInfo->saved_x2 = pRubberInfo->x2; ! pRubberInfo->saved_y2 = pRubberInfo->y2; ! pRubberInfo->saved_ltx = pRubberInfo->ltx; ! pRubberInfo->saved_lty = pRubberInfo->lty; ! ! FreeArcObj(arc_obj_ptr); } else { ! pRubberInfo->sn = pInnerObj->detail.a->rotated_n; ! pRubberInfo->sv = (XPoint*)malloc((pRubberInfo->sn+2)*sizeof(XPoint)); ! pRubberInfo->pv = (XPoint*)malloc((pRubberInfo->sn+2)*sizeof(XPoint)); ! if (pRubberInfo->sv == NULL || pRubberInfo->pv == NULL) { ! FailAllocMessage(); } ! for (i=0; i < pRubberInfo->sn+2; i++) { ! pRubberInfo->pv[i].x = pInnerObj->detail.a->rotated_vlist[i].x; ! pRubberInfo->pv[i].y = pInnerObj->detail.a->rotated_vlist[i].y; } } *************** *** 772,889 **** break; case OBJ_OVAL: ! if (ObjPtr->ctm == NULL) { ! num_pts = 13; ! bbox.ltx = OFFSET_X(ObjPtr->obbox.ltx); ! bbox.lty = OFFSET_Y(ObjPtr->obbox.lty); ! bbox.rbx = OFFSET_X(ObjPtr->obbox.rbx); ! bbox.rby = OFFSET_Y(ObjPtr->obbox.rby); ! MyOval(drawWindow, revDefaultGC, bbox); } else { ! sn = ObjPtr->detail.o->rotated_n; ! sv = (XPoint*)malloc(sn*sizeof(XPoint)); ! pv = (XPoint*)malloc(sn*sizeof(XPoint)); ! if (sv == NULL || pv == NULL) FailAllocMessage(); ! for (i=0; i < sn; i++) { ! pv[i].x = sv[i].x = ObjPtr->detail.o->rotated_vlist[i].x; ! pv[i].y = sv[i].y = ObjPtr->detail.o->rotated_vlist[i].y; } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); } break; case OBJ_POLY: ! poly_ptr = ObjPtr->detail.p; ! curved = poly_ptr->curved; ! num_pts = poly_ptr->n; if (splineRubberband) { ! polyv = (IntPoint*)malloc((num_pts+1)*sizeof(IntPoint)); ! if (polyv == NULL) FailAllocMessage(); ! if (curved != LT_INTSPLINE && poly_ptr->smooth != NULL) { ! smooth = (char*)malloc((num_pts+1)*sizeof(char)); ! if (smooth == NULL) FailAllocMessage(); } ! if (ObjPtr->ctm == NULL) { ! for (i=0; i < num_pts; i++) { ! polyv[i].x = poly_ptr->vlist[i].x; ! polyv[i].y = poly_ptr->vlist[i].y; ! if (smooth != NULL) smooth[i] = poly_ptr->smooth[i]; } } else { ! for (i=0; i < num_pts; i++) { ! int x, y; ! TransformPointThroughCTM(poly_ptr->vlist[i].x-ObjPtr->x, ! poly_ptr->vlist[i].y-ObjPtr->y, ObjPtr->ctm, &x, &y); ! polyv[i].x = x+ObjPtr->x; ! polyv[i].y = y+ObjPtr->y; ! if (smooth != NULL) smooth[i] = poly_ptr->smooth[i]; } } ! if (curved != LT_INTSPLINE) { ! sv = MakeMultiSplinePolyVertex(&sn, smooth, ! drawOrigX, drawOrigY, num_pts, polyv); } else { ! sv = MakeIntSplinePolyVertex(&sn, &intn, &cntrlv, drawOrigX, ! drawOrigY, num_pts, polyv); } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, - CoordModeOrigin); } else { ! v = (XPoint*)malloc((num_pts+1)*sizeof(XPoint)); ! if (v == NULL) FailAllocMessage(); ! for (i=0; i < num_pts; i++) { ! v[i].x = OFFSET_X(poly_ptr->vlist[i].x); ! v[i].y = OFFSET_Y(poly_ptr->vlist[i].y); } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, v, num_pts, - CoordModeOrigin); } break; case OBJ_POLYGON: ! polygon_ptr = ObjPtr->detail.g; ! curved = polygon_ptr->curved; ! num_pts = polygon_ptr->n; if (splineRubberband) { ! polyv = (IntPoint*)malloc((num_pts+1)*sizeof(IntPoint)); ! if (polyv == NULL) FailAllocMessage(); ! if (curved != LT_INTSPLINE && polygon_ptr->smooth != NULL) { ! smooth = (char*)malloc((num_pts+1)*sizeof(char)); ! if (smooth == NULL) FailAllocMessage(); } ! if (ObjPtr->ctm == NULL) { ! for (i=0; i < num_pts; i++) { ! polyv[i].x = polygon_ptr->vlist[i].x; ! polyv[i].y = polygon_ptr->vlist[i].y; ! if (smooth != NULL) smooth[i] = polygon_ptr->smooth[i]; } } else { ! for (i=0; i < num_pts; i++) { ! int x, y; ! TransformPointThroughCTM(polygon_ptr->vlist[i].x-ObjPtr->x, ! polygon_ptr->vlist[i].y-ObjPtr->y, ObjPtr->ctm, &x, &y); ! polyv[i].x = x+ObjPtr->x; ! polyv[i].y = y+ObjPtr->y; ! if (smooth != NULL) smooth[i] = polygon_ptr->smooth[i]; } } ! if (curved != LT_INTSPLINE) { ! sv = MakeMultiSplinePolygonVertex(&sn, smooth, ! drawOrigX, drawOrigY, num_pts, polyv); } else { ! sv = MakeIntSplinePolygonVertex(&sn, &intn, &cntrlv, ! drawOrigX, drawOrigY, num_pts, polyv); } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, - CoordModeOrigin); } else { ! v = (XPoint*)malloc((num_pts+1)*sizeof(XPoint)); ! if (v == NULL) FailAllocMessage(); ! for (i=0; i < num_pts; i++) { ! v[i].x = OFFSET_X(polygon_ptr->vlist[i].x); ! v[i].y = OFFSET_Y(polygon_ptr->vlist[i].y); } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, v, num_pts, - CoordModeOrigin); } break; --- 777,905 ---- break; case OBJ_OVAL: ! if (pInnerObj->ctm == NULL) { ! pRubberInfo->num_pts = 13; ! pRubberInfo->obbox.ltx = OFFSET_X(pInnerObj->obbox.ltx); ! pRubberInfo->obbox.lty = OFFSET_Y(pInnerObj->obbox.lty); ! pRubberInfo->obbox.rbx = OFFSET_X(pInnerObj->obbox.rbx); ! pRubberInfo->obbox.rby = OFFSET_Y(pInnerObj->obbox.rby); } else { ! pRubberInfo->sn = pInnerObj->detail.o->rotated_n; ! pRubberInfo->sv = (XPoint*)malloc(pRubberInfo->sn*sizeof(XPoint)); ! pRubberInfo->pv = (XPoint*)malloc(pRubberInfo->sn*sizeof(XPoint)); ! if (pRubberInfo->sv == NULL || pRubberInfo->pv == NULL) { ! FailAllocMessage(); } ! for (i=0; i < pRubberInfo->sn; i++) { ! pRubberInfo->pv[i].x = pInnerObj->detail.o->rotated_vlist[i].x; ! pRubberInfo->pv[i].y = pInnerObj->detail.o->rotated_vlist[i].y; ! } } break; case OBJ_POLY: ! poly_ptr = pInnerObj->detail.p; ! pRubberInfo->curved = poly_ptr->curved; ! pRubberInfo->num_pts = poly_ptr->n; if (splineRubberband) { ! pRubberInfo->polyv = ! (IntPoint*)malloc((pRubberInfo->num_pts+1)*sizeof(IntPoint)); ! if (pRubberInfo->polyv == NULL) FailAllocMessage(); ! if (pRubberInfo->curved != LT_INTSPLINE && poly_ptr->smooth != NULL) { ! pRubberInfo->smooth = ! (char*)malloc((pRubberInfo->num_pts+1)*sizeof(char)); ! if (pRubberInfo->smooth == NULL) FailAllocMessage(); } ! if (pInnerObj->ctm == NULL) { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->polyv[i].x = poly_ptr->vlist[i].x; ! pRubberInfo->polyv[i].y = poly_ptr->vlist[i].y; ! if (pRubberInfo->smooth != NULL) { ! pRubberInfo->smooth[i] = poly_ptr->smooth[i]; ! } } } else { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! int x=0, y=0; ! TransformPointThroughCTM(poly_ptr->vlist[i].x-pInnerObj->x, ! poly_ptr->vlist[i].y-pInnerObj->y, pInnerObj->ctm, &x, &y); ! pRubberInfo->polyv[i].x = x+pInnerObj->x; ! pRubberInfo->polyv[i].y = y+pInnerObj->y; ! if (pRubberInfo->smooth != NULL) { ! pRubberInfo->smooth[i] = poly_ptr->smooth[i]; ! } } } ! if (pRubberInfo->curved != LT_INTSPLINE) { ! pRubberInfo->sv = MakeMultiSplinePolyVertex(&pRubberInfo->sn, ! pRubberInfo->smooth, drawOrigX, drawOrigY, ! pRubberInfo->num_pts, pRubberInfo->polyv); } else { ! pRubberInfo->sv = MakeIntSplinePolyVertex(&pRubberInfo->sn, ! &pRubberInfo->intn, &pRubberInfo->cntrlv, drawOrigX, ! drawOrigY, pRubberInfo->num_pts, pRubberInfo->polyv); } } else { ! pRubberInfo->v = ! (XPoint*)malloc((pRubberInfo->num_pts+1)*sizeof(XPoint)); ! if (pRubberInfo->v == NULL) FailAllocMessage(); ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->v[i].x = OFFSET_X(poly_ptr->vlist[i].x); ! pRubberInfo->v[i].y = OFFSET_Y(poly_ptr->vlist[i].y); } } break; case OBJ_POLYGON: ! polygon_ptr = pInnerObj->detail.g; ! pRubberInfo->curved = polygon_ptr->curved; ! pRubberInfo->num_pts = polygon_ptr->n; if (splineRubberband) { ! pRubberInfo->polyv = ! (IntPoint*)malloc((pRubberInfo->num_pts+1)*sizeof(IntPoint)); ! if (pRubberInfo->polyv == NULL) FailAllocMessage(); ! if (pRubberInfo->curved != LT_INTSPLINE && ! polygon_ptr->smooth != NULL) { ! pRubberInfo->smooth = ! (char*)malloc((pRubberInfo->num_pts+1)*sizeof(char)); ! if (pRubberInfo->smooth == NULL) FailAllocMessage(); } ! if (pInnerObj->ctm == NULL) { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->polyv[i].x = polygon_ptr->vlist[i].x; ! pRubberInfo->polyv[i].y = polygon_ptr->vlist[i].y; ! if (pRubberInfo->smooth != NULL) { ! pRubberInfo->smooth[i] = polygon_ptr->smooth[i]; ! } } } else { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! int x=0, y=0; ! TransformPointThroughCTM(polygon_ptr->vlist[i].x-pInnerObj->x, ! polygon_ptr->vlist[i].y-pInnerObj->y, pInnerObj->ctm, ! &x, &y); ! pRubberInfo->polyv[i].x = x+pInnerObj->x; ! pRubberInfo->polyv[i].y = y+pInnerObj->y; ! if (pRubberInfo->smooth != NULL) { ! pRubberInfo->smooth[i] = polygon_ptr->smooth[i]; ! } } } ! if (pRubberInfo->curved != LT_INTSPLINE) { ! pRubberInfo->sv = MakeMultiSplinePolygonVertex(&pRubberInfo->sn, ! pRubberInfo->smooth, drawOrigX, drawOrigY, ! pRubberInfo->num_pts, pRubberInfo->polyv); } else { ! pRubberInfo->sv = MakeIntSplinePolygonVertex(&pRubberInfo->sn, ! &pRubberInfo->intn, &pRubberInfo->cntrlv, drawOrigX, ! drawOrigY, pRubberInfo->num_pts, pRubberInfo->polyv); } } else { ! pRubberInfo->v = ! (XPoint*)malloc((pRubberInfo->num_pts+1)*sizeof(XPoint)); ! if (pRubberInfo->v == NULL) FailAllocMessage(); ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->v[i].x = OFFSET_X(polygon_ptr->vlist[i].x); ! pRubberInfo->v[i].y = OFFSET_Y(polygon_ptr->vlist[i].y); } } break; *************** *** 892,1013 **** case OBJ_SYM: case OBJ_PIN: ! ltx = OFFSET_X(ObjPtr->obbox.ltx); lty = OFFSET_Y(ObjPtr->obbox.lty); ! rbx = OFFSET_X(ObjPtr->obbox.rbx); rby = OFFSET_Y(ObjPtr->obbox.rby); ! SelBox(drawWindow, revDefaultGC, ltx, lty, rbx, rby); break; } ! XGrabPointer(mainDisplay, drawWindow, FALSE, ! PointerMotionMask | ButtonReleaseMask, ! GrabModeAsync, GrabModeAsync, None, moveCursor, CurrentTime); ! dx = dy = 0; ! while (moving) { ! XEvent input; ! XNextEvent(mainDisplay, &input); ! if (input.type == Expose || input.type == VisibilityNotify) { ! ExposeEventHandler(&input, TRUE); ! } else if (input.type == ButtonRelease) { ! Time release_time=input.xbutton.time; ! XUngrabPointer(mainDisplay, CurrentTime); ! XSync(mainDisplay, False); ! moving = FALSE; ! switch (ObjPtr->type) { ! case OBJ_BOX: ! case OBJ_XBM: ! case OBJ_XPM: ! case OBJ_TEXT: ! if (ObjPtr->ctm == NULL) { ! SelBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy); ! } else { ! for (i=0; i < 5; i++) { ! obj_obbox_vs[i].x = ObjPtr->rotated_obbox[i].x+dx; ! obj_obbox_vs[i].y = ObjPtr->rotated_obbox[i].y+dy; } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, - obj_obbox_vs, 5, CoordModeOrigin); - } - break; - case OBJ_RCBOX: - if (ObjPtr->ctm == NULL) { - MyRCBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy, - radius); } else { ! for (i=0; i < sn; i++) { ! sv[i].x = pv[i].x + dx; ! sv[i].y = pv[i].y + dy; } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, - CoordModeOrigin); } ! break; ! case OBJ_OVAL: ! if (ObjPtr->ctm == NULL) { ! o_bbox.ltx = bbox.ltx + dx; o_bbox.lty = bbox.lty + dy; ! o_bbox.rbx = bbox.rbx + dx; o_bbox.rby = bbox.rby + dy; ! MyOval(drawWindow, revDefaultGC, o_bbox); } else { ! for (i=0; i < sn; i++) { ! sv[i].x = pv[i].x + dx; ! sv[i].y = pv[i].y + dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); } break; ! case OBJ_ARC: ! if (ObjPtr->ctm == NULL) { ! XDrawArc(mainDisplay, drawWindow, revDefaultGC, ltx, lty, ! w, h, angle1, angle2); ! if (!(arc_ptr->fill == NONEPAT || ! (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { ! XDrawLine(mainDisplay,drawWindow,revDefaultGC,xc,yc,x1,y1); ! XDrawLine(mainDisplay,drawWindow,revDefaultGC,xc,yc,x2,y2); } } else { ! for (i=0; i < sn+2; i++) { ! sv[i].x = pv[i].x + dx; ! sv[i].y = pv[i].y + dy; } - if (!(arc_ptr->fill == NONEPAT || - (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn+2, - CoordModeOrigin); - } else { - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, - CoordModeOrigin); - } } ! break; ! case OBJ_POLY: ! case OBJ_POLYGON: ! if (splineRubberband) { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); } else { ! for (i=0; i < num_pts; i++) { ! v[i].x += dx; ! v[i].y += dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, v, num_pts, ! CoordModeOrigin); ! for (i=0; i < num_pts; i++) { ! v[i].x -= dx; ! v[i].y -= dy; ! } } break; - case OBJ_GROUP: - case OBJ_ICON: - case OBJ_SYM: - case OBJ_PIN: - SelBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy); - break; } EndIntervalRulers(grid_x, grid_y); PixelToMeasurementUnit(x_buf, ABS_SIZE(dx)); --- 908,1263 ---- case OBJ_SYM: case OBJ_PIN: ! pRubberInfo->obbox.ltx = OFFSET_X(pInnerObj->obbox.ltx); ! pRubberInfo->obbox.lty = OFFSET_Y(pInnerObj->obbox.lty); ! pRubberInfo->obbox.rbx = OFFSET_X(pInnerObj->obbox.rbx); ! pRubberInfo->obbox.rby = OFFSET_Y(pInnerObj->obbox.rby); break; } + } ! static ! void DrawInnerRubberObj(pInnerObj, pRubberInfo, dx, dy) ! struct ObjRec *pInnerObj; ! RubberInfo *pRubberInfo; ! int dx, dy; ! { ! int i=0; ! switch (pInnerObj->type) { ! case OBJ_BOX: ! case OBJ_XBM: ! case OBJ_XPM: ! case OBJ_TEXT: ! if (pInnerObj->ctm == NULL) { ! SelBox(drawWindow, revDefaultGC, ! pRubberInfo->obbox.ltx+dx, pRubberInfo->obbox.lty+dy, ! pRubberInfo->obbox.rbx+dx, pRubberInfo->obbox.rby+dy); ! } else { ! XPoint obj_obbox_vs[5]; ! for (i=0; i < 5; i++) { ! obj_obbox_vs[i].x = pInnerObj->rotated_obbox[i].x+dx; ! obj_obbox_vs[i].y = pInnerObj->rotated_obbox[i].y+dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! obj_obbox_vs, 5, CoordModeOrigin); ! } ! break; ! case OBJ_RCBOX: ! if (pInnerObj->ctm == NULL) { ! SetRCBoxVertex( ! pRubberInfo->obbox.ltx+dx, pRubberInfo->obbox.lty+dy, ! pRubberInfo->obbox.rbx+dx, pRubberInfo->obbox.rby+dy, ! pRubberInfo->radius); ! MyRCBox(drawWindow, revDefaultGC, ! pRubberInfo->obbox.ltx, pRubberInfo->obbox.lty, ! pRubberInfo->obbox.rbx, pRubberInfo->obbox.rby, ! pRubberInfo->radius); ! } else { ! for (i=0; i < pRubberInfo->sn; i++) { ! pRubberInfo->sv[i].x = pRubberInfo->pv[i].x + dx; ! pRubberInfo->sv[i].y = pRubberInfo->pv[i].y + dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->sv, pRubberInfo->sn, CoordModeOrigin); ! } ! break; ! case OBJ_ARC: ! if (pInnerObj->ctm == NULL) { ! if (!(pRubberInfo->fill == NONEPAT || ! (pInnerObj->trans_pat && pRubberInfo->fill == BACKPAT))) { ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->xc, pRubberInfo->yc, ! pRubberInfo->x1, pRubberInfo->y1); ! XDrawLine(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->xc, pRubberInfo->yc, ! pRubberInfo->x2, pRubberInfo->y2); ! } ! XDrawArc(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->ltx, pRubberInfo->lty, ! pRubberInfo->w, pRubberInfo->h, ! pRubberInfo->angle1, pRubberInfo->angle2); ! } else { ! for (i=0; i < pRubberInfo->sn+2; i++) { ! pRubberInfo->sv[i].x = pRubberInfo->pv[i].x + dx; ! pRubberInfo->sv[i].y = pRubberInfo->pv[i].y + dy; ! } ! if (!(pRubberInfo->fill == NONEPAT || ! (pInnerObj->trans_pat && pRubberInfo->fill == BACKPAT))) { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->sv, pRubberInfo->sn+2, CoordModeOrigin); ! } else { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->sv, pRubberInfo->sn, CoordModeOrigin); ! } ! } ! break; ! case OBJ_OVAL: ! if (pInnerObj->ctm == NULL) { ! struct BBRec o_bbox; ! o_bbox.ltx = pRubberInfo->obbox.ltx+dx; ! o_bbox.lty = pRubberInfo->obbox.lty+dy; ! o_bbox.rbx = pRubberInfo->obbox.rbx+dx; ! o_bbox.rby = pRubberInfo->obbox.rby+dy; ! MyOval(drawWindow, revDefaultGC, o_bbox); ! } else { ! for (i=0; i < pRubberInfo->sn; i++) { ! pRubberInfo->sv[i].x = pRubberInfo->pv[i].x + dx; ! pRubberInfo->sv[i].y = pRubberInfo->pv[i].y + dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->sv, pRubberInfo->sn, CoordModeOrigin); ! } ! break; ! case OBJ_POLY: ! case OBJ_POLYGON: ! if (splineRubberband) { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->sv, pRubberInfo->sn, CoordModeOrigin); ! } else { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->v[i].x += dx; ! pRubberInfo->v[i].y += dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! pRubberInfo->v, pRubberInfo->num_pts, CoordModeOrigin); ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->v[i].x -= dx; ! pRubberInfo->v[i].y -= dy; ! } ! } ! break; ! case OBJ_GROUP: ! case OBJ_ICON: ! case OBJ_SYM: ! case OBJ_PIN: ! SelBox(drawWindow, revDefaultGC, ! pRubberInfo->obbox.ltx+dx, pRubberInfo->obbox.lty+dy, ! pRubberInfo->obbox.rbx+dx, pRubberInfo->obbox.rby+dy); ! break; ! } ! } ! static ! void UpdateInnerRubberObj(pInnerObj, pRubberInfo, dx, dy) ! struct ObjRec *pInnerObj; ! RubberInfo *pRubberInfo; ! int dx, dy; ! { ! int i=0; ! switch (pInnerObj->type) { ! case OBJ_ARC: ! if (pInnerObj->ctm == NULL) { ! pRubberInfo->xc = pRubberInfo->saved_xc+dx; ! pRubberInfo->yc = pRubberInfo->saved_yc+dy; ! pRubberInfo->x1 = pRubberInfo->saved_x1+dx; ! pRubberInfo->y1 = pRubberInfo->saved_y1+dy; ! pRubberInfo->x2 = pRubberInfo->saved_x2+dx; ! pRubberInfo->y2 = pRubberInfo->saved_y2+dy; ! pRubberInfo->ltx = pRubberInfo->saved_ltx+dx; ! pRubberInfo->lty = pRubberInfo->saved_lty+dy; ! } ! break; ! case OBJ_POLY: ! case OBJ_POLYGON: ! if (splineRubberband) { ! struct PolyRec *poly_ptr=NULL; ! struct PolygonRec *polygon_ptr=NULL; ! free(pRubberInfo->sv); ! ! switch (pInnerObj->type) { ! case OBJ_POLY: ! poly_ptr = pInnerObj->detail.p; ! ! if (pInnerObj->ctm == NULL) { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->polyv[i].x = poly_ptr->vlist[i].x+ABS_SIZE(dx); ! pRubberInfo->polyv[i].y = poly_ptr->vlist[i].y+ABS_SIZE(dy); } } else { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! int x=0, y=0; ! ! TransformPointThroughCTM( ! poly_ptr->vlist[i].x-pInnerObj->x, ! poly_ptr->vlist[i].y-pInnerObj->y, ! pInnerObj->ctm, &x, &y); ! pRubberInfo->polyv[i].x = x+pInnerObj->x+ABS_SIZE(dx); ! pRubberInfo->polyv[i].y = y+pInnerObj->y+ABS_SIZE(dy); } } ! if (pRubberInfo->curved != LT_INTSPLINE) { ! pRubberInfo->sv = MakeMultiSplinePolyVertex(&pRubberInfo->sn, ! pRubberInfo->smooth, drawOrigX, drawOrigY, ! pRubberInfo->num_pts, pRubberInfo->polyv); } else { ! free(pRubberInfo->cntrlv); ! pRubberInfo->sv = MakeIntSplinePolyVertex(&pRubberInfo->sn, ! &pRubberInfo->intn, &pRubberInfo->cntrlv, drawOrigX, ! drawOrigY, pRubberInfo->num_pts, pRubberInfo->polyv); } break; ! case OBJ_POLYGON: ! polygon_ptr = pInnerObj->detail.g; ! ! if (pInnerObj->ctm == NULL) { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! pRubberInfo->polyv[i].x = ! polygon_ptr->vlist[i].x+ABS_SIZE(dx); ! pRubberInfo->polyv[i].y = ! polygon_ptr->vlist[i].y+ABS_SIZE(dy); } } else { ! for (i=0; i < pRubberInfo->num_pts; i++) { ! int x=0, y=0; ! ! TransformPointThroughCTM( ! polygon_ptr->vlist[i].x-pInnerObj->x, ! polygon_ptr->vlist[i].y-pInnerObj->y, ! pInnerObj->ctm, &x, &y); ! pRubberInfo->polyv[i].x = x+pInnerObj->x+ABS_SIZE(dx); ! pRubberInfo->polyv[i].y = y+pInnerObj->y+ABS_SIZE(dy); } } ! if (pRubberInfo->curved != LT_INTSPLINE) { ! pRubberInfo->sv = MakeMultiSplinePolygonVertex(&pRubberInfo->sn, ! pRubberInfo->smooth, drawOrigX, drawOrigY, ! pRubberInfo->num_pts, pRubberInfo->polyv); } else { ! free(pRubberInfo->cntrlv); ! pRubberInfo->sv = MakeIntSplinePolygonVertex(&pRubberInfo->sn, ! &pRubberInfo->intn, &pRubberInfo->cntrlv, drawOrigX, ! drawOrigY, pRubberInfo->num_pts, pRubberInfo->polyv); } break; } + } + break; + } + } + + static + void MoveSubObjEventCheck(ev, pn_move_sub_obj) + XEvent *ev; + int *pn_move_sub_obj; + { + if (ev->type == MotionNotify) { + *pn_move_sub_obj = (ev->xmotion.state & ControlMask) && + (!(ev->xmotion.state & ShiftMask)); + } else if (ev->type == KeyPress || ev->type == KeyRelease) { + char s[80]; + KeySym key_sym; + + XLookupString(&(ev->xkey), s, sizeof(s), &key_sym, NULL); + if (key_sym == XK_Control_L || key_sym == XK_Control_R) { + *pn_move_sub_obj = (ev->type == KeyPress); + } + } + } + + void MoveAnAttr(attr_ptr, attr_owner_obj, dx, dy) + struct AttrRec *attr_ptr; + struct ObjRec *attr_owner_obj; + int dx, dy; + { + struct ObjRec *text_obj_ptr=attr_ptr->obj; + int ltx, lty, rbx, rby; + + if (attr_owner_obj == NULL) { + attr_owner_obj = GetTopOwner(attr_ptr->owner); + } + ltx = attr_owner_obj->bbox.ltx; + lty = attr_owner_obj->bbox.lty; + rbx = attr_owner_obj->bbox.rbx; + rby = attr_owner_obj->bbox.rby; + PrepareToReplaceAnObj(attr_owner_obj); + MoveObj(text_obj_ptr, dx, dy); + RecursivelyAdjObjBBox(attr_ptr->owner, attr_ptr->owner, attr_owner_obj); + RecordReplaceAnObj(attr_owner_obj); + RedrawAreas(botObj, ltx-GRID_ABS_SIZE(1), lty-GRID_ABS_SIZE(1), + rbx+GRID_ABS_SIZE(1), rby+GRID_ABS_SIZE(1), + attr_owner_obj->bbox.ltx-GRID_ABS_SIZE(1), + attr_owner_obj->bbox.lty-GRID_ABS_SIZE(1), + attr_owner_obj->bbox.rbx+GRID_ABS_SIZE(1), + attr_owner_obj->bbox.rby+GRID_ABS_SIZE(1)); + SetFileModified(TRUE); + } + + void MoveSel(OrigX, OrigY, ObjPtr, down_button_ev) + int OrigX, OrigY; + struct ObjRec *ObjPtr; + XButtonEvent *down_button_ev; + { + int sel_ltx=0, sel_lty=0, sel_rbx=0, sel_rby=0; + int ruler_ltx=0, ruler_lty=0, ruler_rbx=0, ruler_rby=0; + int moving=TRUE, dx=0, dy=0, grid_x=OrigX, grid_y=OrigY; + int can_move_sub_obj=FALSE, move_sub_obj=FALSE; + char buf[80], x_buf[80], y_buf[80]; + XEvent ev; + Time down_click_time=(Time)0; + RubberInfo rubber_info; + + if (down_button_ev != NULL) { + down_click_time = down_button_ev->time; + } + if (numObjSelected == numObjLocked || ObjPtr->locked) { + MsgBox("Locked object(s) cannot be moved.", TOOL_NAME, INFO_MB); + return; + } + XFlush(mainDisplay); + XSync(mainDisplay, False); + + if (XCheckMaskEvent(mainDisplay, ExposureMask, &ev) || + XCheckMaskEvent(mainDisplay, VisibilityChangeMask, &ev)) { + ExposeEventHandler(&ev, TRUE); + } + if (ObjPtr->type == OBJ_TEXT && ObjPtr->detail.t->attr != NULL) { + can_move_sub_obj = TRUE; + sprintf(gszMsgBox, "(HINT: %s %s.)", + "You can hold down key to move only the attribute", + "under the cursor"); + SetStringStatus(gszMsgBox); + } + sel_ltx = OFFSET_X(selNoLockLtX) - 1; sel_lty = OFFSET_Y(selNoLockLtY) - 1; + sel_rbx = OFFSET_X(selNoLockRbX) + 1; sel_rby = OFFSET_Y(selNoLockRbY) + 1; + + ruler_ltx = OFFSET_X(selNoLockObjLtX); ruler_lty = OFFSET_Y(selNoLockObjLtY); + ruler_rbx = OFFSET_X(selNoLockObjRbX); ruler_rby = OFFSET_Y(selNoLockObjRbY); + + SelBox(drawWindow, revDefaultGC, sel_ltx, sel_lty, sel_rbx, sel_rby); + PixelToMeasurementUnit(x_buf, 0); + PixelToMeasurementUnit(y_buf, 0); + sprintf(buf, "dx=%s\ndy=%s", x_buf, y_buf); + StartShowMeasureCursor(OrigX, OrigY, buf, TRUE); + BeginIntervalRulers(ruler_ltx, ruler_lty, ruler_rbx, ruler_rby); + + memset(&rubber_info, 0, sizeof(RubberInfo)); + SetRubberInfo(ObjPtr, &rubber_info); + DrawInnerRubberObj(ObjPtr, &rubber_info, 0, 0); + + if (!debugNoPointerGrab) { + XGrabPointer(mainDisplay, drawWindow, FALSE, + PointerMotionMask | ButtonReleaseMask, + GrabModeAsync, GrabModeAsync, None, moveCursor, CurrentTime); + } + dx = dy = 0; + + while (moving) { + XEvent input; + + XNextEvent(mainDisplay, &input); + + if (input.type == Expose || input.type == VisibilityNotify) { + ExposeEventHandler(&input, TRUE); + } else if (input.type == ButtonRelease) { + Time release_time=input.xbutton.time; + + XUngrabPointer(mainDisplay, CurrentTime); + XSync(mainDisplay, False); + moving = FALSE; + EndIntervalRulers(grid_x, grid_y); PixelToMeasurementUnit(x_buf, ABS_SIZE(dx)); *************** *** 1015,1020 **** sprintf(buf, "dx=%s\ndy=%s", x_buf, y_buf); EndShowMeasureCursor(grid_x, grid_y, buf, TRUE); ! SelBox(drawWindow, revDefaultGC, sel_ltx+dx, sel_lty+dy, sel_rbx+dx, ! sel_rby+dy); dx = grid_x - OrigX; --- 1265,1273 ---- sprintf(buf, "dx=%s\ndy=%s", x_buf, y_buf); EndShowMeasureCursor(grid_x, grid_y, buf, TRUE); ! if (!move_sub_obj) { ! SelBox(drawWindow, revDefaultGC, sel_ltx+dx, sel_lty+dy, sel_rbx+dx, ! sel_rby+dy); ! } ! DrawInnerRubberObj(ObjPtr, &rubber_info, dx, dy); dx = grid_x - OrigX; *************** *** 1021,1054 **** dy = grid_y - OrigY; - switch (ObjPtr->type) { - case OBJ_ARC: - if (ObjPtr->ctm != NULL) { - free(sv); - free(pv); - } else { - FreeArcObj(arc_obj_ptr); - } - break; - - case OBJ_RCBOX: - case OBJ_OVAL: - if (ObjPtr->ctm != NULL) { - free(sv); - free(pv); - } - break; - - case OBJ_POLY: - case OBJ_POLYGON: - if (splineRubberband) { - if (sv != NULL) free(sv); - if (polyv != NULL) free(polyv); - if (smooth != NULL) free(smooth); - if (curved == LT_INTSPLINE && cntrlv != NULL) free(cntrlv); - } else { - free(v); - } - break; - } if (oneMotionSelectMove && down_button_ev != NULL && (release_time-down_click_time) < oneMotionTimeout) { --- 1274,1277 ---- *************** *** 1058,1080 **** dx = dy = 0; } - if (dx != 0 || dy != 0) { - HighLightReverse(); - dx = ABS_SIZE(dx); - dy = ABS_SIZE(dy); - if (numObjSelected == numObjLocked) { - HighLightForward(); - return; - } - MoveAllSel(dx, dy); - HighLightForward(); - UpdSelBBox(); - if (justDupped) { - dupDx += dx; - dupDy += dy; - } - SetFileModified(TRUE); - } } else if (input.type == MotionNotify || input.type == KeyPress || input.type == KeyRelease) { PixelToMeasurementUnit(x_buf, ABS_SIZE(dx)); PixelToMeasurementUnit(y_buf, ABS_SIZE(dy)); --- 1281,1288 ---- dx = dy = 0; } } else if (input.type == MotionNotify || input.type == KeyPress || input.type == KeyRelease) { + int x=0, y=0, saved_move_sub_obj=move_sub_obj; + PixelToMeasurementUnit(x_buf, ABS_SIZE(dx)); PixelToMeasurementUnit(y_buf, ABS_SIZE(dy)); *************** *** 1096,1197 **** DiagGridXY(OrigX, OrigY, &x, &y); } } GridXY(x, y, &grid_x, &grid_y); ! switch (ObjPtr->type) { ! case OBJ_BOX: ! case OBJ_XBM: ! case OBJ_XPM: ! case OBJ_TEXT: ! if (ObjPtr->ctm == NULL) { ! SelBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy); ! } else { ! for (i=0; i < 5; i++) { ! obj_obbox_vs[i].x = ObjPtr->rotated_obbox[i].x+dx; ! obj_obbox_vs[i].y = ObjPtr->rotated_obbox[i].y+dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, ! obj_obbox_vs, 5, CoordModeOrigin); ! } ! break; ! case OBJ_RCBOX: ! if (ObjPtr->ctm == NULL) { ! MyRCBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy, ! radius); ! } else { ! for (i=0; i < sn; i++) { ! sv[i].x = pv[i].x + dx; ! sv[i].y = pv[i].y + dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); ! } ! break; ! case OBJ_ARC: ! if (ObjPtr->ctm == NULL) { ! XDrawArc(mainDisplay, drawWindow, revDefaultGC, ltx, lty, ! w, h, angle1, angle2); ! if (!(arc_ptr->fill == NONEPAT || ! (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { ! XDrawLine(mainDisplay,drawWindow,revDefaultGC,xc,yc,x1,y1); ! XDrawLine(mainDisplay,drawWindow,revDefaultGC,xc,yc,x2,y2); ! } ! } else { ! for (i=0; i < sn+2; i++) { ! sv[i].x = pv[i].x + dx; ! sv[i].y = pv[i].y + dy; ! } ! if (!(arc_ptr->fill == NONEPAT || ! (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn+2, ! CoordModeOrigin); ! } else { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); ! } ! } ! break; ! case OBJ_OVAL: ! if (ObjPtr->ctm == NULL) { ! o_bbox.ltx = bbox.ltx + dx; o_bbox.lty = bbox.lty + dy; ! o_bbox.rbx = bbox.rbx + dx; o_bbox.rby = bbox.rby + dy; ! MyOval(drawWindow, revDefaultGC, o_bbox); ! } else { ! for (i=0; i < sn; i++) { ! sv[i].x = pv[i].x + dx; ! sv[i].y = pv[i].y + dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); ! } ! break; ! case OBJ_POLY: ! case OBJ_POLYGON: ! if (splineRubberband) { ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, ! CoordModeOrigin); ! } else { ! for (i=0; i < num_pts; i++) { ! v[i].x += dx; ! v[i].y += dy; ! } ! XDrawLines(mainDisplay, drawWindow, revDefaultGC, v, num_pts, ! CoordModeOrigin); ! for (i=0; i < num_pts; i++) { ! v[i].x -= dx; ! v[i].y -= dy; ! } ! } ! break; ! case OBJ_GROUP: ! case OBJ_ICON: ! case OBJ_SYM: ! case OBJ_PIN: ! SelBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy); ! break; } - SelBox(drawWindow, revDefaultGC, sel_ltx+dx, sel_lty+dy, sel_rbx+dx, - sel_rby+dy); - dx = grid_x - OrigX; dy = grid_y - OrigY; --- 1304,1318 ---- DiagGridXY(OrigX, OrigY, &x, &y); } + } else if (can_move_sub_obj) { + MoveSubObjEventCheck(&input, &move_sub_obj); } GridXY(x, y, &grid_x, &grid_y); ! /* erase */ ! DrawInnerRubberObj(ObjPtr, &rubber_info, dx, dy); ! if (!saved_move_sub_obj) { ! SelBox(drawWindow, revDefaultGC, sel_ltx+dx, sel_lty+dy, sel_rbx+dx, ! sel_rby+dy); } dx = grid_x - OrigX; dy = grid_y - OrigY; *************** *** 1199,1204 **** DrawIntervalRulers(ruler_ltx+dx, ruler_lty+dy, ruler_rbx+dx, ruler_rby+dy); ! SelBox(drawWindow, revDefaultGC, sel_ltx+dx, sel_lty+dy, sel_rbx+dx, ! sel_rby+dy); PixelToMeasurementUnit(x_buf, ABS_SIZE(dx)); PixelToMeasurementUnit(y_buf, ABS_SIZE(dy)); --- 1320,1327 ---- DrawIntervalRulers(ruler_ltx+dx, ruler_lty+dy, ruler_rbx+dx, ruler_rby+dy); ! if (!move_sub_obj) { ! SelBox(drawWindow, revDefaultGC, sel_ltx+dx, sel_lty+dy, sel_rbx+dx, ! sel_rby+dy); ! } PixelToMeasurementUnit(x_buf, ABS_SIZE(dx)); PixelToMeasurementUnit(y_buf, ABS_SIZE(dy)); *************** *** 1205,1366 **** sprintf(buf, "dx=%s\ndy=%s", x_buf, y_buf); ShowMeasureCursor(grid_x, grid_y, buf, TRUE); - switch (ObjPtr->type) { - case OBJ_BOX: - case OBJ_XBM: - case OBJ_XPM: - case OBJ_TEXT: - if (ObjPtr->ctm == NULL) { - SelBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy); - } else { - for (i=0; i < 5; i++) { - obj_obbox_vs[i].x = ObjPtr->rotated_obbox[i].x+dx; - obj_obbox_vs[i].y = ObjPtr->rotated_obbox[i].y+dy; - } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, - obj_obbox_vs, 5, CoordModeOrigin); - } - break; - case OBJ_RCBOX: - if (ObjPtr->ctm == NULL) { - SetRCBoxVertex(ltx+dx, lty+dy, rbx+dx, rby+dy, radius); - MyRCBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy, - radius); - } else { - for (i=0; i < sn; i++) { - sv[i].x = pv[i].x + dx; - sv[i].y = pv[i].y + dy; - } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, - CoordModeOrigin); - } - break; - case OBJ_OVAL: - if (ObjPtr->ctm == NULL) { - o_bbox.ltx = bbox.ltx + dx; o_bbox.lty = bbox.lty + dy; - o_bbox.rbx = bbox.rbx + dx; o_bbox.rby = bbox.rby + dy; - MyOval(drawWindow, revDefaultGC, o_bbox); - } else { - for (i=0; i < sn; i++) { - sv[i].x = pv[i].x + dx; - sv[i].y = pv[i].y + dy; - } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, - CoordModeOrigin); - } - break; - case OBJ_ARC: - if (ObjPtr->ctm == NULL) { - xc = saved_xc+dx; yc = saved_yc+dy; - x1 = saved_x1+dx; y1 = saved_y1+dy; - x2 = saved_x2+dx; y2 = saved_y2+dy; - ltx = saved_ltx+dx; lty = saved_lty+dy; - if (!(arc_ptr->fill == NONEPAT || - (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { - XDrawLine(mainDisplay,drawWindow,revDefaultGC,xc,yc,x1,y1); - XDrawLine(mainDisplay,drawWindow,revDefaultGC,xc,yc,x2,y2); - } - XDrawArc(mainDisplay, drawWindow, revDefaultGC, ltx, lty, - w, h, angle1, angle2); - } else { - for (i=0; i < sn+2; i++) { - sv[i].x = pv[i].x + dx; - sv[i].y = pv[i].y + dy; - } - if (!(arc_ptr->fill == NONEPAT || - (ObjPtr->trans_pat && arc_ptr->fill == BACKPAT))) { - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn+2, - CoordModeOrigin); - } else { - XDrawLines(mainDisplay, drawWindow, revDefaultGC, sv, sn, - CoordModeOrigin); - } - } - break; - case OBJ_POLY: - case OBJ_POLYGON: - if (splineRubberband) { - free(sv); - switch (ObjPtr->type) { - case OBJ_POLY: - if (ObjPtr->ctm == NULL) { - for (i=0; i < num_pts; i++) { - polyv[i].x = poly_ptr->vlist[i].x+ABS_SIZE(dx); - polyv[i].y = poly_ptr->vlist[i].y+ABS_SIZE(dy); - } - } else { - for (i=0; i < num_pts; i++) { - int x, y; ! TransformPointThroughCTM( ! poly_ptr->vlist[i].x-ObjPtr->x, ! poly_ptr->vlist[i].y-ObjPtr->y, ! ObjPtr->ctm, &x, &y); ! polyv[i].x = x+ObjPtr->x+ABS_SIZE(dx); ! polyv[i].y = y+ObjPtr->y+ABS_SIZE(dy); ! } ! } ! if (curved != LT_INTSPLINE) { ! sv = MakeMultiSplinePolyVertex(&sn, smooth, ! drawOrigX, drawOrigY, num_pts, polyv); ! } else { ! free(cntrlv); ! sv = MakeIntSplinePolyVertex(&sn, &intn, &cntrlv, ! drawOrigX, drawOrigY, num_pts, polyv); ! } ! break; ! case OBJ_POLYGON: ! if (ObjPtr->ctm == NULL) { ! for (i=0; i < num_pts; i++) { ! polyv[i].x = polygon_ptr->vlist[i].x+ABS_SIZE(dx); ! polyv[i].y = polygon_ptr->vlist[i].y+ABS_SIZE(dy); ! } ! } else { ! for (i=0; i < num_pts; i++) { ! int x, y; - TransformPointThroughCTM( - polygon_ptr->vlist[i].x-ObjPtr->x, - polygon_ptr->vlist[i].y-ObjPtr->y, - ObjPtr->ctm, &x, &y); - polyv[i].x = x+ObjPtr->x+ABS_SIZE(dx); - polyv[i].y = y+ObjPtr->y+ABS_SIZE(dy); - } - } - if (curved != LT_INTSPLINE) { - sv = MakeMultiSplinePolygonVertex(&sn, smooth, - drawOrigX, drawOrigY, num_pts, polyv); - } else { - free(cntrlv); - sv = MakeIntSplinePolygonVertex(&sn, &intn, - &cntrlv, drawOrigX, drawOrigY, num_pts, - polyv); - } - break; - } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, - sv, sn, CoordModeOrigin); - } else { - for (i=0; i < num_pts; i++) { - v[i].x += dx; - v[i].y += dy; - } - XDrawLines(mainDisplay, drawWindow, revDefaultGC, v, num_pts, - CoordModeOrigin); - for (i=0; i < num_pts; i++) { - v[i].x -= dx; - v[i].y -= dy; - } - } - break; - case OBJ_GROUP: - case OBJ_ICON: - case OBJ_SYM: - case OBJ_PIN: - SelBox(drawWindow,revDefaultGC,ltx+dx,lty+dy,rbx+dx,rby+dy); - break; - } while (XCheckMaskEvent(mainDisplay, PointerMotionMask, &ev)) ; } } } --- 1328,1364 ---- sprintf(buf, "dx=%s\ndy=%s", x_buf, y_buf); ShowMeasureCursor(grid_x, grid_y, buf, TRUE); ! UpdateInnerRubberObj(ObjPtr, &rubber_info, dx, dy); ! DrawInnerRubberObj(ObjPtr, &rubber_info, dx, dy); while (XCheckMaskEvent(mainDisplay, PointerMotionMask, &ev)) ; } } + FreeRubberInfo(ObjPtr, &rubber_info); + + if (dx != 0 || dy != 0) { + HighLightReverse(); + dx = ABS_SIZE(dx); + dy = ABS_SIZE(dy); + if (numObjSelected == numObjLocked) { + HighLightForward(); + return; + } + if (can_move_sub_obj && move_sub_obj) { + MoveAnAttr(ObjPtr->detail.t->attr, NULL, dx, dy); + } else { + MoveAllSel(dx, dy); + } + HighLightForward(); + UpdSelBBox(); + if (justDupped) { + dupDx += dx; + dupDy += dy; + } + SetFileModified(TRUE); + } + if (can_move_sub_obj) { + ShowCurChoiceMouseStatus(curChoice); + } } *************** *** 1820,1827 **** StartShowMeasureCursor(grid_x, grid_y, buf, TRUE); ! XGrabPointer(mainDisplay, drawWindow, FALSE, ! PointerMotionMask | ButtonReleaseMask, ! GrabModeAsync, GrabModeAsync, None, moveCursor, CurrentTime); ! while(moving) { XEvent input; --- 1818,1826 ---- StartShowMeasureCursor(grid_x, grid_y, buf, TRUE); ! if (!debugNoPointerGrab) { ! XGrabPointer(mainDisplay, drawWindow, FALSE, ! PointerMotionMask | ButtonReleaseMask, ! GrabModeAsync, GrabModeAsync, None, moveCursor, CurrentTime); ! } while(moving) { XEvent input; *** msg.c.orig Sun Feb 28 17:10:02 1999 --- msg.c Sun Feb 28 17:10:02 1999 *************** *** 106,109 **** --- 106,152 ---- return FALSE; } + + int FailToWriteFileMessage(file_name) + char *file_name; + { + if (PRTGIF) { + fprintf(stderr, "Fail to write to '%s'. File system may be full.\n", + file_name); + } else { + char msg[MAXPATHLENGTH<<1]; + + sprintf(msg, "Fail to write to '%s'.\n\nFile system may be full.\n", + file_name); + MsgBox(msg, TOOL_NAME, INFO_MB); + } + return FALSE; + } + + int FailToOpenMessage(file_name, rw, extra_msg) + char *file_name, *rw, *extra_msg; + { + char msg[MAXPATHLENGTH<<1]; + + if (extra_msg == NULL) { + if (PRTGIF) { + fprintf(stderr, "Cannot open '%s' for %s.\n", file_name, + ((*rw)=='r' ? "reading" : "writing")); + } else { + sprintf(msg, "Cannot open '%s' for %s.\n", file_name, + ((*rw)=='r' ? "reading" : "writing")); + MsgBox(msg, TOOL_NAME, INFO_MB); + } + } else { + if (PRTGIF) { + fprintf(stderr, "Cannot open '%s' for %s. %s\n", file_name, + ((*rw)=='r' ? "reading" : "writing"), extra_msg); + } else { + sprintf(msg, "Cannot open '%s' for %s. %s\n", file_name, + ((*rw)=='r' ? "reading" : "writing"), extra_msg); + MsgBox(msg, TOOL_NAME, INFO_MB); + } + } + return FALSE; + } int FatalUnexpectedError(msg1, msg2) *** navigate.c.orig Sun Feb 28 17:10:03 1999 --- navigate.c Sun Feb 28 17:10:04 1999 *************** *** 1193,1196 **** --- 1193,1197 ---- ToggleHyperSpace(FALSE); } + FixPageNumbersForSlideShow(); HidePopupMenus(); *************** *** 1216,1226 **** { if (!inSlideShow) { ! switch (MsgBox("Ok to enter slideshow mode? [ync](y)", ! TOOL_NAME, YNC_MB)) { ! case MB_ID_YES: break; ! case MB_ID_NO: return; ! case MB_ID_CANCEL: return; } - MakeQuiescent(); } inSlideShow = !inSlideShow; --- 1217,1240 ---- { if (!inSlideShow) { ! if (pageLayoutMode == PAGE_TILE) { ! sprintf(gszMsgBox, "%s. %s? [ync](y)", ! "Cannot enter slideshow mode in TILED page mode", ! "Would you like to switch to STACKED page mode then proceed"); ! switch (MsgBox(gszMsgBox, TOOL_NAME, YNC_MB)) { ! case MB_ID_YES: break; ! case MB_ID_NO: return; ! case MB_ID_CANCEL: return; ! } ! PageLayoutSubMenu(PAGE_STACK); ! if (pageLayoutMode != PAGE_STACK) return; ! } else { ! switch (MsgBox("Ok to enter slideshow mode? [ync](y)", ! TOOL_NAME, YNC_MB)) { ! case MB_ID_YES: break; ! case MB_ID_NO: return; ! case MB_ID_CANCEL: return; ! } ! MakeQuiescent(); } } inSlideShow = !inSlideShow; *** obj.c.orig Sun Feb 28 17:10:05 1999 --- obj.c Sun Feb 28 17:10:05 1999 *************** *** 333,336 **** --- 333,371 ---- static + void RecursivelyAdjAnObjBBox(target_obj, owner_obj) + struct ObjRec *target_obj, *owner_obj; + { + if (target_obj == owner_obj) { + AdjObjBBox(target_obj); + } else { + struct ObjRec *obj_ptr=NULL; + + switch (owner_obj->type) { + case OBJ_GROUP: + case OBJ_ICON: + case OBJ_SYM: + case OBJ_PIN: + for (obj_ptr=owner_obj->detail.r->first; obj_ptr!=NULL; + obj_ptr=obj_ptr->next) { + RecursivelyAdjAnObjBBox(target_obj, obj_ptr); + } + AdjObjBBox(owner_obj); + break; + default: break; + } + } + } + + void RecursivelyAdjObjBBox(sub_obj, owner_obj, top_owner) + struct ObjRec *sub_obj, *owner_obj, *top_owner; + { + if (owner_obj == NULL) { + RecursivelyAdjAnObjBBox(sub_obj, sub_obj); + } else { + RecursivelyAdjAnObjBBox(sub_obj, top_owner); + } + } + + static void InvalidateObjCache(ObjPtr) struct ObjRec *ObjPtr; *************** *** 879,881 **** --- 914,927 ---- void AdjObjHotSpot() { + } + + struct ObjRec *GetTopOwner(ObjPtr) + struct ObjRec *ObjPtr; + { + struct ObjRec *top_owner=ObjPtr; + + while (top_owner->tmp_parent != NULL) { + top_owner = top_owner->tmp_parent; + } + return top_owner; } *** page.c.orig Sun Feb 28 17:10:06 1999 --- page.c Sun Feb 28 17:10:06 1999 *************** *** 37,40 **** --- 37,41 ---- #include "expfdefs.h" + #include "attr.e" #include "auxtext.e" #include "button.e" *************** *** 65,68 **** --- 66,70 ---- #include "setup.e" #include "stk.e" + #include "text.e" #include "util.e" #include "xprtfltr.e" *************** *** 1624,1626 **** --- 1626,1906 ---- curPageNum = savedCurPageNum; lastPageNum = savedLastPageNum; + } + + /* --------------------- FixPageNumbersForSlideShow() --------------------- */ + + static + int FixPageNumInStrSeg(pStrSeg, attr_ptr, just_checking) + StrSegInfo *pStrSeg; + struct AttrRec *attr_ptr; + int just_checking; + { + static int page_num_str_len=0, num_pages_str_len=0; + static stInitialized=FALSE; + + if (!stInitialized) { + stInitialized = TRUE; + page_num_str_len = strlen("!(STACKED_PAGE_NUM)"); + num_pages_str_len = strlen("!(STACKED_NUM_PAGES)"); + } + if (strstr(pStrSeg->dyn_str.s, "!(STACKED_PAGE_NUM)") != NULL || + strstr(pStrSeg->dyn_str.s, "!(STACKED_NUM_PAGES)") != NULL) { + char *c_ptr=NULL, *c_ptr1=NULL; + struct ObjRec *attr_owner_obj=NULL; + + if (just_checking) { + return TRUE; + } + attr_owner_obj = GetTopOwner(attr_ptr->owner); + PrepareToReplaceAnObj(attr_owner_obj); + while ((c_ptr=strstr(pStrSeg->dyn_str.s, "!(STACKED_PAGE_NUM)")) != + NULL) { + c_ptr1 = &c_ptr[page_num_str_len]; + sprintf(c_ptr, "%1d", curPageNum); + c_ptr = &c_ptr[strlen(c_ptr)]; + while (*c_ptr1 != '\0') *c_ptr++ = *c_ptr1++; + *c_ptr = '\0'; + } + while ((c_ptr=strstr(pStrSeg->dyn_str.s, "!(STACKED_NUM_PAGES)")) != + NULL) { + c_ptr1 = &c_ptr[num_pages_str_len]; + sprintf(c_ptr, "%1d", lastPageNum); + c_ptr = &c_ptr[strlen(c_ptr)]; + while (*c_ptr1 != '\0') *c_ptr++ = *c_ptr1++; + *c_ptr = '\0'; + } + RecursivelyAdjObjBBox(attr_ptr->owner, attr_ptr->owner, attr_owner_obj); + RecordReplaceAnObj(attr_owner_obj); + + SetFileModified(TRUE); + return TRUE; + } + return FALSE; + } + + static + int FixPageNumInStrBlock(pStrBlock, attr_ptr, just_checking) + StrBlockInfo *pStrBlock; + struct AttrRec *attr_ptr; + int just_checking; + { + int changed=FALSE; + + switch (pStrBlock->type) { + case SB_SIMPLE: + if (FixPageNumInStrSeg(pStrBlock->seg, attr_ptr, just_checking)) { + if (just_checking) { + return TRUE; + } + changed = TRUE; + } + break; + case SB_CHAR_SPACE: break; + + case SB_SUPSUB_LEFT: + case SB_SUPSUB_CENTER: + case SB_SUPSUB_RIGHT: + if (pStrBlock->type == SB_SUPSUB_CENTER) { + if (FixPageNumInStrSeg(pStrBlock->seg, attr_ptr, just_checking)) { + if (just_checking) { + return TRUE; + } + changed = TRUE; + } + } + if (pStrBlock->sup != NULL) { + if (FixPageNumInMiniLines(pStrBlock->sup, attr_ptr, just_checking)) { + if (just_checking) { + return TRUE; + } + changed = TRUE; + } + } + if (pStrBlock->sub != NULL) { + if (FixPageNumInMiniLines(pStrBlock->sub, attr_ptr, just_checking)) { + if (just_checking) { + return TRUE; + } + changed = TRUE; + } + } + break; + } + return changed; + } + + static + int FixPageNumInMiniLine(pMiniLine, attr_ptr, just_checking) + MiniLineInfo *pMiniLine; + struct AttrRec *attr_ptr; + int just_checking; + { + int changed=FALSE; + StrBlockInfo *pStrBlock=NULL; + + for (pStrBlock=pMiniLine->first_block; pStrBlock != NULL; + pStrBlock=pStrBlock->next) { + if (FixPageNumInStrBlock(pStrBlock, attr_ptr, just_checking)) { + if (just_checking) { + return TRUE; + } + changed = TRUE; + } + } + return changed; + } + + int FixPageNumInMiniLines(minilines, attr_ptr, just_checking) + MiniLinesInfo *minilines; + struct AttrRec *attr_ptr; + int just_checking; + { + int changed=FALSE; + MiniLineInfo *pMiniLine=NULL; + + for (pMiniLine=minilines->first; pMiniLine != NULL; + pMiniLine=pMiniLine->next) { + if (FixPageNumInMiniLine(pMiniLine, attr_ptr, just_checking)) { + if (just_checking) { + return TRUE; + } + changed = TRUE; + } + } + return changed; + } + + static + int FixPageNumInAttr(AttrPtr, just_checking) + struct AttrRec *AttrPtr; + int just_checking; + { + int changed=FALSE; + + for ( ; AttrPtr != NULL; AttrPtr=AttrPtr->prev) { + if (!AttrPtr->shown) { + continue; + } + if (!AttrPtr->nameshown && *AttrPtr->attr_name.s == '!' && + strcmp(AttrPtr->attr_name.s, "!PAGE_NUM=") == 0) { + if (FixPageNumInMiniLines(&AttrPtr->obj->detail.t->minilines, AttrPtr, + just_checking)) { + if (just_checking) { + return TRUE; + } + UpdateAttr(AttrPtr->obj->detail.t, AttrPtr); + changed = TRUE; + } + } + } + return changed; + } + + static + int FixPageNumInObj(ObjPtr, just_checking) + struct ObjRec *ObjPtr; + int just_checking; + { + switch (ObjPtr->type) { + case OBJ_POLY: + case OBJ_BOX: + case OBJ_OVAL: + case OBJ_POLYGON: + case OBJ_ARC: + case OBJ_RCBOX: + case OBJ_XBM: + case OBJ_XPM: + if (!colorLayers || + ObjPtr->tmp_parent!=NULL || ObjInVisibleLayer(ObjPtr)) { + if (FixPageNumInAttr(ObjPtr->lattr, just_checking) && just_checking) { + return TRUE; + } + } + break; + case OBJ_TEXT: break; + + case OBJ_SYM: + case OBJ_ICON: + case OBJ_GROUP: + if (!colorLayers || + ObjPtr->tmp_parent!=NULL || ObjInVisibleLayer(ObjPtr)) { + struct ObjRec *obj_ptr=ObjPtr->detail.r->last; + + for ( ; obj_ptr != NULL; obj_ptr = obj_ptr->prev) { + obj_ptr->tmp_parent = ObjPtr; + if (FixPageNumInObj(obj_ptr, just_checking) && just_checking) { + return TRUE; + } + } + if (FixPageNumInAttr(ObjPtr->lattr, just_checking) && just_checking) { + return TRUE; + } + } + break; + case OBJ_PIN: + if (!colorLayers || + ObjPtr->tmp_parent!=NULL || ObjInVisibleLayer(ObjPtr)) { + struct ObjRec *obj_ptr=GetPinObj(ObjPtr); + + obj_ptr->tmp_parent = ObjPtr; + if (FixPageNumInObj(obj_ptr, just_checking) && just_checking) { + return TRUE; + } + if (FixPageNumInAttr(ObjPtr->lattr, just_checking) && just_checking) { + return TRUE; + } + } + break; + } + return FALSE; + } + + void FixPageNumbersForSlideShow() + { + int i=0, saved_cur_page_num=curPageNum, page_num=1, num_pages_to_fix=0; + int *pages_to_fix=NULL; + struct PageRec *page_ptr=NULL; + struct ObjRec *obj_ptr=NULL; + + for (page_ptr=firstPage, page_num=1; page_ptr != NULL; + page_ptr=page_ptr->next, page_num++) { + for (obj_ptr=page_ptr->bot; obj_ptr != NULL; obj_ptr=obj_ptr->prev) { + obj_ptr->tmp_parent = NULL; + if (FixPageNumInObj(obj_ptr, TRUE)) { + num_pages_to_fix++; + if (pages_to_fix == NULL) { + pages_to_fix = (int*)malloc(sizeof(int)); + } else { + pages_to_fix = (int*)realloc(pages_to_fix, + num_pages_to_fix*sizeof(int)); + } + if (pages_to_fix == NULL) FailAllocMessage(); + pages_to_fix[num_pages_to_fix-1] = page_num; + break; + } + } + } + if (num_pages_to_fix == 0) { + /* nothing to fix */ + return; + } + StartCompositeCmd(); + for (i=0; i < num_pages_to_fix; i++) { + page_num = pages_to_fix[i]; + PrepareToRecord(CMD_GOTO_PAGE, NULL, NULL, curPageNum); + GotoPageNum(page_num); + RecordCmd(CMD_GOTO_PAGE, NULL, NULL, NULL, curPageNum); + + for (obj_ptr=botObj; obj_ptr != NULL; obj_ptr=obj_ptr->prev) { + FixPageNumInObj(obj_ptr, FALSE); + } + } + if (curPageNum != saved_cur_page_num) { + PrepareToRecord(CMD_GOTO_PAGE, NULL, NULL, curPageNum); + GotoPageNum(saved_cur_page_num); + RecordCmd(CMD_GOTO_PAGE, NULL, NULL, NULL, curPageNum); + } + EndCompositeCmd(); + + free(pages_to_fix); } *** rect.c.orig Sun Feb 28 17:10:11 1999 --- rect.c Sun Feb 28 17:10:11 1999 *************** *** 1836,1840 **** for (obj_ptr=FirstObj; obj_ptr != NULL; obj_ptr=obj_ptr->next) { obj_ptr->tmp_child = NULL; - obj_ptr->tmp_parent = NULL; if (ImmediateChildObj != NULL) *ImmediateChildObj = obj_ptr; if (colorLayers && !ObjInVisibleLayer(obj_ptr)) { --- 1836,1839 ---- *** select.c.orig Sun Feb 28 17:10:13 1999 --- select.c Sun Feb 28 17:10:13 1999 *************** *** 814,819 **** static ! struct SelRec *SelectOneObj(XOff, YOff) int XOff, YOff; /* XOff and YOff are screen offsets */ { --- 814,820 ---- static ! struct SelRec *SelectOneObj(XOff, YOff, ppInnerObj) int XOff, YOff; + struct ObjRec **ppInnerObj; /* XOff and YOff are screen offsets */ { *************** *** 825,828 **** --- 826,832 ---- return NULL; } + if (ppInnerObj != NULL) { + *ppInnerObj = (owner_obj==NULL ? NULL : obj_ptr); + } if (owner_obj != NULL) obj_ptr = owner_obj; *************** *** 1325,1329 **** if (dx <= 2 && dy <= 2) { if (topSel == NULL) { ! if (SelectOneObj(XOff, YOff) != NULL) { if ((topSel->obj->type == OBJ_POLY || topSel->obj->type == OBJ_POLYGON) && --- 1329,1333 ---- if (dx <= 2 && dy <= 2) { if (topSel == NULL) { ! if (SelectOneObj(XOff, YOff, NULL) != NULL) { if ((topSel->obj->type == OBJ_POLY || topSel->obj->type == OBJ_POLYGON) && *************** *** 1403,1407 **** if (topSel != NULL) HighLightReverse(); ! if (SelectOneObj(XOff, YOff) != NULL) { HighLightForward(); } --- 1407,1411 ---- if (topSel != NULL) HighLightReverse(); ! if (SelectOneObj(XOff, YOff, NULL) != NULL) { HighLightForward(); } *************** *** 1604,1607 **** --- 1608,1613 ---- } } else if (curChoice == NOTHING) { + struct ObjRec *inner_obj=NULL; + if (topSel != NULL) { if (oneMotionSelectMove && *************** *** 1611,1617 **** HighLightReverse(); RemoveAllSel(); ! if (SelectOneObj(mouse_x, mouse_y) != NULL) { HighLightForward(); ! MoveSel(grid_x, grid_y, topSel->obj, button_ev); return; } --- 1617,1624 ---- HighLightReverse(); RemoveAllSel(); ! if (SelectOneObj(mouse_x, mouse_y, &inner_obj) != NULL) { HighLightForward(); ! MoveSel(grid_x, grid_y, ! (inner_obj==NULL ? topSel->obj : inner_obj), button_ev); return; } *************** *** 1619,1623 **** StretchSel(grid_x, grid_y, sel_ptr->obj, corner); return; ! } else if ((obj_ptr=PtInSelected(mouse_x, mouse_y)) != NULL) { MoveSel(grid_x, grid_y, obj_ptr, button_ev); return; --- 1626,1631 ---- StretchSel(grid_x, grid_y, sel_ptr->obj, corner); return; ! } else if ((obj_ptr=PtInSelected(mouse_x, mouse_y)) != ! NULL) { MoveSel(grid_x, grid_y, obj_ptr, button_ev); return; *************** *** 1624,1630 **** } } else if (oneMotionSelectMove && ! SelectOneObj(mouse_x,mouse_y) != NULL) { HighLightForward(); ! MoveSel(grid_x, grid_y, topSel->obj, button_ev); return; } --- 1632,1639 ---- } } else if (oneMotionSelectMove && ! SelectOneObj(mouse_x,mouse_y, &inner_obj) != NULL) { HighLightForward(); ! MoveSel(grid_x, grid_y, ! (inner_obj==NULL ? topSel->obj : inner_obj), button_ev); return; } *************** *** 1964,1968 **** while (exec_attr != NULL) { int saved_intr_check_interval=intrCheckInterval; ! int one_line_status=FALSE, exec_rc; int saved_history_depth=historyDepth; char status_buf[MAX_STATUS_BTNS+1][MAXSTRING+1]; --- 1973,1977 ---- while (exec_attr != NULL) { int saved_intr_check_interval=intrCheckInterval; ! int one_line_status=FALSE, exec_rc=TRUE, teleport_aborted=FALSE; int saved_history_depth=historyDepth; char status_buf[MAX_STATUS_BTNS+1][MAXSTRING+1]; *************** *** 1985,1989 **** EndExecAnimate(); if (saved_history_depth != historyDepth) RestoreDefaultHistoryDepth(); ! if (exec_rc == TRUE && warpToAttr != NULL) DoTeleport(warpToAttr); RestoreStatusStringsFromBuf(status_buf, one_line_status); --- 1994,2000 ---- EndExecAnimate(); if (saved_history_depth != historyDepth) RestoreDefaultHistoryDepth(); ! if (exec_rc == TRUE && warpToAttr != NULL) { ! teleport_aborted = !DoTeleport(warpToAttr); ! } RestoreStatusStringsFromBuf(status_buf, one_line_status); *************** *** 1991,1995 **** intrCheckInterval = saved_intr_check_interval; ! if (exec_rc==TRUE && warpToAttr!=NULL) { if (cmdToExecAfterHyperJump == NULL) { if ((exec_attr=FindFileAttrWithName("auto_exec=")) == NULL) { --- 2002,2006 ---- intrCheckInterval = saved_intr_check_interval; ! if (exec_rc==TRUE && warpToAttr!=NULL && !teleport_aborted) { if (cmdToExecAfterHyperJump == NULL) { if ((exec_attr=FindFileAttrWithName("auto_exec=")) == NULL) { *************** *** 2040,2046 **** teleport_attr = FindAttrWithName(obj_ptr, TELEPORT_ATTR, NULL); if (teleport_attr != NULL) { ! DoTeleport(teleport_attr); ! if ((exec_attr=FindFileAttrWithName("auto_exec=")) != NULL) { ! DoExecLoop(NULL, exec_attr); } return; --- 2051,2058 ---- teleport_attr = FindAttrWithName(obj_ptr, TELEPORT_ATTR, NULL); if (teleport_attr != NULL) { ! if (DoTeleport(teleport_attr)) { ! if ((exec_attr=FindFileAttrWithName("auto_exec=")) != NULL) { ! DoExecLoop(NULL, exec_attr); ! } } return; *************** *** 2048,2054 **** teleport_attr = FindAttrWithName(obj_ptr, "href=", NULL); if (teleport_attr != NULL) { ! DoTeleport(teleport_attr); ! if ((exec_attr=FindFileAttrWithName("auto_exec=")) != NULL) { ! DoExecLoop(NULL, exec_attr); } return; --- 2060,2067 ---- teleport_attr = FindAttrWithName(obj_ptr, "href=", NULL); if (teleport_attr != NULL) { ! if (DoTeleport(teleport_attr)) { ! if ((exec_attr=FindFileAttrWithName("auto_exec=")) != NULL) { ! DoExecLoop(NULL, exec_attr); ! } } return; *** special.c.orig Sun Feb 28 17:10:17 1999 --- special.c Sun Feb 28 17:10:17 1999 *************** *** 1125,1129 **** if (attr_ptr != topSel->obj->lattr) fprintf(fp, "\n"); if (fprintf(fp, "%s%s\n", attr_ptr->attr_name.s, ! attr_ptr->attr_value.s) < 0) { writeFileFailed = TRUE; } --- 1125,1129 ---- if (attr_ptr != topSel->obj->lattr) fprintf(fp, "\n"); if (fprintf(fp, "%s%s\n", attr_ptr->attr_name.s, ! attr_ptr->attr_value.s) == EOF) { writeFileFailed = TRUE; } *************** *** 1132,1139 **** for (pMiniLine=pMiniLine->next; !writeFileFailed && pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! if (fprintf(fp, "%s\n", pMiniLine->first_block->seg->dyn_str.s) < ! 0) { writeFileFailed = TRUE; } } } --- 1132,1144 ---- for (pMiniLine=pMiniLine->next; !writeFileFailed && pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, ! &need_to_free_tmp_buf); ! ! if (fprintf(fp, "%s\n", tmp_buf) == EOF) { writeFileFailed = TRUE; } + if (need_to_free_tmp_buf) UtilFree(tmp_buf); + if (writeFileFailed) break; } } *************** *** 1631,1635 **** for (pMiniLine=spec_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! total += strlen(pMiniLine->first_block->seg->dyn_str.s)+1; } if ((spec=(char*)malloc((total+1)*sizeof(char))) == NULL) { --- 1636,1644 ---- for (pMiniLine=spec_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! int need_to_free_tmp_buf=FALSE; ! char *tmp_buf=ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! ! total += strlen(tmp_buf)+1; ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); } if ((spec=(char*)malloc((total+1)*sizeof(char))) == NULL) { *************** *** 1641,1649 **** for (pMiniLine=spec_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! int len=(c_ptr==spec ? strlen(spec_attr->attr_value.s) : ! strlen(pMiniLine->first_block->seg->dyn_str.s)); ! strcpy(c_ptr, (c_ptr==spec ? spec_attr->attr_value.s : ! pMiniLine->first_block->seg->dyn_str.s)); c_ptr += len; *c_ptr++ = ','; --- 1650,1672 ---- for (pMiniLine=spec_attr->obj->detail.t->minilines.first; pMiniLine != NULL; pMiniLine=pMiniLine->next) { ! int len=0, need_to_free_tmp_buf=FALSE; ! char *tmp_buf=NULL; ! if (pMiniLine == spec_attr->obj->detail.t->minilines.first) { ! char *attr_value=NULL; ! ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! attr_value = UtilStrDup(tmp_buf); ! if (attr_value == NULL) FailAllocMessage(); ! ParseAttrStr(tmp_buf, NULL, 0, attr_value, strlen(attr_value)+1); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); ! need_to_free_tmp_buf = TRUE; ! tmp_buf = attr_value; ! } else { ! tmp_buf = ConvertMiniLineToString(pMiniLine, &need_to_free_tmp_buf); ! } ! len = strlen(tmp_buf); ! strcpy(c_ptr, tmp_buf); ! if (need_to_free_tmp_buf) UtilFree(tmp_buf); c_ptr += len; *c_ptr++ = ','; *************** *** 1692,1696 **** return; } ! if (fprintf(fp, "%s%s", (i==0 ? "" : "\t"), c_ptr) < 0) { writeFileFailed = TRUE; } --- 1715,1719 ---- return; } ! if (fprintf(fp, "%s%s", (i==0 ? "" : "\t"), c_ptr) == EOF) { writeFileFailed = TRUE; } *************** *** 1736,1740 **** if (something_exported) { num_exported++; ! if (fprintf(fp, "%s\n", buf) < 0) { writeFileFailed = TRUE; ok = FALSE; --- 1759,1763 ---- if (something_exported) { num_exported++; ! if (fprintf(fp, "%s\n", buf) == EOF) { writeFileFailed = TRUE; ok = FALSE; *** text.c.orig Sun Feb 28 17:10:19 1999 --- text.c Sun Feb 28 17:10:19 1999 *************** *** 386,390 **** if (editTextSize != 0) { pStrSeg->real_sz_unit = pStrSeg->sz_unit; ! pStrSeg->sz_unit = editTextSize; } } --- 386,390 ---- if (editTextSize != 0) { pStrSeg->real_sz_unit = pStrSeg->sz_unit; ! pStrSeg->sz_unit = FontSizeToSzUnit(editTextSize); } } *** attr.e.orig Sun Feb 28 17:10:23 1999 --- attr.e Sun Feb 28 17:10:23 1999 *************** *** 46,49 **** --- 46,51 ---- extern void FreeAttr ARGS_DECL((struct AttrRec *)); extern void UnlinkAttr ARGS_DECL((struct AttrRec *)); + extern void ParseAttrStr ARGS_DECL((char *buf, char *name, int name_sz, + char *value, int value_sz)); extern void UpdateAttr ARGS_DECL((struct TextRec *, struct AttrRec *)); extern void DrawAttrs ARGS_DECL((Window, int X, int Y, struct AttrRec *)); *** miniline.e.orig Sun Feb 28 17:10:28 1999 --- miniline.e Sun Feb 28 17:10:28 1999 *************** *** 132,136 **** extern StrSegInfo *GetTextFirstStrSeg ARGS_DECL((struct ObjRec *)); extern struct DynStrRec *GetTextFirstDynStr ARGS_DECL((struct ObjRec *)); - extern void SetTextFirstDynStr ARGS_DECL((struct ObjRec *, char*)); /* --------------------- TextRec Routines --------------------- */ --- 132,135 ---- *************** *** 247,250 **** --- 246,251 ---- extern void DumpMiniLinesInAscii ARGS_DECL((FILE*, MiniLinesInfo*, int *pnSomethingPrinted)); + extern char *ConvertMiniLineToString ARGS_DECL((MiniLineInfo*, + int *pnNeedToFree)); #ifdef _INCLUDE_FROM_MINILINE_C_ *** move.e.orig Sun Feb 28 17:10:31 1999 --- move.e Sun Feb 28 17:10:31 1999 *************** *** 49,52 **** --- 49,55 ---- extern void MoveAnObj ARGS_DECL((struct ObjRec *ObjPtr, struct ObjRec *TopOwner, int Dx, int Dy)); + extern void MoveAnAttr ARGS_DECL((struct AttrRec *AttrPtr, + struct ObjRec *AttrOwnerObj, + int Dx, int Dy)); extern void MoveSel ARGS_DECL((int Dx, int Dy, struct ObjRec *, XButtonEvent *)); *** msg.e.orig Sun Feb 28 17:10:36 1999 --- msg.e Sun Feb 28 17:10:36 1999 *************** *** 49,52 **** --- 49,55 ---- extern int FailAllocBitmapMessage ARGS_DECL((int W, int H)); extern int FailAllocPixmapMessage ARGS_DECL((int W, int H)); + extern int FailToWriteFileMessage ARGS_DECL((char *file_name)); + extern int FailToOpenMessage ARGS_DECL((char *file_name, char *rw, + char *extra_msg)); extern int FatalUnexpectedError ARGS_DECL((char*, char*)); extern int TgAssert ARGS_DECL((int must_be_true, char*, char*)); *** obj.e.orig Sun Feb 28 17:10:38 1999 --- obj.e Sun Feb 28 17:10:38 1999 *************** *** 52,55 **** --- 52,58 ---- extern void AdjObjOBBox ARGS_DECL((struct ObjRec *)); extern void AdjObjBBox ARGS_DECL((struct ObjRec *)); + extern void RecursivelyAdjObjBBox ARGS_DECL((struct ObjRec *sub_obj, + struct ObjRec *owner_obj, + struct ObjRec *top_owner)); extern void AdjObjCache ARGS_DECL((struct ObjRec *)); extern void AdjCaches ARGS_DECL((void)); *************** *** 60,63 **** --- 63,68 ---- extern void AdjHotSpots ARGS_DECL((void)); + extern struct ObjRec *GetTopOwner ARGS_DECL((struct ObjRec *)); + #ifdef _INCLUDE_FROM_OBJ_C_ #undef extern *** page.e.orig Sun Feb 28 17:10:42 1999 --- page.e Sun Feb 28 17:10:42 1999 *************** *** 82,85 **** --- 82,89 ---- extern void PushPageInfo ARGS_DECL((void)); extern void PopPageInfo ARGS_DECL((void)); + extern int FixPageNumInMiniLines ARGS_DECL((MiniLinesInfo*, + struct AttrRec *, + int just_checking)); + extern void FixPageNumbersForSlideShow ARGS_DECL((void)); #ifdef _INCLUDE_FROM_PAGE_C_ *** patchlvl.h.orig Sun Feb 28 17:10:48 1999 --- patchlvl.h Sun Feb 28 17:10:48 1999 *************** *** 35,39 **** #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 17 #endif /*_TGIF_PATCHLEVEL_H_*/ --- 35,39 ---- #define _TGIF_PATCHLEVEL_H_ ! #define TGIF_PATCHLEVEL 18 #endif /*_TGIF_PATCHLEVEL_H_*/ *** Makefile.noimake.orig Sun Feb 28 17:10:54 1999 --- Makefile.noimake Sun Feb 28 17:10:54 1999 *************** *** 135,140 **** #-D_TGIF_WB # Include the above line if you want to include the whiteboard feature ! # by Renato Santana . This feature is under ! # development and highly experimental. #-DBSD_COMP # Include the above line if you are compiling on a Solaris (or --- 135,140 ---- #-D_TGIF_WB # Include the above line if you want to include the whiteboard feature ! # by Renato Santana . This flag is being ! # obsoleted by the people at ufrj.br. Please do not use it for tgif-4. #-DBSD_COMP # Include the above line if you are compiling on a Solaris (or *** Imakefile.orig Sun Feb 28 17:10:55 1999 --- Imakefile Sun Feb 28 17:10:55 1999 *************** *** 53,57 **** $(MOREDEFINES) ! TGIFVERSION = 4.0.17 XCOMM Things to try to add to the DEFINES line above: --- 53,57 ---- $(MOREDEFINES) ! TGIFVERSION = 4.0.18 XCOMM Things to try to add to the DEFINES line above: *************** *** 122,127 **** XCOMM -D_TGIF_WB XCOMM Include the above line if you want to include the whiteboard feature ! XCOMM by Renato Santana . This feature is under ! XCOMM development and highly experimental. XCOMM -DBSD_COMP XCOMM Include the above line if you are compiling on a Solaris (or --- 122,127 ---- XCOMM -D_TGIF_WB XCOMM Include the above line if you want to include the whiteboard feature ! XCOMM by Renato Santana . This flag is being ! XCOMM obsoleted by the people at ufrj.br. Please do not use it for tgif-4.x. XCOMM -DBSD_COMP XCOMM Include the above line if you are compiling on a Solaris (or *** tgif.man.orig Sun Feb 28 17:10:57 1999 --- tgif.man Sun Feb 28 17:10:57 1999 *************** *** 9,13 **** .\" .\" ! .TH TGIF n "Version 4.0 Patchlevel 15 and Above" "Tgif" .\" .SH NAME --- 9,13 ---- .\" .\" ! .TH tgif n "Version 4.0 Patchlevel 15 and Above" "Tgif" .\" .SH NAME *************** *** 2327,2330 **** --- 2327,2332 ---- Tgif.DefaultSingleByteFont: Helvetica .br + Tgif.GBShowFontChar: \271\372 + .br Tgif.SquareDoubleByteFonts: \\n\\ .br *************** *** 2362,2365 **** --- 2364,2370 ---- In the above example, the Song Ti font doesn't have styles such as italic and bold, so all four parts are identical. + The Tgif.GBShowFontChar X default specifies a double-byte octal character + to be used to represent this font in the Choice Window when this font + is selected. .PP Below is another example of using the X JIS fonts to represent *************** *** 2367,2370 **** --- 2372,2377 ---- as follows: .PP + Tgif.RyuminShowFontChar: \244\242 + .br Tgif.SquareDoubleByteFonts: \\n\\ .br *************** *** 3841,3847 **** .TP .I Tgif.EditTextSize: NUMBER ! This specifies the initial text size to be used in editing existing text objects. NUMBER should either be 0 or a value between 4 and 34 (inclusive). If NUMBER is 0, the actual text size is used in editing existing text objects. The default is 0. .TP --- 3848,3856 ---- .TP .I Tgif.EditTextSize: NUMBER ! This specifies the text size to be used in editing existing text objects. NUMBER should either be 0 or a value between 4 and 34 (inclusive). If NUMBER is 0, the actual text size is used in editing existing text objects. + The value of the edit text size can later be changed by selecting + SetEditTextSize() from the Properties Menu. The default is 0. .TP *************** *** 3992,3995 **** --- 4001,4011 ---- The default is Times. .TP + .I Tgif.@@@ShowFontChar: OCTAL STRING + OCTAL STRING specifies a double-byte octal character + to be used to represent a double-byte font in the + Choice Window when the font is selected. + @@@ should be replaced by the name of the double-byte font. + Please see the SQUARE DOUBLE FONTS section for examples. + .TP .I Tgif.DoubleByteInputMethod: STRING This specifies the input method for double-byte fonts. *************** *** 4255,4263 **** . .IP [2] ! ``\fIThe Common Gateway Interface\fR'', ! . .IP [3] ``\fINCSA Imagemap\fR'', ! . .IP [4] ``\fICERN Clickable Image\fR'', --- 4271,4279 ---- . .IP [2] ! ``\fICGI - Common Gateway Interface\fR'', ! . .IP [3] ``\fINCSA Imagemap\fR'', ! . .IP [4] ``\fICERN Clickable Image\fR'', *** HISTORY.orig Sun Feb 28 17:11:02 1999 --- HISTORY Sun Feb 28 17:11:02 1999 *************** *** 1,2 **** --- 1,17 ---- + -----------------------> tgif-4.0.17 => tgif-4.0.18 <----------------------- + Here's a short list of added features/bug fixes. + + 1) Fix problems with internal commands to work better with non-simple + (multi-color, multi-font, etc.) attributes. Thanks to Daniel Ratton + Figueiredo for pointing out the problem. + 2) Fix problems with menus with wm2. Thanks to + for pointing out the problem. + 3) Fix a bug that creating a new text object when the edit text size is + non-zero results in the font size of the text object being 0. Thanks + to Jeremy H. Brown for pointing out the problem. + 4) Fix page number bugs (as specified in the MULTIPAGE DRAWING section + of tgif's man pages) in slideshow mode. + 5) Allows the moving of individual attributes directly in select mode. + -----------------------> tgif-4.0.16 => tgif-4.0.17 <----------------------- Here's a short list of added features/bug fixes. *** tgif.Xdefaults.orig Sun Feb 28 17:11:04 1999 --- tgif.Xdefaults Sun Feb 28 17:11:04 1999 *************** *** 367,370 **** --- 367,373 ---- !-jis-fixed-medium-r-*--%d-*-*-*-*-*-jisx0208.1983-*,V,GothicBBB-Medium-EUC-V Tgif.HKUShowFontChar: \244\244 + Tgif.GBShowFontChar: \271\372 + Tgif.RyuminShowFontChar: \244\242 + Tgif.GothicBBBShowFontChar: \244\316 Tgif.DoubleByteInputMethod: xcin !Tgif.DoubleByteInputMethod: chinput *** make.comdep.orig Sun Feb 28 17:11:05 1999 --- make.comdep Sun Feb 28 17:11:05 1999 *************** *** 86,91 **** polygon.e raster.e rcbox.e rect.e remote.e ruler.e scroll.e \ select.e setup.e shape.e shortcut.e special.e stk.e stream.e \ ! stretch.e text.e util.e xbitmap.e xpixmap.e tangram2.e \ ! $(XBM)intr.xbm $(XBM)trek.xbm dup$(O) : tgifdefs.h const.h tgif_dbg.h types.h attr.e auxtext.e \ choice.e cmd.e drawing.e dup.e grid.e mark.e move.e msg.e \ --- 86,91 ---- polygon.e raster.e rcbox.e rect.e remote.e ruler.e scroll.e \ select.e setup.e shape.e shortcut.e special.e stk.e stream.e \ ! stretch.e text.e util.e xbitmap.e xpixmap.e $(XBM)intr.xbm \ ! $(XBM)trek.xbm dup$(O) : tgifdefs.h const.h tgif_dbg.h types.h attr.e auxtext.e \ choice.e cmd.e drawing.e dup.e grid.e mark.e move.e msg.e \ *************** *** 106,115 **** exec$(O) : tgifdefs.h const.h tgif_dbg.h types.h patchlvl.h expfdefs.h \ cmdids.h align.e attr.e auxtext.e cmd.e color.e choice.e \ ! cursor.e dialog.e drawing.e dup.e edit.e eps.e exec.e expr.e \ ! file.e font.e grid.e import.e ini.e mainloop.e menu.e \ ! miniline.e move.e msg.e names.e navigate.e obj.e pattern.e \ ! poly.e raster.e remote.e select.e setup.e shortcut.e \ ! special.e stk.e stretch.e tcp.e text.e util.e version.e wb.e \ ! xbitmap.e xpixmap.e xprtfltr.e expr$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e expr.e msg.e \ setup.e util.e --- 106,115 ---- exec$(O) : tgifdefs.h const.h tgif_dbg.h types.h patchlvl.h expfdefs.h \ cmdids.h align.e attr.e auxtext.e cmd.e color.e choice.e \ ! cursor.e cutpaste.e dialog.e drawing.e dup.e edit.e eps.e \ ! exec.e expr.e file.e font.e grid.e import.e ini.e mainloop.e \ ! menu.e miniline.e move.e msg.e names.e navigate.e obj.e \ ! pattern.e poly.e raster.e remote.e select.e setup.e \ ! shortcut.e special.e stk.e stretch.e tcp.e text.e util.e \ ! version.e wb.e xbitmap.e xpixmap.e xprtfltr.e expr$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e expr.e msg.e \ setup.e util.e *************** *** 172,176 **** mainloop.e mainmenu.e menu.e menuinfo.e msg.e navigate.e \ obj.e page.e pattern.e raster.e setup.e shape.e special.e \ ! stretch.e text.e util.e tangram2.e mark$(O) : tgifdefs.h const.h tgif_dbg.h types.h choice.e exec.e mark.e \ obj.e raster.e rect.e setup.e select.e --- 172,176 ---- mainloop.e mainmenu.e menu.e menuinfo.e msg.e navigate.e \ obj.e page.e pattern.e raster.e setup.e shape.e special.e \ ! stretch.e text.e util.e mark$(O) : tgifdefs.h const.h tgif_dbg.h types.h choice.e exec.e mark.e \ obj.e raster.e rect.e setup.e select.e *************** *** 181,189 **** obj.e page.e pattern.e raster.e rect.e remote.e select.e \ setup.e shape.e special.e stk.e text.e util.e version.e \ ! tangram2.e $(XBM)check.xbm $(XBM)submenu.xbm menuinfo$(O) : tgifdefs.h const.h tgif_dbg.h types.h cmdids.h align.e \ color.e edit.e file.e font.e grid.e help.e menu.e menuinfo.e \ navigate.e page.e pattern.e raster.e scroll.e shape.e \ ! stream.e text.e tangram2.e miniline$(O) : tgifdefs.h const.h tgif_dbg.h types.h auxtext.e choice.e \ color.e dialog.e dup.e file.e font.e inmethod.e miniline.e \ --- 181,189 ---- obj.e page.e pattern.e raster.e rect.e remote.e select.e \ setup.e shape.e special.e stk.e text.e util.e version.e \ ! $(XBM)check.xbm $(XBM)submenu.xbm menuinfo$(O) : tgifdefs.h const.h tgif_dbg.h types.h cmdids.h align.e \ color.e edit.e file.e font.e grid.e help.e menu.e menuinfo.e \ navigate.e page.e pattern.e raster.e scroll.e shape.e \ ! stream.e text.e miniline$(O) : tgifdefs.h const.h tgif_dbg.h types.h auxtext.e choice.e \ color.e dialog.e dup.e file.e font.e inmethod.e miniline.e \ *************** *** 190,197 **** move.e msg.e obj.e pattern.e ps.e raster.e rect.e setup.e \ text.e util.e ! move$(O) : tgifdefs.h const.h tgif_dbg.h types.h arc.e attr.e cmd.e \ ! cursor.e dialog.e drawing.e dup.e exec.e grid.e mainloop.e \ ! mark.e move.e msg.e names.e obj.e oval.e poly.e raster.e \ ! rcbox.e rect.e ruler.e select.e setup.e spline.e stretch.e msg$(O) : tgifdefs.h const.h tgif_dbg.h types.h patchlvl.h button.e \ cutpaste.e cursor.e dialog.e drawing.e file.e font.e grid.e \ --- 190,198 ---- move.e msg.e obj.e pattern.e ps.e raster.e rect.e setup.e \ text.e util.e ! move$(O) : tgifdefs.h const.h tgif_dbg.h types.h arc.e attr.e choice.e \ ! cmd.e cursor.e dialog.e drawing.e dup.e exec.e grid.e \ ! mainloop.e mark.e move.e msg.e names.e obj.e oval.e poly.e \ ! raster.e rcbox.e rect.e ruler.e select.e setup.e spline.e \ ! stretch.e msg$(O) : tgifdefs.h const.h tgif_dbg.h types.h patchlvl.h button.e \ cutpaste.e cursor.e dialog.e drawing.e file.e font.e grid.e \ *************** *** 324,329 **** scroll$(O) : tgifdefs.h const.h tgif_dbg.h types.h choice.e cursor.e \ dialog.e drawing.e dup.e exec.e grid.e mainloop.e menu.e \ ! msg.e obj.e page.e raster.e rect.e ruler.e scroll.e setup.e \ ! text.e util.e $(XBM)scrl_up.xbm select$(O) : tgifdefs.h const.h tgif_dbg.h types.h auxtext.e button.e \ choice.e cmd.e color.e cursor.e dialog.e drawing.e dup.e \ --- 325,330 ---- scroll$(O) : tgifdefs.h const.h tgif_dbg.h types.h choice.e cursor.e \ dialog.e drawing.e dup.e exec.e grid.e mainloop.e menu.e \ ! miniline.e msg.e obj.e page.e raster.e rect.e ruler.e \ ! scroll.e setup.e text.e util.e $(XBM)scrl_up.xbm select$(O) : tgifdefs.h const.h tgif_dbg.h types.h auxtext.e button.e \ choice.e cmd.e color.e cursor.e dialog.e drawing.e dup.e \ *************** *** 340,344 **** ruler.e scroll.e select.e setup.e shape.e shortcut.e spline.e \ stk.e stretch.e text.e util.e version.e wb.e xbitmap.e \ ! xpixmap.e xprtfltr.e tangram2.e tgificon.xbm $(XBM)btn1.xbm shape$(O) : tgifdefs.h const.h tgif_dbg.h types.h cmdids.h arc.e attr.e \ auxtext.e box.e cmd.e color.e cursor.e dialog.e drawing.e \ --- 341,345 ---- ruler.e scroll.e select.e setup.e shape.e shortcut.e spline.e \ stk.e stretch.e text.e util.e version.e wb.e xbitmap.e \ ! xpixmap.e xprtfltr.e tgificon.xbm $(XBM)btn1.xbm shape$(O) : tgifdefs.h const.h tgif_dbg.h types.h cmdids.h arc.e attr.e \ auxtext.e box.e cmd.e color.e cursor.e dialog.e drawing.e \ *************** *** 348,352 **** text.e util.e shortcut$(O) : tgifdefs.h const.h tgif_dbg.h types.h cmdids.h msg.e setup.e \ ! shortcut.e tangram2.e special$(O) : tgifdefs.h const.h tgif_dbg.h types.h animate.e attr.e \ auxtext.e choice.e cmd.e color.e cutpaste.e cursor.e dialog.e \ --- 349,353 ---- text.e util.e shortcut$(O) : tgifdefs.h const.h tgif_dbg.h types.h cmdids.h msg.e setup.e \ ! shortcut.e special$(O) : tgifdefs.h const.h tgif_dbg.h types.h animate.e attr.e \ auxtext.e choice.e cmd.e color.e cutpaste.e cursor.e dialog.e \ *************** *** 364,369 **** version.e stream$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e drawing.e \ ! file.e http.e import.e menu.e move.e msg.e obj.e remote.e \ ! setup.e stream.e util.e stretch$(O) : tgifdefs.h const.h tgif_dbg.h types.h align.e arc.e auxtext.e \ choice.e cmd.e color.e cursor.e dialog.e drawing.e dup.e \ --- 365,370 ---- version.e stream$(O) : tgifdefs.h const.h tgif_dbg.h types.h dialog.e drawing.e \ ! file.e http.e import.e menu.e move.e msg.e navigate.e obj.e \ ! remote.e setup.e stream.e util.e stretch$(O) : tgifdefs.h const.h tgif_dbg.h types.h align.e arc.e auxtext.e \ choice.e cmd.e color.e cursor.e dialog.e drawing.e dup.e \