mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-15 14:16:07 -06:00
git-svn-id: svn://ultimatepp.org/upp/trunk@330 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
parent
af712dddc9
commit
2d10cf466b
90 changed files with 10807 additions and 9917 deletions
|
|
@ -17,6 +17,7 @@ ruRU("Прервано пользователем")
|
|||
srSP("Prekinuto od strane korisnika.")
|
||||
trTR("Kullanıcı tarafından iptal edildi.")
|
||||
zhCN("用户放弃")
|
||||
zhTW("使用者取消")
|
||||
|
||||
|
||||
// TimeDate.cpp
|
||||
|
|
@ -35,6 +36,7 @@ ruRU("Суббота")
|
|||
srSP("Nedelja")
|
||||
trTR("Pazar")
|
||||
zhCN("星期日")
|
||||
zhTW("星期日")
|
||||
|
||||
T_("date\vMonday")
|
||||
csCZ("Pondělí")
|
||||
|
|
@ -50,6 +52,7 @@ ruRU("Понедельник")
|
|||
srSP("Ponedeljak")
|
||||
trTR("Pazartesi")
|
||||
zhCN("星期一")
|
||||
zhTW("星期一")
|
||||
|
||||
T_("date\vTuesday")
|
||||
csCZ("Úterý")
|
||||
|
|
@ -65,6 +68,7 @@ ruRU("Вторник")
|
|||
srSP("Utorak")
|
||||
trTR("Salı")
|
||||
zhCN("星期二")
|
||||
zhTW("星期二")
|
||||
|
||||
T_("date\vWednesday")
|
||||
csCZ("Středa")
|
||||
|
|
@ -80,6 +84,7 @@ ruRU("Среда")
|
|||
srSP("Sreda")
|
||||
trTR("Çarşamba")
|
||||
zhCN("星期三")
|
||||
zhTW("星期三")
|
||||
|
||||
T_("date\vThursday")
|
||||
csCZ("Čtvrtek")
|
||||
|
|
@ -95,6 +100,7 @@ ruRU("Четверг")
|
|||
srSP("Četvrtak")
|
||||
trTR("Perşembe")
|
||||
zhCN("星期四")
|
||||
zhTW("星期四")
|
||||
|
||||
T_("date\vFriday")
|
||||
csCZ("Pátek")
|
||||
|
|
@ -110,6 +116,7 @@ ruRU("Пятница")
|
|||
srSP("Petak")
|
||||
trTR("Cuma")
|
||||
zhCN("星期五")
|
||||
zhTW("星期五")
|
||||
|
||||
T_("date\vSaturday")
|
||||
csCZ("Sobota")
|
||||
|
|
@ -125,6 +132,7 @@ ruRU("Воскресенье")
|
|||
srSP("Subota")
|
||||
trTR("Cumartesi")
|
||||
zhCN("星期六")
|
||||
zhTW("星期六")
|
||||
|
||||
T_("date\vSu")
|
||||
csCZ("Ne")
|
||||
|
|
@ -140,6 +148,7 @@ ruRU("Вс")
|
|||
srSP("Ne")
|
||||
trTR("Pz")
|
||||
zhCN("Fri")
|
||||
zhTW("Fri")
|
||||
|
||||
T_("date\vMo")
|
||||
csCZ("Po")
|
||||
|
|
@ -155,6 +164,7 @@ ruRU("Пн")
|
|||
srSP("Po")
|
||||
trTR("Pts")
|
||||
zhCN("Mon")
|
||||
zhTW("Mon")
|
||||
|
||||
T_("date\vTu")
|
||||
csCZ("Út")
|
||||
|
|
@ -170,6 +180,7 @@ ruRU("Вт")
|
|||
srSP("Ut")
|
||||
trTR("Sl")
|
||||
zhCN("Tue")
|
||||
zhTW("Tue")
|
||||
|
||||
T_("date\vWe")
|
||||
csCZ("St")
|
||||
|
|
@ -185,6 +196,7 @@ ruRU("Ср")
|
|||
srSP("Sr")
|
||||
trTR("Çrş")
|
||||
zhCN("Wed")
|
||||
zhTW("Wed")
|
||||
|
||||
T_("date\vTh")
|
||||
csCZ("Čt")
|
||||
|
|
@ -200,6 +212,7 @@ ruRU("Чт")
|
|||
srSP("Če")
|
||||
trTR("Prş")
|
||||
zhCN("Thu")
|
||||
zhTW("Thu")
|
||||
|
||||
T_("date\vFr")
|
||||
csCZ("Pa")
|
||||
|
|
@ -215,6 +228,7 @@ ruRU("Пт")
|
|||
srSP("Pe")
|
||||
trTR("Cu")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
||||
T_("date\vSa")
|
||||
csCZ("So")
|
||||
|
|
@ -230,6 +244,7 @@ ruRU("Сб")
|
|||
srSP("Su")
|
||||
trTR("Cts")
|
||||
zhCN("Sun")
|
||||
zhTW("Sun")
|
||||
|
||||
T_("date\vJanuary")
|
||||
csCZ("Leden")
|
||||
|
|
@ -245,6 +260,7 @@ ruRU("Январь")
|
|||
srSP("Januar")
|
||||
trTR("Ocak")
|
||||
zhCN("一月")
|
||||
zhTW("一月")
|
||||
|
||||
T_("date\vFebruary")
|
||||
csCZ("Únor")
|
||||
|
|
@ -260,6 +276,7 @@ ruRU("Февраль")
|
|||
srSP("Februar")
|
||||
trTR("Şubat")
|
||||
zhCN("二月")
|
||||
zhTW("二月")
|
||||
|
||||
T_("date\vMarch")
|
||||
csCZ("Březen")
|
||||
|
|
@ -275,6 +292,7 @@ ruRU("Март")
|
|||
srSP("Mart")
|
||||
trTR("Mart")
|
||||
zhCN("三月")
|
||||
zhTW("三月")
|
||||
|
||||
T_("date\vApril")
|
||||
csCZ("Duben")
|
||||
|
|
@ -290,6 +308,7 @@ ruRU("Апрель")
|
|||
srSP("April")
|
||||
trTR("Nisan")
|
||||
zhCN("四月")
|
||||
zhTW("四月")
|
||||
|
||||
T_("date\vMay")
|
||||
csCZ("Květen")
|
||||
|
|
@ -305,6 +324,7 @@ ruRU("Май")
|
|||
srSP("Maj")
|
||||
trTR("Mayıs")
|
||||
zhCN("五月")
|
||||
zhTW("五月")
|
||||
|
||||
T_("date\vJune")
|
||||
csCZ("Červen")
|
||||
|
|
@ -320,6 +340,7 @@ ruRU("Июнь")
|
|||
srSP("Jun")
|
||||
trTR("Haziran")
|
||||
zhCN("六月")
|
||||
zhTW("六月")
|
||||
|
||||
T_("date\vJuly")
|
||||
csCZ("Červenec")
|
||||
|
|
@ -335,6 +356,7 @@ ruRU("Июль")
|
|||
srSP("Jul")
|
||||
trTR("Temmuz")
|
||||
zhCN("七月")
|
||||
zhTW("七月")
|
||||
|
||||
T_("date\vAugust")
|
||||
csCZ("Srpen")
|
||||
|
|
@ -350,6 +372,7 @@ ruRU("Август")
|
|||
srSP("Avgust")
|
||||
trTR("Ağustos")
|
||||
zhCN("八月")
|
||||
zhTW("八月")
|
||||
|
||||
T_("date\vSeptember")
|
||||
csCZ("Září")
|
||||
|
|
@ -365,6 +388,7 @@ ruRU("Сентябрь")
|
|||
srSP("Septembar")
|
||||
trTR("Eylül")
|
||||
zhCN("九月")
|
||||
zhTW("九月")
|
||||
|
||||
T_("date\vOctober")
|
||||
csCZ("Říjen")
|
||||
|
|
@ -380,6 +404,7 @@ ruRU("Октябрь")
|
|||
srSP("Oktobar")
|
||||
trTR("Ekim")
|
||||
zhCN("十月")
|
||||
zhTW("十月")
|
||||
|
||||
T_("date\vNovember")
|
||||
csCZ("Listopad")
|
||||
|
|
@ -395,6 +420,7 @@ ruRU("Ноябрь")
|
|||
srSP("Novembar")
|
||||
trTR("Kasım")
|
||||
zhCN("十一月")
|
||||
zhTW("十一月")
|
||||
|
||||
T_("date\vDecember")
|
||||
csCZ("Prosinec")
|
||||
|
|
@ -410,6 +436,7 @@ ruRU("Декабрь")
|
|||
srSP("Decembar")
|
||||
trTR("Aralık")
|
||||
zhCN("十二月")
|
||||
zhTW("十二月")
|
||||
|
||||
T_("sdate\vJan")
|
||||
csCZ("Led")
|
||||
|
|
@ -425,6 +452,7 @@ ruRU("Янв")
|
|||
srSP("Jan")
|
||||
trTR("Ock")
|
||||
zhCN("Jan")
|
||||
zhTW("Jan")
|
||||
|
||||
T_("sdate\vFeb")
|
||||
csCZ("Úno")
|
||||
|
|
@ -440,6 +468,7 @@ ruRU("Фев")
|
|||
srSP("Feb")
|
||||
trTR("Şub")
|
||||
zhCN("Feb")
|
||||
zhTW("Feb")
|
||||
|
||||
T_("sdate\vMar")
|
||||
csCZ("Bře")
|
||||
|
|
@ -455,6 +484,7 @@ ruRU("Мрт")
|
|||
srSP("Mar")
|
||||
trTR("Mar")
|
||||
zhCN("Mar")
|
||||
zhTW("Mar")
|
||||
|
||||
T_("sdate\vApr")
|
||||
csCZ("Dub")
|
||||
|
|
@ -470,6 +500,7 @@ ruRU("Апр")
|
|||
srSP("Apr")
|
||||
trTR("Nis")
|
||||
zhCN("Apr")
|
||||
zhTW("Apr")
|
||||
|
||||
T_("sdate\vMay")
|
||||
csCZ("Kvě")
|
||||
|
|
@ -485,6 +516,7 @@ ruRU("Май")
|
|||
srSP("Maj")
|
||||
trTR("May")
|
||||
zhCN("May")
|
||||
zhTW("May")
|
||||
|
||||
T_("sdate\vJun")
|
||||
csCZ("Čer")
|
||||
|
|
@ -500,6 +532,7 @@ ruRU("Инь")
|
|||
srSP("Jun")
|
||||
trTR("Haz")
|
||||
zhCN("Jun")
|
||||
zhTW("Jun")
|
||||
|
||||
T_("sdate\vJul")
|
||||
csCZ("Čec")
|
||||
|
|
@ -515,6 +548,7 @@ ruRU("Иль")
|
|||
srSP("Jul")
|
||||
trTR("Tem")
|
||||
zhCN("Jul")
|
||||
zhTW("Jul")
|
||||
|
||||
T_("sdate\vAug")
|
||||
csCZ("Srp")
|
||||
|
|
@ -530,6 +564,7 @@ ruRU("Авг")
|
|||
srSP("Avg")
|
||||
trTR("Ağu")
|
||||
zhCN("Aug")
|
||||
zhTW("Aug")
|
||||
|
||||
T_("sdate\vSep")
|
||||
csCZ("Zář")
|
||||
|
|
@ -545,6 +580,7 @@ ruRU("Сен")
|
|||
srSP("Sep")
|
||||
trTR("Eyl")
|
||||
zhCN("Sep")
|
||||
zhTW("Sep")
|
||||
|
||||
T_("sdate\vOct")
|
||||
csCZ("Říj")
|
||||
|
|
@ -560,6 +596,7 @@ ruRU("Окт")
|
|||
srSP("Okt")
|
||||
trTR("Ekm")
|
||||
zhCN("Oct")
|
||||
zhTW("Oct")
|
||||
|
||||
T_("sdate\vNov")
|
||||
csCZ("Lis")
|
||||
|
|
@ -575,6 +612,7 @@ ruRU("Ноя")
|
|||
srSP("Nov")
|
||||
trTR("Kas")
|
||||
zhCN("Nov")
|
||||
zhTW("Nov")
|
||||
|
||||
T_("sdate\vDec")
|
||||
csCZ("Pro")
|
||||
|
|
@ -590,6 +628,7 @@ ruRU("Дек")
|
|||
srSP("Dec")
|
||||
trTR("Arl")
|
||||
zhCN("Dec")
|
||||
zhTW("Dec")
|
||||
|
||||
|
||||
// Convert.cpp
|
||||
|
|
@ -608,6 +647,7 @@ ruRU("Неправильное число!")
|
|||
srSP("Pogrešan broj!")
|
||||
trTR("Geçersiz sayı !")
|
||||
zhCN("无效数字!")
|
||||
zhTW("無效數字!")
|
||||
|
||||
T_("Invalid date !")
|
||||
csCZ("Chybný zápis data !")
|
||||
|
|
@ -623,6 +663,7 @@ ruRU("Неправильная дата!")
|
|||
srSP("Pogrešan datum!")
|
||||
trTR("Geçersiz tarih !")
|
||||
zhCN("无效日期")
|
||||
zhTW("無效日期")
|
||||
|
||||
T_("Invalid time !")
|
||||
csCZ("Chybný čas")
|
||||
|
|
@ -638,6 +679,7 @@ ruRU("Неправильное время !")
|
|||
srSP("")
|
||||
trTR("Geçersiz Zaman !")
|
||||
zhCN("")
|
||||
zhTW("無效時間")
|
||||
|
||||
T_("Null value not allowed.")
|
||||
csCZ("Hodnota nesmí být prázdná.")
|
||||
|
|
@ -653,6 +695,7 @@ ruRU("Нулевое значение не разрешено.")
|
|||
srSP("Bez vrednosti nisu dopuštene.")
|
||||
trTR("Bu alan boş bırakılamaz.")
|
||||
zhCN("不允许空值.")
|
||||
zhTW("不允許空值.")
|
||||
|
||||
T_("Number must be between %d and %d.")
|
||||
csCZ("Číslo musí být v rozsahu %d až %d.")
|
||||
|
|
@ -669,6 +712,7 @@ ruRU("Число должно быть в пределах между %d и "
|
|||
srSP("Broj mora biti između %d i %d.")
|
||||
trTR("Girilen sayı %d ile %d aralığında olmaldır.")
|
||||
zhCN("数字必须在%d和%d之间.")
|
||||
zhTW("數字必須在%d和%d之間.")
|
||||
|
||||
T_("Number must be between %g and %g.")
|
||||
csCZ("Číslo musí být v rozsahu %g až %g.")
|
||||
|
|
@ -685,6 +729,7 @@ ruRU("Число должно быть в пределах между %g и "
|
|||
srSP("Broj mora biti između %g i %g.")
|
||||
trTR("Girilen sayı %g ile %g aralığında olmaldır.")
|
||||
zhCN("数字必须在%g和%g之间.")
|
||||
zhTW("數字必須在%g和%g之間.")
|
||||
|
||||
T_("Date must be between ")
|
||||
csCZ("Datum musí být v rozsahu ")
|
||||
|
|
@ -700,6 +745,7 @@ ruRU("Дата должна быть в пределах ")
|
|||
srSP("Datum mora biti između ")
|
||||
trTR("Girilen tarih")
|
||||
zhCN("日期必须介入")
|
||||
zhTW("日期必須介於")
|
||||
|
||||
T_("range\v and ")
|
||||
csCZ(" až ")
|
||||
|
|
@ -715,6 +761,7 @@ ruRU(" и ")
|
|||
srSP(" i ")
|
||||
trTR(" and ")
|
||||
zhCN(" 和 ")
|
||||
zhTW(" 和 ")
|
||||
|
||||
T_("Time must be between ")
|
||||
csCZ("Čas musí být od")
|
||||
|
|
@ -730,6 +777,7 @@ ruRU("Время должно быть в интервале")
|
|||
srSP("")
|
||||
trTR("Time must be between ")
|
||||
zhCN("")
|
||||
zhTW("時間必須介於 ")
|
||||
|
||||
T_("Please enter no more than %d characters.")
|
||||
csCZ("Text nesmí být delší než %d znaků.")
|
||||
|
|
@ -745,6 +793,7 @@ ruRU("Пожайлуста, введите не более чем %d симво
|
|||
srSP("Molim vas unesite najviše %d slova.")
|
||||
trTR("Lütfen en fazla %d karakter girin.")
|
||||
zhCN("输入请不要超过%d字符")
|
||||
zhTW("輸入請不要超過%d字元")
|
||||
|
||||
|
||||
// t.cpp
|
||||
|
|
@ -763,6 +812,7 @@ ruRU("%3:02d.%2:02d.%1:04d")
|
|||
srSP("%3:02d.%2:02d.%1:04d")
|
||||
trTR("%3:02d.%2:02d.%1:04d")
|
||||
zhCN("%2:02d/%3:02d/%1:4d")
|
||||
zhTW("%2:02d/%3:02d/%1:4d")
|
||||
|
||||
T_("date-scan\amdy")
|
||||
csCZ("dmy")
|
||||
|
|
@ -778,6 +828,7 @@ ruRU("dmy")
|
|||
srSP("dmy")
|
||||
trTR("dmy")
|
||||
zhCN("mdy")
|
||||
zhTW("mdy")
|
||||
|
||||
T_("date-filter\aA/\a .-")
|
||||
csCZ(".\a /,")
|
||||
|
|
@ -793,6 +844,7 @@ ruRU(".\a /,")
|
|||
srSP(".\a /,")
|
||||
trTR(".\a /,")
|
||||
zhCN("A/\a .-")
|
||||
zhTW("A/\a .-")
|
||||
|
||||
|
||||
// Lang.cpp
|
||||
|
|
@ -811,6 +863,7 @@ ruRU("Неправильная спецификация языка.")
|
|||
srSP("Nevalidna specifikacija jezika.")
|
||||
trTR("Geçersiz dil.")
|
||||
zhCN("无效语言指示")
|
||||
zhTW("無效語言指示")
|
||||
|
||||
|
||||
// Obsolete
|
||||
|
|
@ -829,6 +882,7 @@ ruRU("неправильное число дня месяца.")
|
|||
srSP("nevalidan dan.")
|
||||
trTR("geçersiz gün.")
|
||||
zhCN("无效天数")
|
||||
zhTW("無效天數")
|
||||
|
||||
T_("invalid month number.")
|
||||
csCZ("neplatné číslo měsíce.")
|
||||
|
|
@ -844,6 +898,7 @@ ruRU("неправильное число месяца.")
|
|||
srSP("nevalidan mesec.")
|
||||
trTR("geçersiz ay.")
|
||||
zhCN("无效月数")
|
||||
zhTW("無效月數")
|
||||
|
||||
T_("invalid year number.")
|
||||
csCZ("neplatné číslo roku.")
|
||||
|
|
@ -859,6 +914,7 @@ ruRU("неправильное число года.")
|
|||
srSP("nevalidana godina.")
|
||||
trTR("geçersiz yıl.")
|
||||
zhCN("无效年数")
|
||||
zhTW("無效年數")
|
||||
|
||||
T_("invalid hour number.")
|
||||
csCZ("chybné číslo hodiny.")
|
||||
|
|
@ -874,6 +930,7 @@ ruRU("неправильное число часа.")
|
|||
srSP("nevalidan sat.")
|
||||
trTR("geçersiz saat.")
|
||||
zhCN("无效小时")
|
||||
zhTW("無效小時")
|
||||
|
||||
T_("invalid minute number.")
|
||||
csCZ("chybné číslo minuty.")
|
||||
|
|
@ -889,6 +946,7 @@ ruRU("неправильное число минуты.")
|
|||
srSP("nevalidna minuta.")
|
||||
trTR("geçersiz dakika.")
|
||||
zhCN("无效分")
|
||||
zhTW("無效分")
|
||||
|
||||
T_("invalid second number.")
|
||||
csCZ("chybné číslo sekundy.")
|
||||
|
|
@ -904,6 +962,7 @@ ruRU("неправильное число секунды.")
|
|||
srSP("nevalidna sekunda.")
|
||||
trTR("geçersiz saniye.")
|
||||
zhCN("无效秒")
|
||||
zhTW("無效秒")
|
||||
|
||||
T_("invalid character '%c' following date/time.")
|
||||
csCZ("neplatný znak '%c' za koncem data.")
|
||||
|
|
@ -919,6 +978,7 @@ ruRU("неправильный символ '%c' идущий за датой/в
|
|||
srSP("nevalidni karakter '%c' posle datuma/vremena.")
|
||||
trTR("girilen tarih/zaman bilgisi içindeki '%c' geçersiz bir karakterdir.")
|
||||
zhCN("日期/时间后跟字符 '%c' 无效")
|
||||
zhTW("日期/時間後跟字元 '%c' 無效")
|
||||
|
||||
T_("invalid day number %d - February in year %d has only %d days.")
|
||||
csCZ("neplatné číslo dne %d - únor v roce %d má pouze %d dní.")
|
||||
|
|
@ -936,6 +996,7 @@ srSP("nevalidan dan %d - Februar u godini %d ima %d dana.")
|
|||
trTR("%d geçersiz bir gün sayısıdır - %d yılında Şubat ayı %d gün "
|
||||
"çeker.")
|
||||
zhCN("无效天数 %d - %d年二月只有%d天.")
|
||||
zhTW("無效天數 %d - %d年二月只有%d天.")
|
||||
|
||||
T_("invalid day number %d - %month has only %d days.")
|
||||
csCZ("neplatné číslo dne %d - %month má pouze %d dní.")
|
||||
|
|
@ -952,6 +1013,7 @@ ruRU("неправильное число месяца %d - В %month тольк
|
|||
srSP("nevalidan dan %d - %month ima %d dana.")
|
||||
trTR("%d geçersiz bir gün sayısıdır - %month ayı %d gün çeker.")
|
||||
zhCN("无效天数 %d - %month月只有 %d 天.")
|
||||
zhTW("無效天數 %d - %month月只有 %d 天.")
|
||||
|
||||
T_("exceeded valid range (lower bound: %`).")
|
||||
csCZ("překročení povoleného rozsahu (dolní mez: %`).")
|
||||
|
|
@ -968,6 +1030,7 @@ ruRU("превышен допустимый предел (нижний пред
|
|||
srSP("prekoračena validna granica (donja granica: %`).")
|
||||
trTR("Geçerli aralık aşıldı (alt sınır: %`).")
|
||||
zhCN("超出有效范围(下限:%`).")
|
||||
zhTW("超出有效範圍(下限:%`).")
|
||||
|
||||
T_("exceeded valid range (upper bound: %`).")
|
||||
csCZ("překročení povoleného rozsahu (horní mez: %`).")
|
||||
|
|
@ -984,6 +1047,7 @@ ruRU("превышен допустимый предел (верхний пре
|
|||
srSP("prekoračena validna granica (gornja granica: %`).")
|
||||
trTR("Geçerli aralık aşıldı (üst sınır: %`).")
|
||||
zhCN("超出有效范围(上限:%`).")
|
||||
zhTW("超出有效範圍(上限:%`).")
|
||||
|
||||
T_("Invalid date/time: digit expected, found character")
|
||||
csCZ("Chybné datum/čas: očekávána číslice, nalezen znak")
|
||||
|
|
@ -1000,6 +1064,7 @@ ruRU("Неправильные дата/время: ожидается цифр
|
|||
srSP("Nevalidan datum/vreme: očekuje se cifra, pronađen karakter")
|
||||
trTR("Geçersiz tarih/zaman: sayı olması gereken yerde harf var")
|
||||
zhCN("无效日期/时间:只能是数字,不能为字符")
|
||||
zhTW("無效日期/時間:只能是數位,不能為字元")
|
||||
|
||||
T_("Invalid date/time:")
|
||||
csCZ("Chybné datum/čas:")
|
||||
|
|
@ -1015,3 +1080,4 @@ ruRU("Неправильные дата/время:")
|
|||
srSP("Nevalidan datum/vreme:")
|
||||
trTR("Geçersiz tarih/zaman:")
|
||||
zhCN("无效日期/时间:")
|
||||
zhTW("無效日期/時間:")
|
||||
|
|
|
|||
|
|
@ -321,6 +321,7 @@ const int *GetAllLanguages() {
|
|||
LNG_('L', 'T', 'L', 'T'),
|
||||
LNG_('U', 'K', 'U', 'A'),
|
||||
LNG_('Z', 'H', 'C', 'N'),
|
||||
LNG_('Z', 'H', 'T', 'W'),
|
||||
LNG_('K', 'O', 'K', 'R'),
|
||||
LNG_('J', 'A', 'J', 'P'),
|
||||
0
|
||||
|
|
|
|||
|
|
@ -113,7 +113,7 @@ void LogStream::Create(const char *path, bool append)
|
|||
if(append)
|
||||
filesize = (int)SetFilePointer(hfile, 0, NULL, FILE_END);
|
||||
#else
|
||||
hfile = open(filename, append ? O_CREAT|O_RDWR : O_CREAT|O_RDWR|O_TRUNC, 0644);
|
||||
hfile = open(filename, append ? O_CREAT|O_RDWR|O_APPEND : O_CREAT|O_RDWR|O_TRUNC, 0644);
|
||||
if(append)
|
||||
filesize = (int)lseek(hfile, 0, SEEK_END);
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -960,10 +960,17 @@ Array<FileSystemInfo::FileInfo> FileSystemInfo::Find(String mask, int max_count)
|
|||
f.filename = drive;
|
||||
char name[256], system[256];
|
||||
DWORD d;
|
||||
if(c != 'A' && c != 'B' && n != DRIVE_REMOTE && n != DRIVE_UNKNOWN &&
|
||||
GetVolumeInformation(drive, name, 256, &d, &d, &d, system, 256)) {
|
||||
if(*name) f.root_desc << " " << FromSystemCharset(name);
|
||||
if(*system) f.root_desc << " [ " << FromSystemCharset(system) << " ]";
|
||||
if(c != 'A' && c != 'B' && n != DRIVE_REMOTE && n != DRIVE_UNKNOWN) {
|
||||
bool b = GetVolumeInformation(drive, name, 256, &d, &d, &d, system, 256);
|
||||
if(b) {
|
||||
if(*name) f.root_desc << " " << FromSystemCharset(name);
|
||||
if(*system) f.root_desc << " [ " << FromSystemCharset(system) << " ]";
|
||||
}
|
||||
else
|
||||
if(n == DRIVE_REMOVABLE) {
|
||||
fi.Drop();
|
||||
continue;
|
||||
}
|
||||
}
|
||||
switch(n)
|
||||
{
|
||||
|
|
|
|||
|
|
@ -199,8 +199,7 @@ String GetTempFileName(const char *prefix = NULL);
|
|||
template <class T>
|
||||
class Array;
|
||||
|
||||
class FileSystemInfo
|
||||
{
|
||||
class FileSystemInfo {
|
||||
public:
|
||||
enum
|
||||
{
|
||||
|
|
|
|||
|
|
@ -78,6 +78,11 @@ int CharFilterDefaultToUpperAscii(int c)
|
|||
return ToUpper(ToAscii(c, CHARSET_DEFAULT));
|
||||
}
|
||||
|
||||
int CharFilterCrLf(int c)
|
||||
{
|
||||
return c == '\r' || c == '\n' ? c : 0;
|
||||
}
|
||||
|
||||
String Filter(const char *s, int (*filter)(int))
|
||||
{
|
||||
String result;
|
||||
|
|
|
|||
|
|
@ -775,6 +775,7 @@ int CharFilterAlphaToLower(int c);
|
|||
int CharFilterInt(int c);
|
||||
int CharFilterDouble(int c);
|
||||
int CharFilterDefaultToUpperAscii(int c);
|
||||
int CharFilterCrLf(int c);
|
||||
|
||||
String Filter(const char *s, int (*filter)(int));
|
||||
String FilterWhile(const char *s, int (*filter)(int));
|
||||
|
|
|
|||
|
|
@ -35,6 +35,12 @@ void PanicMessageBox(const char *title, const char *text)
|
|||
|
||||
void Panic(const char *msg)
|
||||
{
|
||||
#ifdef PLATFORM_POSIX
|
||||
signal(SIGILL, SIG_DFL);
|
||||
signal(SIGSEGV, SIG_DFL);
|
||||
signal(SIGBUS, SIG_DFL);
|
||||
signal(SIGFPE, SIG_DFL);
|
||||
#endif
|
||||
if(PanicMode)
|
||||
return;
|
||||
PanicMode = true;
|
||||
|
|
|
|||
|
|
@ -65,6 +65,7 @@ public:
|
|||
void SkipWhites();
|
||||
|
||||
bool IsEof();
|
||||
const char *GetPtr() const { return term; }
|
||||
|
||||
bool IsTag();
|
||||
String ReadTag();
|
||||
|
|
|
|||
|
|
@ -80,6 +80,7 @@
|
|||
#define ltLT(text) { LNGC_('L','T','L','T', CHARSET_UTF8), text },
|
||||
#define ukUA(text) { LNGC_('U','K','U','A', CHARSET_UTF8), text },
|
||||
#define zhCN(text) { LNGC_('Z','H','C','N', CHARSET_UTF8), text },
|
||||
#define zhTW(text) { LNGC_('Z','H','T','W', CHARSET_UTF8), text },
|
||||
#define koKR(text) { LNGC_('K','O','K','R', CHARSET_UTF8), text },
|
||||
#define jaJP(text) { LNGC_('J','A','J','P', CHARSET_UTF8), text },
|
||||
|
||||
|
|
@ -289,6 +290,10 @@ INITBLOCK_(COMBINE3(LNG_MODULE, LNG_VERB, LNG_VERA))
|
|||
#undef lvLV
|
||||
#undef ltLT
|
||||
#undef ukUA
|
||||
#undef zhCN
|
||||
#undef zhTW
|
||||
#undef koKR
|
||||
#undef jaJP
|
||||
|
||||
#undef T_
|
||||
|
||||
|
|
|
|||
|
|
@ -182,6 +182,8 @@ enum {
|
|||
DND_MOVE = 2,
|
||||
|
||||
DND_ALL = 3,
|
||||
|
||||
DND_EXACTIMAGE = 0x80000000,
|
||||
};
|
||||
|
||||
struct UDropTarget;
|
||||
|
|
|
|||
|
|
@ -11,6 +11,7 @@ huHU("Ctrl+")
|
|||
roRO("tastă\vCtrl+")
|
||||
ruRU("")
|
||||
trTR("Ctrl+")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vAlt+")
|
||||
deDE("Alt+")
|
||||
|
|
@ -20,6 +21,7 @@ huHU("Alt+")
|
|||
roRO("tastă\vAlt+")
|
||||
ruRU("")
|
||||
trTR("Alt+")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vShift+")
|
||||
deDE("Umschalt+")
|
||||
|
|
@ -29,6 +31,7 @@ huHU("Shift+")
|
|||
roRO("tastă\vShift+")
|
||||
ruRU("")
|
||||
trTR("Shift+")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vTab")
|
||||
deDE("Tab")
|
||||
|
|
@ -38,6 +41,7 @@ huHU("Tab")
|
|||
roRO("tastă\vTab")
|
||||
ruRU("")
|
||||
trTR("Tab")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vSpace")
|
||||
deDE("Leertaste")
|
||||
|
|
@ -47,6 +51,7 @@ huHU("Space")
|
|||
roRO("tastă\vSpațiu")
|
||||
ruRU("")
|
||||
trTR("Space")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vEnter")
|
||||
deDE("Eingabetaste")
|
||||
|
|
@ -56,6 +61,7 @@ huHU("Enter")
|
|||
roRO("tastă\vEnter")
|
||||
ruRU("")
|
||||
trTR("Enter")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vBackspace")
|
||||
deDE("Rückschritt")
|
||||
|
|
@ -65,6 +71,7 @@ huHU("Backspace")
|
|||
roRO("tastă\vBackspace")
|
||||
ruRU("")
|
||||
trTR("Backspace")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vCaps Lock")
|
||||
deDE("Umschaltverriegelung")
|
||||
|
|
@ -74,6 +81,7 @@ huHU("Caps Lock")
|
|||
roRO("tastă\vCaps Lock")
|
||||
ruRU("")
|
||||
trTR("Caps Lock")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vEsc")
|
||||
deDE("Esc")
|
||||
|
|
@ -83,6 +91,7 @@ huHU("Esc")
|
|||
roRO("tastă\vEsc")
|
||||
ruRU("")
|
||||
trTR("Esc")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vPage Up")
|
||||
deDE("Bild hoch")
|
||||
|
|
@ -92,6 +101,7 @@ huHU("Page Up")
|
|||
roRO("tastă\vPage Up")
|
||||
ruRU("")
|
||||
trTR("Page Up")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vPage Down")
|
||||
deDE("Bild runter")
|
||||
|
|
@ -101,6 +111,7 @@ huHU("Page Down")
|
|||
roRO("tastă\vPage Down")
|
||||
ruRU("")
|
||||
trTR("Page Down")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vEnd")
|
||||
deDE("Ende")
|
||||
|
|
@ -110,6 +121,7 @@ huHU("End")
|
|||
roRO("tastă\vEnd")
|
||||
ruRU("")
|
||||
trTR("End")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vHome")
|
||||
deDE("Pos1")
|
||||
|
|
@ -119,6 +131,7 @@ huHU("Home")
|
|||
roRO("tastă\vHome")
|
||||
ruRU("")
|
||||
trTR("Home")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vLeft")
|
||||
deDE("Links")
|
||||
|
|
@ -128,6 +141,7 @@ huHU("Bal")
|
|||
roRO("tastă\vStânga")
|
||||
ruRU("")
|
||||
trTR("Left")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vUp")
|
||||
deDE("Hoch")
|
||||
|
|
@ -137,6 +151,7 @@ huHU("Up")
|
|||
roRO("tastă\vSus")
|
||||
ruRU("")
|
||||
trTR("Up")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vRight")
|
||||
deDE("Rechts")
|
||||
|
|
@ -146,6 +161,7 @@ huHU("Jobb")
|
|||
roRO("tastă\vDreapta")
|
||||
ruRU("")
|
||||
trTR("Right")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vDown")
|
||||
deDE("Runter")
|
||||
|
|
@ -155,6 +171,7 @@ huHU("Down")
|
|||
roRO("tastă\vJos")
|
||||
ruRU("")
|
||||
trTR("Down")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vInsert")
|
||||
deDE("Einfg")
|
||||
|
|
@ -164,6 +181,7 @@ huHU("Insert")
|
|||
roRO("tastă\vInsert")
|
||||
ruRU("")
|
||||
trTR("Insert")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vDelete")
|
||||
deDE("Entf")
|
||||
|
|
@ -173,6 +191,7 @@ huHU("Delete")
|
|||
roRO("tastă\vDelete")
|
||||
ruRU("")
|
||||
trTR("Delete")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vBreak")
|
||||
deDE("UntBr")
|
||||
|
|
@ -182,6 +201,7 @@ huHU("Break")
|
|||
roRO("tastă\vBreak")
|
||||
ruRU("")
|
||||
trTR("Break")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vNum[*]")
|
||||
deDE("Num[*]")
|
||||
|
|
@ -191,6 +211,7 @@ huHU("Num[*]")
|
|||
roRO("tastă\vNum[*]")
|
||||
ruRU("")
|
||||
trTR("Num[*]")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vNum[+]")
|
||||
deDE("Num[+]")
|
||||
|
|
@ -200,6 +221,7 @@ huHU("Num[+]")
|
|||
roRO("tastă\vNum[+]")
|
||||
ruRU("")
|
||||
trTR("Num[+]")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vNum[-]")
|
||||
deDE("Num[-]")
|
||||
|
|
@ -209,6 +231,7 @@ huHU("Num[-]")
|
|||
roRO("tastă\vNum[-]")
|
||||
ruRU("")
|
||||
trTR("Num[-]")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vNum[/]")
|
||||
deDE("Num[/]")
|
||||
|
|
@ -218,6 +241,7 @@ huHU("Num[/]")
|
|||
roRO("tastă\vNum[/]")
|
||||
ruRU("")
|
||||
trTR("Num[/]")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vAlt")
|
||||
deDE("Alt")
|
||||
|
|
@ -227,6 +251,7 @@ huHU("Alt")
|
|||
roRO("tastă\vAlt")
|
||||
ruRU("")
|
||||
trTR("Alt")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vShift")
|
||||
deDE("Umschalt")
|
||||
|
|
@ -236,6 +261,7 @@ huHU("Shift")
|
|||
roRO("tastă\vShift")
|
||||
ruRU("")
|
||||
trTR("Shift")
|
||||
zhTW("")
|
||||
|
||||
T_("key\vCtrl")
|
||||
deDE("Strg")
|
||||
|
|
@ -245,3 +271,4 @@ huHU("Ctrl")
|
|||
roRO("tastă\vCtrl")
|
||||
ruRU("")
|
||||
trTR("Ctrl")
|
||||
zhTW("")
|
||||
|
|
|
|||
|
|
@ -485,9 +485,9 @@ int Ctrl::DoDragAndDrop(const char *fmts, const Image& sample, dword actions,
|
|||
DWORD result = 0;
|
||||
Image m = Ctrl::OverrideCursor(CtrlCoreImg::DndMove());
|
||||
if(actions & DND_COPY)
|
||||
dsrc->copy = MakeDragImage(CtrlCoreImg::DndCopy(), CtrlCoreImg::DndCopy98(), sample);
|
||||
dsrc->copy = actions & DND_EXACTIMAGE ? sample : MakeDragImage(CtrlCoreImg::DndCopy(), CtrlCoreImg::DndCopy98(), sample);
|
||||
if(actions & DND_MOVE)
|
||||
dsrc->move = MakeDragImage(CtrlCoreImg::DndMove(), CtrlCoreImg::DndMove98(), sample);
|
||||
dsrc->move = actions & DND_EXACTIMAGE ? sample : MakeDragImage(CtrlCoreImg::DndMove(), CtrlCoreImg::DndMove98(), sample);
|
||||
sDnDSource = this;
|
||||
HRESULT r = DoDragDrop(obj, dsrc,
|
||||
(actions & DND_COPY ? DROPEFFECT_COPY : 0) |
|
||||
|
|
|
|||
|
|
@ -1,109 +1,109 @@
|
|||
K_BACK = VK_BACK + K_DELTA,
|
||||
K_BACKSPACE = VK_BACK + K_DELTA,
|
||||
|
||||
K_TAB = 9,
|
||||
|
||||
K_SPACE = 32,
|
||||
|
||||
K_RETURN = 13,
|
||||
K_ENTER = K_RETURN,
|
||||
|
||||
K_SHIFT_KEY = VK_SHIFT + K_DELTA,
|
||||
K_CTRL_KEY = VK_CONTROL + K_DELTA,
|
||||
K_ALT_KEY = VK_MENU + K_DELTA,
|
||||
K_CAPSLOCK = VK_CAPITAL + K_DELTA,
|
||||
K_ESCAPE = VK_ESCAPE + K_DELTA,
|
||||
K_PRIOR = VK_PRIOR + K_DELTA,
|
||||
K_PAGEUP = VK_PRIOR + K_DELTA,
|
||||
K_NEXT = VK_NEXT + K_DELTA,
|
||||
K_PAGEDOWN = VK_NEXT + K_DELTA,
|
||||
K_END = VK_END + K_DELTA,
|
||||
K_HOME = VK_HOME + K_DELTA,
|
||||
K_LEFT = VK_LEFT + K_DELTA,
|
||||
K_UP = VK_UP + K_DELTA,
|
||||
K_RIGHT = VK_RIGHT + K_DELTA,
|
||||
K_DOWN = VK_DOWN + K_DELTA,
|
||||
K_INSERT = VK_INSERT + K_DELTA,
|
||||
K_DELETE = VK_DELETE + K_DELTA,
|
||||
|
||||
K_NUMPAD0 = VK_NUMPAD0 + K_DELTA,
|
||||
K_NUMPAD1 = VK_NUMPAD1 + K_DELTA,
|
||||
K_NUMPAD2 = VK_NUMPAD2 + K_DELTA,
|
||||
K_NUMPAD3 = VK_NUMPAD3 + K_DELTA,
|
||||
K_NUMPAD4 = VK_NUMPAD4 + K_DELTA,
|
||||
K_NUMPAD5 = VK_NUMPAD5 + K_DELTA,
|
||||
K_NUMPAD6 = VK_NUMPAD6 + K_DELTA,
|
||||
K_NUMPAD7 = VK_NUMPAD7 + K_DELTA,
|
||||
K_NUMPAD8 = VK_NUMPAD8 + K_DELTA,
|
||||
K_NUMPAD9 = VK_NUMPAD9 + K_DELTA,
|
||||
K_MULTIPLY = VK_MULTIPLY + K_DELTA,
|
||||
K_ADD = VK_ADD + K_DELTA,
|
||||
K_SEPARATOR = VK_SEPARATOR + K_DELTA,
|
||||
K_SUBTRACT = VK_SUBTRACT + K_DELTA,
|
||||
K_DECIMAL = VK_DECIMAL + K_DELTA,
|
||||
K_DIVIDE = VK_DIVIDE + K_DELTA,
|
||||
K_SCROLL = VK_SCROLL + K_DELTA,
|
||||
|
||||
K_F1 = VK_F1 + K_DELTA,
|
||||
K_F2 = VK_F2 + K_DELTA,
|
||||
K_F3 = VK_F3 + K_DELTA,
|
||||
K_F4 = VK_F4 + K_DELTA,
|
||||
K_F5 = VK_F5 + K_DELTA,
|
||||
K_F6 = VK_F6 + K_DELTA,
|
||||
K_F7 = VK_F7 + K_DELTA,
|
||||
K_F8 = VK_F8 + K_DELTA,
|
||||
K_F9 = VK_F9 + K_DELTA,
|
||||
K_F10 = VK_F10 + K_DELTA,
|
||||
K_F11 = VK_F11 + K_DELTA,
|
||||
K_F12 = VK_F12 + K_DELTA,
|
||||
|
||||
K_A = 'A' + K_DELTA,
|
||||
K_B = 'B' + K_DELTA,
|
||||
K_C = 'C' + K_DELTA,
|
||||
K_D = 'D' + K_DELTA,
|
||||
K_E = 'E' + K_DELTA,
|
||||
K_F = 'F' + K_DELTA,
|
||||
K_G = 'G' + K_DELTA,
|
||||
K_H = 'H' + K_DELTA,
|
||||
K_I = 'I' + K_DELTA,
|
||||
K_J = 'J' + K_DELTA,
|
||||
K_K = 'K' + K_DELTA,
|
||||
K_L = 'L' + K_DELTA,
|
||||
K_M = 'M' + K_DELTA,
|
||||
K_N = 'N' + K_DELTA,
|
||||
K_O = 'O' + K_DELTA,
|
||||
K_P = 'P' + K_DELTA,
|
||||
K_Q = 'Q' + K_DELTA,
|
||||
K_R = 'R' + K_DELTA,
|
||||
K_S = 'S' + K_DELTA,
|
||||
K_T = 'T' + K_DELTA,
|
||||
K_U = 'U' + K_DELTA,
|
||||
K_V = 'V' + K_DELTA,
|
||||
K_W = 'W' + K_DELTA,
|
||||
K_X = 'X' + K_DELTA,
|
||||
K_Y = 'Y' + K_DELTA,
|
||||
K_Z = 'Z' + K_DELTA,
|
||||
K_0 = '0' + K_DELTA,
|
||||
K_1 = '1' + K_DELTA,
|
||||
K_2 = '2' + K_DELTA,
|
||||
K_3 = '3' + K_DELTA,
|
||||
K_4 = '4' + K_DELTA,
|
||||
K_5 = '5' + K_DELTA,
|
||||
K_6 = '6' + K_DELTA,
|
||||
K_7 = '7' + K_DELTA,
|
||||
K_8 = '8' + K_DELTA,
|
||||
K_9 = '9' + K_DELTA,
|
||||
|
||||
K_CTRL_LBRACKET = K_CTRL|219|K_DELTA,
|
||||
K_CTRL_RBRACKET = K_CTRL|221|K_DELTA,
|
||||
K_CTRL_MINUS = K_CTRL|0xbd|K_DELTA,
|
||||
K_CTRL_GRAVE = K_CTRL|0xc0|K_DELTA,
|
||||
K_CTRL_SLASH = K_CTRL|0xbf|K_DELTA,
|
||||
K_CTRL_BACKSLASH = K_CTRL|0xdc|K_DELTA,
|
||||
K_CTRL_COMMA = K_CTRL|0xbc|K_DELTA,
|
||||
K_CTRL_PERIOD = K_CTRL|0xbe|K_DELTA,
|
||||
K_CTRL_SEMICOLON = K_CTRL|0xbe|K_DELTA,
|
||||
K_CTRL_EQUAL = K_CTRL|0xbb|K_DELTA,
|
||||
K_CTRL_APOSTROPHE= K_CTRL|0xde|K_DELTA,
|
||||
|
||||
K_BREAK = VK_CANCEL + K_DELTA,
|
||||
K_BACK = VK_BACK + K_DELTA,
|
||||
K_BACKSPACE = VK_BACK + K_DELTA,
|
||||
|
||||
K_TAB = 9,
|
||||
|
||||
K_SPACE = 32,
|
||||
|
||||
K_RETURN = 13,
|
||||
K_ENTER = K_RETURN,
|
||||
|
||||
K_SHIFT_KEY = VK_SHIFT + K_DELTA,
|
||||
K_CTRL_KEY = VK_CONTROL + K_DELTA,
|
||||
K_ALT_KEY = VK_MENU + K_DELTA,
|
||||
K_CAPSLOCK = VK_CAPITAL + K_DELTA,
|
||||
K_ESCAPE = VK_ESCAPE + K_DELTA,
|
||||
K_PRIOR = VK_PRIOR + K_DELTA,
|
||||
K_PAGEUP = VK_PRIOR + K_DELTA,
|
||||
K_NEXT = VK_NEXT + K_DELTA,
|
||||
K_PAGEDOWN = VK_NEXT + K_DELTA,
|
||||
K_END = VK_END + K_DELTA,
|
||||
K_HOME = VK_HOME + K_DELTA,
|
||||
K_LEFT = VK_LEFT + K_DELTA,
|
||||
K_UP = VK_UP + K_DELTA,
|
||||
K_RIGHT = VK_RIGHT + K_DELTA,
|
||||
K_DOWN = VK_DOWN + K_DELTA,
|
||||
K_INSERT = VK_INSERT + K_DELTA,
|
||||
K_DELETE = VK_DELETE + K_DELTA,
|
||||
|
||||
K_NUMPAD0 = VK_NUMPAD0 + K_DELTA,
|
||||
K_NUMPAD1 = VK_NUMPAD1 + K_DELTA,
|
||||
K_NUMPAD2 = VK_NUMPAD2 + K_DELTA,
|
||||
K_NUMPAD3 = VK_NUMPAD3 + K_DELTA,
|
||||
K_NUMPAD4 = VK_NUMPAD4 + K_DELTA,
|
||||
K_NUMPAD5 = VK_NUMPAD5 + K_DELTA,
|
||||
K_NUMPAD6 = VK_NUMPAD6 + K_DELTA,
|
||||
K_NUMPAD7 = VK_NUMPAD7 + K_DELTA,
|
||||
K_NUMPAD8 = VK_NUMPAD8 + K_DELTA,
|
||||
K_NUMPAD9 = VK_NUMPAD9 + K_DELTA,
|
||||
K_MULTIPLY = VK_MULTIPLY + K_DELTA,
|
||||
K_ADD = VK_ADD + K_DELTA,
|
||||
K_SEPARATOR = VK_SEPARATOR + K_DELTA,
|
||||
K_SUBTRACT = VK_SUBTRACT + K_DELTA,
|
||||
K_DECIMAL = VK_DECIMAL + K_DELTA,
|
||||
K_DIVIDE = VK_DIVIDE + K_DELTA,
|
||||
K_SCROLL = VK_SCROLL + K_DELTA,
|
||||
|
||||
K_F1 = VK_F1 + K_DELTA,
|
||||
K_F2 = VK_F2 + K_DELTA,
|
||||
K_F3 = VK_F3 + K_DELTA,
|
||||
K_F4 = VK_F4 + K_DELTA,
|
||||
K_F5 = VK_F5 + K_DELTA,
|
||||
K_F6 = VK_F6 + K_DELTA,
|
||||
K_F7 = VK_F7 + K_DELTA,
|
||||
K_F8 = VK_F8 + K_DELTA,
|
||||
K_F9 = VK_F9 + K_DELTA,
|
||||
K_F10 = VK_F10 + K_DELTA,
|
||||
K_F11 = VK_F11 + K_DELTA,
|
||||
K_F12 = VK_F12 + K_DELTA,
|
||||
|
||||
K_A = 'A' + K_DELTA,
|
||||
K_B = 'B' + K_DELTA,
|
||||
K_C = 'C' + K_DELTA,
|
||||
K_D = 'D' + K_DELTA,
|
||||
K_E = 'E' + K_DELTA,
|
||||
K_F = 'F' + K_DELTA,
|
||||
K_G = 'G' + K_DELTA,
|
||||
K_H = 'H' + K_DELTA,
|
||||
K_I = 'I' + K_DELTA,
|
||||
K_J = 'J' + K_DELTA,
|
||||
K_K = 'K' + K_DELTA,
|
||||
K_L = 'L' + K_DELTA,
|
||||
K_M = 'M' + K_DELTA,
|
||||
K_N = 'N' + K_DELTA,
|
||||
K_O = 'O' + K_DELTA,
|
||||
K_P = 'P' + K_DELTA,
|
||||
K_Q = 'Q' + K_DELTA,
|
||||
K_R = 'R' + K_DELTA,
|
||||
K_S = 'S' + K_DELTA,
|
||||
K_T = 'T' + K_DELTA,
|
||||
K_U = 'U' + K_DELTA,
|
||||
K_V = 'V' + K_DELTA,
|
||||
K_W = 'W' + K_DELTA,
|
||||
K_X = 'X' + K_DELTA,
|
||||
K_Y = 'Y' + K_DELTA,
|
||||
K_Z = 'Z' + K_DELTA,
|
||||
K_0 = '0' + K_DELTA,
|
||||
K_1 = '1' + K_DELTA,
|
||||
K_2 = '2' + K_DELTA,
|
||||
K_3 = '3' + K_DELTA,
|
||||
K_4 = '4' + K_DELTA,
|
||||
K_5 = '5' + K_DELTA,
|
||||
K_6 = '6' + K_DELTA,
|
||||
K_7 = '7' + K_DELTA,
|
||||
K_8 = '8' + K_DELTA,
|
||||
K_9 = '9' + K_DELTA,
|
||||
|
||||
K_CTRL_LBRACKET = K_CTRL|219|K_DELTA,
|
||||
K_CTRL_RBRACKET = K_CTRL|221|K_DELTA,
|
||||
K_CTRL_MINUS = K_CTRL|0xbd|K_DELTA,
|
||||
K_CTRL_GRAVE = K_CTRL|0xc0|K_DELTA,
|
||||
K_CTRL_SLASH = K_CTRL|0xbf|K_DELTA,
|
||||
K_CTRL_BACKSLASH = K_CTRL|0xdc|K_DELTA,
|
||||
K_CTRL_COMMA = K_CTRL|0xbc|K_DELTA,
|
||||
K_CTRL_PERIOD = K_CTRL|0xbe|K_DELTA,
|
||||
K_CTRL_SEMICOLON = K_CTRL|0xbe|K_DELTA,
|
||||
K_CTRL_EQUAL = K_CTRL|0xbb|K_DELTA,
|
||||
K_CTRL_APOSTROPHE= K_CTRL|0xde|K_DELTA,
|
||||
|
||||
K_BREAK = VK_CANCEL + K_DELTA,
|
||||
|
|
|
|||
|
|
@ -2,7 +2,7 @@
|
|||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
#define LLOG(x) LOG(x)
|
||||
|
||||
#ifdef PLATFORM_X11
|
||||
|
||||
|
|
|
|||
|
|
@ -1,407 +1,409 @@
|
|||
#include "CtrlCore.h"
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
#ifdef PLATFORM_X11
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
bool Xdnd_waiting_status;
|
||||
bool Xdnd_waiting_finished;
|
||||
int Xdnd_status;
|
||||
int Xdnd_version;
|
||||
|
||||
static Atom XdndEnter;
|
||||
static Atom XdndPosition;
|
||||
static Atom XdndLeave;
|
||||
static Atom XdndDrop;
|
||||
static Atom XdndStatus;
|
||||
static Atom XdndFinished;
|
||||
static Atom XdndActionCopy;
|
||||
static Atom XdndActionMove;
|
||||
|
||||
void InitDndAtoms()
|
||||
{
|
||||
if(XdndEnter) return;
|
||||
XdndEnter = XAtom("XdndEnter");
|
||||
XdndPosition = XAtom("XdndPosition");
|
||||
XdndLeave = XAtom("XdndLeave");
|
||||
XdndDrop = XAtom("XdndDrop");
|
||||
XdndStatus = XAtom("XdndStatus");
|
||||
XdndFinished = XAtom("XdndFinished");
|
||||
XdndActionCopy = XAtom("XdndActionCopy");
|
||||
XdndActionMove = XAtom("XdndActionMove");
|
||||
}
|
||||
|
||||
XEvent ClientMsg(Window src, Atom type, int format = 32)
|
||||
{
|
||||
XEvent e;
|
||||
Zero(e);
|
||||
e.xclient.type = ClientMessage;
|
||||
e.xclient.display = Xdisplay;
|
||||
e.xclient.window = src;
|
||||
e.xclient.message_type = type;
|
||||
e.xclient.format = format;
|
||||
return e;
|
||||
}
|
||||
|
||||
struct DnDLoop : LocalLoop {
|
||||
Image move, copy, reject;
|
||||
Vector<Atom> fmt;
|
||||
const VectorMap<String, ClipData> *data;
|
||||
Ptr<Ctrl> source;
|
||||
void SetFmts(Window w, Atom property);
|
||||
Window src, target;
|
||||
int action;
|
||||
|
||||
void Request(XSelectionRequestEvent *se);
|
||||
void Sync();
|
||||
String GetData(const String& f);
|
||||
void Leave();
|
||||
virtual void LeftUp(Point, dword);
|
||||
virtual bool Key(dword, int);
|
||||
virtual void MouseMove(Point p, dword);
|
||||
virtual Image CursorImage(Point, dword);
|
||||
};
|
||||
|
||||
Ptr<DnDLoop> dndloop;
|
||||
|
||||
void DnDLoop::Leave()
|
||||
{
|
||||
if(target) {
|
||||
LLOG("Sending XdndLeave to " << target);
|
||||
XEvent e = ClientMsg(target, XdndLeave);
|
||||
e.xclient.data.l[0] = src;
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
}
|
||||
}
|
||||
|
||||
void DnDLoop::Sync()
|
||||
{
|
||||
if(Xdnd_waiting_status)
|
||||
return;
|
||||
bool tx = Ctrl::TrapX11Errors();
|
||||
Window root;
|
||||
unsigned int d1;
|
||||
int x, y, d2;
|
||||
Window tgt = Xroot;
|
||||
int version;
|
||||
for(;;) {
|
||||
if(XQueryPointer(Xdisplay, tgt, &root, &tgt, &x, &y, &d2, &d2, &d1)) {
|
||||
if(!tgt)
|
||||
break;
|
||||
Vector<int> x = GetPropertyInts(tgt, XAtom("XdndAware"));
|
||||
LLOG("XdndAware " << tgt << ": " << x.GetCount());
|
||||
if(x.GetCount()) {
|
||||
Xdnd_version = x[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tgt = None;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(Xdnd_version < 3)
|
||||
tgt = None;
|
||||
if(tgt != target) {
|
||||
Leave();
|
||||
target = tgt;
|
||||
if(target) {
|
||||
LLOG("Sending XdndEnter to " << target << ", src = " << src);
|
||||
XEvent e = ClientMsg(target, XdndEnter);
|
||||
e.xclient.data.l[0] = src;
|
||||
e.xclient.data.l[1] = (fmt.GetCount() > 3) | (version << 24);
|
||||
for(int i = 0; i < min(3, fmt.GetCount()); i++)
|
||||
e.xclient.data.l[i + 2] = fmt[i];
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
}
|
||||
}
|
||||
|
||||
if(target) {
|
||||
LLOG("Sending XdndPosition to " << target << " " << x << ", " << y);
|
||||
XEvent e = ClientMsg(target, XdndPosition);
|
||||
e.xclient.data.l[0] = src;
|
||||
e.xclient.data.l[1] = 0;
|
||||
e.xclient.data.l[2] = MAKELONG(y, x);
|
||||
e.xclient.data.l[3] = Xeventtime;
|
||||
int action = XdndActionCopy;
|
||||
if(source && source->GetTopCtrl()->GetWindow() == target)
|
||||
action = XdndActionMove;
|
||||
if(GetShift())
|
||||
action = XdndActionMove;
|
||||
if(GetCtrl())
|
||||
action = XdndActionCopy;
|
||||
e.xclient.data.l[4] = action;
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
XFlush(Xdisplay);
|
||||
Xdnd_waiting_status = true;
|
||||
dword timeout = GetTickCount();
|
||||
LLOG("Waiting for XdndStatus");
|
||||
while(Xdnd_waiting_status && GetTickCount() - timeout < 200) {
|
||||
GuiSleep(0);
|
||||
ProcessEvents();
|
||||
}
|
||||
LLOG("Waiting status " << GetTickCount() - timeout << "ms");
|
||||
if(Xdnd_waiting_status) {
|
||||
LLOG("XdndStatus timeout");
|
||||
Xdnd_status = DND_NONE;
|
||||
Xdnd_waiting_status = false;
|
||||
}
|
||||
else
|
||||
LLOG("XdndStatus recieved " << Xdnd_status);
|
||||
}
|
||||
Ctrl::UntrapX11Errors(tx);
|
||||
}
|
||||
|
||||
void Ctrl::DropStatusEvent(XEvent *event)
|
||||
{
|
||||
InitDndAtoms();
|
||||
if(event->type != ClientMessage)
|
||||
return;
|
||||
LLOG("DropStatus Client Message " << XAtomName(event->xclient.message_type));
|
||||
if(event->type == ClientMessage && dndloop && event->xclient.data.l[0] == (int)dndloop->target) {
|
||||
if(event->xclient.message_type == XdndStatus && Xdnd_waiting_status) {
|
||||
LLOG("XdndStatus, xdnd action: " << XAtomName(event->xclient.data.l[4]));
|
||||
Xdnd_status = (event->xclient.data.l[1] & 1) ?
|
||||
event->xclient.data.l[4] == (int)XdndActionMove ? DND_MOVE : DND_COPY
|
||||
: DND_NONE;
|
||||
Xdnd_waiting_status = false;
|
||||
}
|
||||
if(event->xclient.message_type == XdndFinished && Xdnd_waiting_finished) {
|
||||
LLOG("XdndFinished, xdnd action: " << XAtomName(event->xclient.data.l[2]));
|
||||
if(Xdnd_version == 5)
|
||||
Xdnd_status = (event->xclient.data.l[1] & 1) ?
|
||||
event->xclient.data.l[2] == (int)XdndActionMove ? DND_MOVE : DND_COPY
|
||||
: DND_NONE;
|
||||
Xdnd_waiting_finished = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DnDLoop::LeftUp(Point, dword)
|
||||
{
|
||||
LLOG("DnDLoop::LeftUp");
|
||||
bool tx = TrapX11Errors();
|
||||
if(target) {
|
||||
LLOG("Sending XdndDrop to " << target);
|
||||
XEvent e = ClientMsg(target, XdndDrop);
|
||||
e.xclient.data.l[0] = src;
|
||||
e.xclient.data.l[1] = 0;
|
||||
e.xclient.data.l[2] = Xeventtime;
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
XFlush(Xdisplay);
|
||||
Xdnd_waiting_finished = true;
|
||||
int timeout = GetTickCount();
|
||||
LLOG("Waiting for XdndFinished");
|
||||
while(Xdnd_waiting_finished && GetTickCount() - timeout < 200) {
|
||||
GuiSleep(0);
|
||||
ProcessEvents();
|
||||
}
|
||||
LLOG("Waiting finished " << GetTickCount() - timeout << "ms");
|
||||
if(Xdnd_waiting_status) {
|
||||
LLOG("XdndFinished timeout");
|
||||
Xdnd_status = DND_NONE;
|
||||
Xdnd_waiting_finished = false;
|
||||
}
|
||||
else
|
||||
LLOG("XdndFinished recieved");
|
||||
}
|
||||
EndLoop();
|
||||
UntrapX11Errors(tx);
|
||||
}
|
||||
|
||||
void DnDLoop::MouseMove(Point p, dword)
|
||||
{
|
||||
LLOG("DnDLoop::MouseMove");
|
||||
Sync();
|
||||
}
|
||||
|
||||
bool DnDLoop::Key(dword, int)
|
||||
{
|
||||
LLOG("DnDLoop::Key");
|
||||
Sync();
|
||||
return false;
|
||||
}
|
||||
|
||||
Image DnDLoop::CursorImage(Point, dword)
|
||||
{
|
||||
return Xdnd_status == DND_MOVE ? move : Xdnd_status == DND_COPY ? copy : reject;
|
||||
}
|
||||
|
||||
void DnDLoop::SetFmts(Window w, Atom property)
|
||||
{
|
||||
Buffer<Atom> x(fmt.GetCount());
|
||||
for(int i = 0; i < fmt.GetCount(); i++) {
|
||||
x[i] = fmt[i];
|
||||
LLOG('\t' << XAtomName(x[i]));
|
||||
}
|
||||
XChangeProperty(Xdisplay, w, property, XAtom("ATOM"),
|
||||
32, 0, (unsigned char*)~x,
|
||||
fmt.GetCount());
|
||||
}
|
||||
|
||||
String DnDLoop::GetData(const String& f)
|
||||
{
|
||||
int i = data->Find(f);
|
||||
String d;
|
||||
if(i >= 0)
|
||||
d = (*data)[i].Render();
|
||||
else
|
||||
if(source)
|
||||
d = source->GetDropData(f);
|
||||
return d;
|
||||
}
|
||||
|
||||
String DnDGetData(const String& f)
|
||||
{
|
||||
String d;
|
||||
if(dndloop)
|
||||
d = dndloop->GetData(f);
|
||||
return d;
|
||||
}
|
||||
|
||||
void DnDLoop::Request(XSelectionRequestEvent *se)
|
||||
{
|
||||
LLOG("DnDRequest " << XAtomName(se->target));
|
||||
XEvent e;
|
||||
e.xselection.type = SelectionNotify;
|
||||
e.xselection.display = Xdisplay;
|
||||
e.xselection.requestor = se->requestor;
|
||||
e.xselection.selection = XAtom("XdndSelection");
|
||||
e.xselection.target = se->target;
|
||||
e.xselection.time = se->time;
|
||||
e.xselection.property = se->property;
|
||||
if(se->target == XAtom("TARGETS")) {
|
||||
LLOG("DnDRequest targets:");
|
||||
SetFmts(se->requestor, se->property);
|
||||
}
|
||||
else {
|
||||
String d = GetData(XAtomName(se->target));
|
||||
if(d.GetCount())
|
||||
XChangeProperty(Xdisplay, se->requestor, se->property, se->target, 8, PropModeReplace,
|
||||
d, d.GetCount());
|
||||
else
|
||||
e.xselection.property = None;
|
||||
}
|
||||
XSendEvent(Xdisplay, se->requestor, XFalse, 0, &e);
|
||||
}
|
||||
|
||||
void DnDRequest(XSelectionRequestEvent *se)
|
||||
{
|
||||
if(dndloop) dndloop->Request(se);
|
||||
}
|
||||
|
||||
void DnDClear() {}
|
||||
|
||||
Image MakeDragImage(const Image& arrow, Image sample);
|
||||
|
||||
Ptr<Ctrl> sDnDSource;
|
||||
|
||||
int Ctrl::DoDragAndDrop(const char *fmts, const Image& sample, dword actions,
|
||||
const VectorMap<String, ClipData>& data)
|
||||
{
|
||||
InitDndAtoms();
|
||||
DnDLoop d;
|
||||
d.reject = MakeDragImage(CtrlCoreImg::DndNone(), sample);
|
||||
if(actions & DND_COPY) d.copy = MakeDragImage(CtrlCoreImg::DndCopy(), sample);
|
||||
if(actions & DND_MOVE) d.move = MakeDragImage(CtrlCoreImg::DndMove(), sample);
|
||||
d.SetMaster(*this);
|
||||
d.data = &data;
|
||||
d.source = this;
|
||||
dndloop = &d;
|
||||
Vector<String> f = Split(fmts, ';');
|
||||
for(int i = 0; i < f.GetCount(); i++)
|
||||
d.fmt.Add(XAtom(f[i]));
|
||||
for(int i = 0; i < data.GetCount(); i++)
|
||||
d.fmt.Add(XAtom(data.GetKey(i)));
|
||||
d.SetFmts(xclipboard().win, XAtom("XdndTypeList"));
|
||||
XSetSelectionOwner(Xdisplay, XAtom("XdndSelection"), xclipboard().win, CurrentTime);
|
||||
d.src = xclipboard().win;
|
||||
d.target = None;
|
||||
sDnDSource = this;
|
||||
d.Run();
|
||||
sDnDSource = NULL;
|
||||
SyncCaret();
|
||||
LLOG("DoDragAndDrop finished");
|
||||
return Xdnd_status;
|
||||
}
|
||||
|
||||
Ctrl *Ctrl::GetDragAndDropSource()
|
||||
{
|
||||
return sDnDSource;
|
||||
}
|
||||
|
||||
Index<String> Ctrl::drop_formats;
|
||||
|
||||
int XdndAction;
|
||||
Point XdndPos;
|
||||
|
||||
PasteClip sMakeDropClip(bool paste)
|
||||
{
|
||||
PasteClip d;
|
||||
d.type = 1;
|
||||
d.paste = paste;
|
||||
d.accepted = false;
|
||||
d.allowed = DND_MOVE|DND_COPY;
|
||||
d.action = XdndAction;
|
||||
return d;
|
||||
}
|
||||
|
||||
void Ctrl::DnD(Window src, bool paste)
|
||||
{
|
||||
PasteClip d = sMakeDropClip(paste);
|
||||
LLOG("Source action " << XdndAction);
|
||||
DnD(XdndPos, d);
|
||||
XdndAction = d.GetAction();
|
||||
LLOG("Target action " << XdndAction);
|
||||
XEvent e = ClientMsg(src, paste ? XdndFinished : XdndStatus);
|
||||
e.xclient.data.l[0] = GetWindow();
|
||||
(paste ? e.xclient.data.l[2] : e.xclient.data.l[4])
|
||||
= XdndAction == DND_MOVE ? XdndActionMove : XdndActionCopy;
|
||||
if(d.IsAccepted())
|
||||
e.xclient.data.l[1] = 1;
|
||||
LLOG("Sending status/finished to " << src << " accepted: " << d.IsAccepted());
|
||||
XSendEvent(Xdisplay, src, XFalse, 0, &e);
|
||||
}
|
||||
|
||||
void Ctrl::DropEvent(XWindow& w, XEvent *event)
|
||||
{
|
||||
InitDndAtoms();
|
||||
if(event->type != ClientMessage)
|
||||
return;
|
||||
Window src = event->xclient.data.l[0];
|
||||
LLOG("Client Message " << GetWindow() << " " << XAtomName(event->xclient.message_type)
|
||||
<< ", src: " << src);
|
||||
if(event->xclient.message_type == XdndEnter) {
|
||||
LLOG("DnDEnter");
|
||||
drop_formats.Clear();
|
||||
if(event->xclient.data.l[1] & 1) {
|
||||
Vector<int> v = GetPropertyInts(src, XAtom("XdndTypeList"), XA_ATOM);
|
||||
for(int i = 0; i < v.GetCount(); i++)
|
||||
drop_formats.Add(XAtomName(v[i]));
|
||||
}
|
||||
else
|
||||
for(int i = 2; i <= 4; i++)
|
||||
drop_formats.Add(XAtomName(event->xclient.data.l[i]));
|
||||
}
|
||||
static Point xdndpos;
|
||||
if(event->xclient.message_type == XdndPosition) {
|
||||
dword x = event->xclient.data.l[2];
|
||||
XdndPos = Point(HIWORD(x), LOWORD(x));
|
||||
LLOG("XdndPosition " << XdndPos << ", action " << XAtomName(event->xclient.data.l[4]));
|
||||
XdndAction = event->xclient.data.l[4] == (int)XdndActionMove ? DND_MOVE : DND_COPY;
|
||||
DnD(src, false);
|
||||
}
|
||||
if(event->xclient.message_type == XdndLeave)
|
||||
DnDLeave();
|
||||
if(event->xclient.message_type == XdndDrop && dndctrl) {
|
||||
LLOG("XdndDrop to " << UPP::Name(dndctrl));
|
||||
DnD(src, true);
|
||||
DnDLeave();
|
||||
}
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
#include "CtrlCore.h"
|
||||
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
#ifdef PLATFORM_X11
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
bool Xdnd_waiting_status;
|
||||
bool Xdnd_waiting_finished;
|
||||
int Xdnd_status;
|
||||
int Xdnd_version;
|
||||
|
||||
static Atom XdndEnter;
|
||||
static Atom XdndPosition;
|
||||
static Atom XdndLeave;
|
||||
static Atom XdndDrop;
|
||||
static Atom XdndStatus;
|
||||
static Atom XdndFinished;
|
||||
static Atom XdndActionCopy;
|
||||
static Atom XdndActionMove;
|
||||
|
||||
void InitDndAtoms()
|
||||
{
|
||||
if(XdndEnter) return;
|
||||
XdndEnter = XAtom("XdndEnter");
|
||||
XdndPosition = XAtom("XdndPosition");
|
||||
XdndLeave = XAtom("XdndLeave");
|
||||
XdndDrop = XAtom("XdndDrop");
|
||||
XdndStatus = XAtom("XdndStatus");
|
||||
XdndFinished = XAtom("XdndFinished");
|
||||
XdndActionCopy = XAtom("XdndActionCopy");
|
||||
XdndActionMove = XAtom("XdndActionMove");
|
||||
}
|
||||
|
||||
XEvent ClientMsg(Window src, Atom type, int format = 32)
|
||||
{
|
||||
XEvent e;
|
||||
Zero(e);
|
||||
e.xclient.type = ClientMessage;
|
||||
e.xclient.display = Xdisplay;
|
||||
e.xclient.window = src;
|
||||
e.xclient.message_type = type;
|
||||
e.xclient.format = format;
|
||||
return e;
|
||||
}
|
||||
|
||||
struct DnDLoop : LocalLoop {
|
||||
Image move, copy, reject;
|
||||
Vector<Atom> fmt;
|
||||
const VectorMap<String, ClipData> *data;
|
||||
Ptr<Ctrl> source;
|
||||
void SetFmts(Window w, Atom property);
|
||||
Window src, target;
|
||||
int action;
|
||||
|
||||
void Request(XSelectionRequestEvent *se);
|
||||
void Sync();
|
||||
String GetData(const String& f);
|
||||
void Leave();
|
||||
virtual void LeftUp(Point, dword);
|
||||
virtual bool Key(dword, int);
|
||||
virtual void MouseMove(Point p, dword);
|
||||
virtual Image CursorImage(Point, dword);
|
||||
};
|
||||
|
||||
Ptr<DnDLoop> dndloop;
|
||||
|
||||
void DnDLoop::Leave()
|
||||
{
|
||||
if(target) {
|
||||
LLOG("Sending XdndLeave to " << target);
|
||||
XEvent e = ClientMsg(target, XdndLeave);
|
||||
e.xclient.data.l[0] = src;
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
}
|
||||
}
|
||||
|
||||
void DnDLoop::Sync()
|
||||
{
|
||||
if(Xdnd_waiting_status)
|
||||
return;
|
||||
bool tx = Ctrl::TrapX11Errors();
|
||||
Window root;
|
||||
unsigned int d1;
|
||||
int x, y, d2;
|
||||
Window tgt = Xroot;
|
||||
int version;
|
||||
for(;;) {
|
||||
if(XQueryPointer(Xdisplay, tgt, &root, &tgt, &x, &y, &d2, &d2, &d1)) {
|
||||
if(!tgt)
|
||||
break;
|
||||
Vector<int> x = GetPropertyInts(tgt, XAtom("XdndAware"));
|
||||
LLOG("XdndAware " << tgt << ": " << x.GetCount());
|
||||
if(x.GetCount()) {
|
||||
Xdnd_version = x[0];
|
||||
break;
|
||||
}
|
||||
}
|
||||
else {
|
||||
tgt = None;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if(Xdnd_version < 3)
|
||||
tgt = None;
|
||||
if(tgt != target) {
|
||||
Leave();
|
||||
target = tgt;
|
||||
if(target) {
|
||||
LLOG("Sending XdndEnter to " << target << ", src = " << src);
|
||||
XEvent e = ClientMsg(target, XdndEnter);
|
||||
e.xclient.data.l[0] = src;
|
||||
e.xclient.data.l[1] = (fmt.GetCount() > 3) | (version << 24);
|
||||
for(int i = 0; i < min(3, fmt.GetCount()); i++)
|
||||
e.xclient.data.l[i + 2] = fmt[i];
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
}
|
||||
}
|
||||
|
||||
if(target) {
|
||||
LLOG("Sending XdndPosition to " << target << " " << x << ", " << y);
|
||||
XEvent e = ClientMsg(target, XdndPosition);
|
||||
e.xclient.data.l[0] = src;
|
||||
e.xclient.data.l[1] = 0;
|
||||
e.xclient.data.l[2] = MAKELONG(y, x);
|
||||
e.xclient.data.l[3] = Xeventtime;
|
||||
int action = XdndActionCopy;
|
||||
if(source && source->GetTopCtrl()->GetWindow() == target)
|
||||
action = XdndActionMove;
|
||||
if(GetShift())
|
||||
action = XdndActionMove;
|
||||
if(GetCtrl())
|
||||
action = XdndActionCopy;
|
||||
e.xclient.data.l[4] = action;
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
XFlush(Xdisplay);
|
||||
Xdnd_waiting_status = true;
|
||||
dword timeout = GetTickCount();
|
||||
LLOG("Waiting for XdndStatus");
|
||||
while(Xdnd_waiting_status && GetTickCount() - timeout < 200) {
|
||||
GuiSleep(0);
|
||||
ProcessEvents();
|
||||
}
|
||||
LLOG("Waiting status " << GetTickCount() - timeout << "ms");
|
||||
if(Xdnd_waiting_status) {
|
||||
LLOG("XdndStatus timeout");
|
||||
Xdnd_status = DND_NONE;
|
||||
Xdnd_waiting_status = false;
|
||||
}
|
||||
else
|
||||
LLOG("XdndStatus recieved " << Xdnd_status);
|
||||
}
|
||||
Ctrl::UntrapX11Errors(tx);
|
||||
}
|
||||
|
||||
void Ctrl::DropStatusEvent(XEvent *event)
|
||||
{
|
||||
InitDndAtoms();
|
||||
if(event->type != ClientMessage)
|
||||
return;
|
||||
LLOG("DropStatus Client Message " << XAtomName(event->xclient.message_type));
|
||||
if(event->type == ClientMessage && dndloop && event->xclient.data.l[0] == (int)dndloop->target) {
|
||||
if(event->xclient.message_type == XdndStatus && Xdnd_waiting_status) {
|
||||
LLOG("XdndStatus, xdnd action: " << XAtomName(event->xclient.data.l[4]));
|
||||
Xdnd_status = (event->xclient.data.l[1] & 1) ?
|
||||
event->xclient.data.l[4] == (int)XdndActionMove ? DND_MOVE : DND_COPY
|
||||
: DND_NONE;
|
||||
Xdnd_waiting_status = false;
|
||||
}
|
||||
if(event->xclient.message_type == XdndFinished && Xdnd_waiting_finished) {
|
||||
LLOG("XdndFinished, xdnd action: " << XAtomName(event->xclient.data.l[2]));
|
||||
if(Xdnd_version == 5)
|
||||
Xdnd_status = (event->xclient.data.l[1] & 1) ?
|
||||
event->xclient.data.l[2] == (int)XdndActionMove ? DND_MOVE : DND_COPY
|
||||
: DND_NONE;
|
||||
Xdnd_waiting_finished = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void DnDLoop::LeftUp(Point, dword)
|
||||
{
|
||||
LLOG("DnDLoop::LeftUp");
|
||||
bool tx = TrapX11Errors();
|
||||
if(target) {
|
||||
LLOG("Sending XdndDrop to " << target);
|
||||
XEvent e = ClientMsg(target, XdndDrop);
|
||||
e.xclient.data.l[0] = src;
|
||||
e.xclient.data.l[1] = 0;
|
||||
e.xclient.data.l[2] = Xeventtime;
|
||||
XSendEvent(Xdisplay, target, XFalse, 0, &e);
|
||||
XFlush(Xdisplay);
|
||||
Xdnd_waiting_finished = true;
|
||||
int timeout = GetTickCount();
|
||||
LLOG("Waiting for XdndFinished");
|
||||
while(Xdnd_waiting_finished && GetTickCount() - timeout < 200) {
|
||||
GuiSleep(0);
|
||||
ProcessEvents();
|
||||
}
|
||||
LLOG("Waiting finished " << GetTickCount() - timeout << "ms");
|
||||
if(Xdnd_waiting_status) {
|
||||
LLOG("XdndFinished timeout");
|
||||
Xdnd_status = DND_NONE;
|
||||
Xdnd_waiting_finished = false;
|
||||
}
|
||||
else
|
||||
LLOG("XdndFinished recieved");
|
||||
}
|
||||
EndLoop();
|
||||
UntrapX11Errors(tx);
|
||||
}
|
||||
|
||||
void DnDLoop::MouseMove(Point p, dword)
|
||||
{
|
||||
LLOG("DnDLoop::MouseMove");
|
||||
Sync();
|
||||
}
|
||||
|
||||
bool DnDLoop::Key(dword, int)
|
||||
{
|
||||
LLOG("DnDLoop::Key");
|
||||
Sync();
|
||||
return false;
|
||||
}
|
||||
|
||||
Image DnDLoop::CursorImage(Point, dword)
|
||||
{
|
||||
return Xdnd_status == DND_MOVE ? move : Xdnd_status == DND_COPY ? copy : reject;
|
||||
}
|
||||
|
||||
void DnDLoop::SetFmts(Window w, Atom property)
|
||||
{
|
||||
Buffer<Atom> x(fmt.GetCount());
|
||||
for(int i = 0; i < fmt.GetCount(); i++) {
|
||||
x[i] = fmt[i];
|
||||
LLOG('\t' << XAtomName(x[i]));
|
||||
}
|
||||
XChangeProperty(Xdisplay, w, property, XAtom("ATOM"),
|
||||
32, 0, (unsigned char*)~x,
|
||||
fmt.GetCount());
|
||||
}
|
||||
|
||||
String DnDLoop::GetData(const String& f)
|
||||
{
|
||||
int i = data->Find(f);
|
||||
String d;
|
||||
if(i >= 0)
|
||||
d = (*data)[i].Render();
|
||||
else
|
||||
if(source)
|
||||
d = source->GetDropData(f);
|
||||
return d;
|
||||
}
|
||||
|
||||
String DnDGetData(const String& f)
|
||||
{
|
||||
String d;
|
||||
if(dndloop)
|
||||
d = dndloop->GetData(f);
|
||||
return d;
|
||||
}
|
||||
|
||||
void DnDLoop::Request(XSelectionRequestEvent *se)
|
||||
{
|
||||
LLOG("DnDRequest " << XAtomName(se->target));
|
||||
XEvent e;
|
||||
e.xselection.type = SelectionNotify;
|
||||
e.xselection.display = Xdisplay;
|
||||
e.xselection.requestor = se->requestor;
|
||||
e.xselection.selection = XAtom("XdndSelection");
|
||||
e.xselection.target = se->target;
|
||||
e.xselection.time = se->time;
|
||||
e.xselection.property = se->property;
|
||||
if(se->target == XAtom("TARGETS")) {
|
||||
LLOG("DnDRequest targets:");
|
||||
SetFmts(se->requestor, se->property);
|
||||
}
|
||||
else {
|
||||
String d = GetData(XAtomName(se->target));
|
||||
if(d.GetCount())
|
||||
XChangeProperty(Xdisplay, se->requestor, se->property, se->target, 8, PropModeReplace,
|
||||
d, d.GetCount());
|
||||
else
|
||||
e.xselection.property = None;
|
||||
}
|
||||
XSendEvent(Xdisplay, se->requestor, XFalse, 0, &e);
|
||||
}
|
||||
|
||||
void DnDRequest(XSelectionRequestEvent *se)
|
||||
{
|
||||
if(dndloop) dndloop->Request(se);
|
||||
}
|
||||
|
||||
void DnDClear() {}
|
||||
|
||||
Image MakeDragImage(const Image& arrow, Image sample);
|
||||
|
||||
Ptr<Ctrl> sDnDSource;
|
||||
|
||||
int Ctrl::DoDragAndDrop(const char *fmts, const Image& sample, dword actions,
|
||||
const VectorMap<String, ClipData>& data)
|
||||
{
|
||||
InitDndAtoms();
|
||||
DnDLoop d;
|
||||
d.reject = actions & DND_EXACTIMAGE ? CtrlCoreImg::DndNone() : MakeDragImage(CtrlCoreImg::DndNone(), sample);
|
||||
if(actions & DND_COPY)
|
||||
d.copy = actions & DND_EXACTIMAGE ? sample : MakeDragImage(CtrlCoreImg::DndCopy(), sample);
|
||||
if(actions & DND_MOVE)
|
||||
d.move = actions & DND_EXACTIMAGE ? sample : MakeDragImage(CtrlCoreImg::DndMove(), sample);
|
||||
d.SetMaster(*this);
|
||||
d.data = &data;
|
||||
d.source = this;
|
||||
dndloop = &d;
|
||||
Vector<String> f = Split(fmts, ';');
|
||||
for(int i = 0; i < f.GetCount(); i++)
|
||||
d.fmt.Add(XAtom(f[i]));
|
||||
for(int i = 0; i < data.GetCount(); i++)
|
||||
d.fmt.Add(XAtom(data.GetKey(i)));
|
||||
d.SetFmts(xclipboard().win, XAtom("XdndTypeList"));
|
||||
XSetSelectionOwner(Xdisplay, XAtom("XdndSelection"), xclipboard().win, CurrentTime);
|
||||
d.src = xclipboard().win;
|
||||
d.target = None;
|
||||
sDnDSource = this;
|
||||
d.Run();
|
||||
sDnDSource = NULL;
|
||||
SyncCaret();
|
||||
LLOG("DoDragAndDrop finished");
|
||||
return Xdnd_status;
|
||||
}
|
||||
|
||||
Ctrl *Ctrl::GetDragAndDropSource()
|
||||
{
|
||||
return sDnDSource;
|
||||
}
|
||||
|
||||
Index<String> Ctrl::drop_formats;
|
||||
|
||||
int XdndAction;
|
||||
Point XdndPos;
|
||||
|
||||
PasteClip sMakeDropClip(bool paste)
|
||||
{
|
||||
PasteClip d;
|
||||
d.type = 1;
|
||||
d.paste = paste;
|
||||
d.accepted = false;
|
||||
d.allowed = DND_MOVE|DND_COPY;
|
||||
d.action = XdndAction;
|
||||
return d;
|
||||
}
|
||||
|
||||
void Ctrl::DnD(Window src, bool paste)
|
||||
{
|
||||
PasteClip d = sMakeDropClip(paste);
|
||||
LLOG("Source action " << XdndAction);
|
||||
DnD(XdndPos, d);
|
||||
XdndAction = d.GetAction();
|
||||
LLOG("Target action " << XdndAction);
|
||||
XEvent e = ClientMsg(src, paste ? XdndFinished : XdndStatus);
|
||||
e.xclient.data.l[0] = GetWindow();
|
||||
(paste ? e.xclient.data.l[2] : e.xclient.data.l[4])
|
||||
= XdndAction == DND_MOVE ? XdndActionMove : XdndActionCopy;
|
||||
if(d.IsAccepted())
|
||||
e.xclient.data.l[1] = 1;
|
||||
LLOG("Sending status/finished to " << src << " accepted: " << d.IsAccepted());
|
||||
XSendEvent(Xdisplay, src, XFalse, 0, &e);
|
||||
}
|
||||
|
||||
void Ctrl::DropEvent(XWindow& w, XEvent *event)
|
||||
{
|
||||
InitDndAtoms();
|
||||
if(event->type != ClientMessage)
|
||||
return;
|
||||
Window src = event->xclient.data.l[0];
|
||||
LLOG("Client Message " << GetWindow() << " " << XAtomName(event->xclient.message_type)
|
||||
<< ", src: " << src);
|
||||
if(event->xclient.message_type == XdndEnter) {
|
||||
LLOG("DnDEnter");
|
||||
drop_formats.Clear();
|
||||
if(event->xclient.data.l[1] & 1) {
|
||||
Vector<int> v = GetPropertyInts(src, XAtom("XdndTypeList"), XA_ATOM);
|
||||
for(int i = 0; i < v.GetCount(); i++)
|
||||
drop_formats.Add(XAtomName(v[i]));
|
||||
}
|
||||
else
|
||||
for(int i = 2; i <= 4; i++)
|
||||
drop_formats.Add(XAtomName(event->xclient.data.l[i]));
|
||||
}
|
||||
static Point xdndpos;
|
||||
if(event->xclient.message_type == XdndPosition) {
|
||||
dword x = event->xclient.data.l[2];
|
||||
XdndPos = Point(HIWORD(x), LOWORD(x));
|
||||
LLOG("XdndPosition " << XdndPos << ", action " << XAtomName(event->xclient.data.l[4]));
|
||||
XdndAction = event->xclient.data.l[4] == (int)XdndActionMove ? DND_MOVE : DND_COPY;
|
||||
DnD(src, false);
|
||||
}
|
||||
if(event->xclient.message_type == XdndLeave)
|
||||
DnDLeave();
|
||||
if(event->xclient.message_type == XdndDrop && dndctrl) {
|
||||
LLOG("XdndDrop to " << UPP::Name(dndctrl));
|
||||
DnD(src, true);
|
||||
DnDLeave();
|
||||
}
|
||||
}
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -11,7 +11,7 @@ const char *ClipFmtsImage()
|
|||
{
|
||||
static const char *q;
|
||||
ONCELOCK {
|
||||
static String s(ClipFmt<Image>() + ";image/bmp;image/png");
|
||||
static String s(ClipFmt<Image>() + ";image/png");
|
||||
q = s;
|
||||
}
|
||||
return q;
|
||||
|
|
@ -19,7 +19,7 @@ const char *ClipFmtsImage()
|
|||
|
||||
bool AcceptImage(PasteClip& clip)
|
||||
{
|
||||
return clip.Accept(ClipFmt<Image>()) || clip.Accept("image/bmp") || clip.Accept("image/png");
|
||||
return clip.Accept(ClipFmt<Image>()) || clip.Accept("image/png");
|
||||
}
|
||||
|
||||
Image GetImage(PasteClip& clip)
|
||||
|
|
@ -30,7 +30,7 @@ Image GetImage(PasteClip& clip)
|
|||
if(!m.IsEmpty())
|
||||
return m;
|
||||
}
|
||||
if(clip.Accept("image/bmp;image/png"))
|
||||
if(clip.Accept("image/png"))
|
||||
return StreamRaster::LoadStringAny(~clip);
|
||||
return Null;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,111 +1,111 @@
|
|||
K_BACK = 8,
|
||||
K_BACKSPACE = 8,
|
||||
|
||||
K_TAB = 9,
|
||||
|
||||
K_RETURN = 13,
|
||||
K_ENTER = 13,
|
||||
K_ESCAPE = 27,
|
||||
|
||||
K_SPACE = 32,
|
||||
|
||||
K_DELETE = XK_Delete + K_DELTA,
|
||||
|
||||
K_SHIFT_KEY = XK_Shift_L + K_DELTA,
|
||||
K_CTRL_KEY = XK_Control_L + K_DELTA,
|
||||
K_ALT_KEY = XK_Meta_L + K_DELTA,
|
||||
K_CAPSLOCK = XK_Caps_Lock + K_DELTA,
|
||||
K_PRIOR = XK_Page_Up + K_DELTA,
|
||||
K_PAGEUP = XK_Page_Up + K_DELTA,
|
||||
K_NEXT = XK_Page_Down + K_DELTA,
|
||||
K_PAGEDOWN = XK_Page_Down + K_DELTA,
|
||||
K_END = XK_End + K_DELTA,
|
||||
K_HOME = XK_Home + K_DELTA,
|
||||
K_LEFT = XK_Left + K_DELTA,
|
||||
K_UP = XK_Up + K_DELTA,
|
||||
K_RIGHT = XK_Right + K_DELTA,
|
||||
K_DOWN = XK_Down + K_DELTA,
|
||||
K_INSERT = XK_Insert + K_DELTA,
|
||||
|
||||
K_NUMPAD0 = XK_KP_0 + K_DELTA,
|
||||
K_NUMPAD1 = XK_KP_1 + K_DELTA,
|
||||
K_NUMPAD2 = XK_KP_2 + K_DELTA,
|
||||
K_NUMPAD3 = XK_KP_3 + K_DELTA,
|
||||
K_NUMPAD4 = XK_KP_4 + K_DELTA,
|
||||
K_NUMPAD5 = XK_KP_5 + K_DELTA,
|
||||
K_NUMPAD6 = XK_KP_6 + K_DELTA,
|
||||
K_NUMPAD7 = XK_KP_7 + K_DELTA,
|
||||
K_NUMPAD8 = XK_KP_8 + K_DELTA,
|
||||
K_NUMPAD9 = XK_KP_9 + K_DELTA,
|
||||
K_MULTIPLY = XK_KP_Multiply + K_DELTA,
|
||||
K_ADD = XK_KP_Add + K_DELTA,
|
||||
K_SEPARATOR = XK_KP_Separator + K_DELTA,
|
||||
K_SUBTRACT = XK_KP_Subtract + K_DELTA,
|
||||
K_DECIMAL = XK_KP_Decimal + K_DELTA,
|
||||
K_DIVIDE = XK_KP_Divide + K_DELTA,
|
||||
|
||||
K_SCROLL = XK_Scroll_Lock + K_DELTA,
|
||||
|
||||
K_F1 = XK_F1 + K_DELTA,
|
||||
K_F2 = XK_F2 + K_DELTA,
|
||||
K_F3 = XK_F3 + K_DELTA,
|
||||
K_F4 = XK_F4 + K_DELTA,
|
||||
K_F5 = XK_F5 + K_DELTA,
|
||||
K_F6 = XK_F6 + K_DELTA,
|
||||
K_F7 = XK_F7 + K_DELTA,
|
||||
K_F8 = XK_F8 + K_DELTA,
|
||||
K_F9 = XK_F9 + K_DELTA,
|
||||
K_F10 = XK_F10 + K_DELTA,
|
||||
K_F11 = XK_F11 + K_DELTA,
|
||||
K_F12 = XK_F12 + K_DELTA,
|
||||
|
||||
K_A = 'A' + K_DELTA,
|
||||
K_B = 'B' + K_DELTA,
|
||||
K_C = 'C' + K_DELTA,
|
||||
K_D = 'D' + K_DELTA,
|
||||
K_E = 'E' + K_DELTA,
|
||||
K_F = 'F' + K_DELTA,
|
||||
K_G = 'G' + K_DELTA,
|
||||
K_H = 'H' + K_DELTA,
|
||||
K_I = 'I' + K_DELTA,
|
||||
K_J = 'J' + K_DELTA,
|
||||
K_K = 'K' + K_DELTA,
|
||||
K_L = 'L' + K_DELTA,
|
||||
K_M = 'M' + K_DELTA,
|
||||
K_N = 'N' + K_DELTA,
|
||||
K_O = 'O' + K_DELTA,
|
||||
K_P = 'P' + K_DELTA,
|
||||
K_Q = 'Q' + K_DELTA,
|
||||
K_R = 'R' + K_DELTA,
|
||||
K_S = 'S' + K_DELTA,
|
||||
K_T = 'T' + K_DELTA,
|
||||
K_U = 'U' + K_DELTA,
|
||||
K_V = 'V' + K_DELTA,
|
||||
K_W = 'W' + K_DELTA,
|
||||
K_X = 'X' + K_DELTA,
|
||||
K_Y = 'Y' + K_DELTA,
|
||||
K_Z = 'Z' + K_DELTA,
|
||||
K_0 = '0' + 128 + K_DELTA,
|
||||
K_1 = '1' + 128 + K_DELTA,
|
||||
K_2 = '2' + 128 + K_DELTA,
|
||||
K_3 = '3' + 128 + K_DELTA,
|
||||
K_4 = '4' + 128 + K_DELTA,
|
||||
K_5 = '5' + 128 + K_DELTA,
|
||||
K_6 = '6' + 128 + K_DELTA,
|
||||
K_7 = '7' + 128 + K_DELTA,
|
||||
K_8 = '8' + 128 + K_DELTA,
|
||||
K_9 = '9' + 128 + K_DELTA,
|
||||
|
||||
K_CTRL_LBRACKET = K_CTRL|XK_bracketleft|K_DELTA,
|
||||
K_CTRL_RBRACKET = K_CTRL|XK_bracketright|K_DELTA,
|
||||
K_CTRL_MINUS = K_CTRL|0x2d|K_DELTA,
|
||||
K_CTRL_GRAVE = K_CTRL|XK_grave|K_DELTA,
|
||||
K_CTRL_SLASH = K_CTRL|0x5f|K_DELTA,
|
||||
K_CTRL_BACKSLASH = K_CTRL|0x5c|K_DELTA,
|
||||
K_CTRL_COMMA = K_CTRL|0x2c|K_DELTA,
|
||||
K_CTRL_PERIOD = K_CTRL|XK_period|K_DELTA,
|
||||
K_CTRL_SEMICOLON = K_CTRL|XK_semicolon|K_DELTA,
|
||||
K_CTRL_EQUAL = K_CTRL|0x3d|K_DELTA,
|
||||
K_CTRL_APOSTROPHE= K_CTRL|0x27|K_DELTA,
|
||||
|
||||
K_BREAK = XK_Pause|K_DELTA,
|
||||
K_BACK = 8,
|
||||
K_BACKSPACE = 8,
|
||||
|
||||
K_TAB = 9,
|
||||
|
||||
K_RETURN = 13,
|
||||
K_ENTER = 13,
|
||||
K_ESCAPE = 27,
|
||||
|
||||
K_SPACE = 32,
|
||||
|
||||
K_DELETE = XK_Delete + K_DELTA,
|
||||
|
||||
K_SHIFT_KEY = XK_Shift_L + K_DELTA,
|
||||
K_CTRL_KEY = XK_Control_L + K_DELTA,
|
||||
K_ALT_KEY = XK_Meta_L + K_DELTA,
|
||||
K_CAPSLOCK = XK_Caps_Lock + K_DELTA,
|
||||
K_PRIOR = XK_Page_Up + K_DELTA,
|
||||
K_PAGEUP = XK_Page_Up + K_DELTA,
|
||||
K_NEXT = XK_Page_Down + K_DELTA,
|
||||
K_PAGEDOWN = XK_Page_Down + K_DELTA,
|
||||
K_END = XK_End + K_DELTA,
|
||||
K_HOME = XK_Home + K_DELTA,
|
||||
K_LEFT = XK_Left + K_DELTA,
|
||||
K_UP = XK_Up + K_DELTA,
|
||||
K_RIGHT = XK_Right + K_DELTA,
|
||||
K_DOWN = XK_Down + K_DELTA,
|
||||
K_INSERT = XK_Insert + K_DELTA,
|
||||
|
||||
K_NUMPAD0 = XK_KP_0 + K_DELTA,
|
||||
K_NUMPAD1 = XK_KP_1 + K_DELTA,
|
||||
K_NUMPAD2 = XK_KP_2 + K_DELTA,
|
||||
K_NUMPAD3 = XK_KP_3 + K_DELTA,
|
||||
K_NUMPAD4 = XK_KP_4 + K_DELTA,
|
||||
K_NUMPAD5 = XK_KP_5 + K_DELTA,
|
||||
K_NUMPAD6 = XK_KP_6 + K_DELTA,
|
||||
K_NUMPAD7 = XK_KP_7 + K_DELTA,
|
||||
K_NUMPAD8 = XK_KP_8 + K_DELTA,
|
||||
K_NUMPAD9 = XK_KP_9 + K_DELTA,
|
||||
K_MULTIPLY = XK_KP_Multiply + K_DELTA,
|
||||
K_ADD = XK_KP_Add + K_DELTA,
|
||||
K_SEPARATOR = XK_KP_Separator + K_DELTA,
|
||||
K_SUBTRACT = XK_KP_Subtract + K_DELTA,
|
||||
K_DECIMAL = XK_KP_Decimal + K_DELTA,
|
||||
K_DIVIDE = XK_KP_Divide + K_DELTA,
|
||||
|
||||
K_SCROLL = XK_Scroll_Lock + K_DELTA,
|
||||
|
||||
K_F1 = XK_F1 + K_DELTA,
|
||||
K_F2 = XK_F2 + K_DELTA,
|
||||
K_F3 = XK_F3 + K_DELTA,
|
||||
K_F4 = XK_F4 + K_DELTA,
|
||||
K_F5 = XK_F5 + K_DELTA,
|
||||
K_F6 = XK_F6 + K_DELTA,
|
||||
K_F7 = XK_F7 + K_DELTA,
|
||||
K_F8 = XK_F8 + K_DELTA,
|
||||
K_F9 = XK_F9 + K_DELTA,
|
||||
K_F10 = XK_F10 + K_DELTA,
|
||||
K_F11 = XK_F11 + K_DELTA,
|
||||
K_F12 = XK_F12 + K_DELTA,
|
||||
|
||||
K_A = 'A' + K_DELTA,
|
||||
K_B = 'B' + K_DELTA,
|
||||
K_C = 'C' + K_DELTA,
|
||||
K_D = 'D' + K_DELTA,
|
||||
K_E = 'E' + K_DELTA,
|
||||
K_F = 'F' + K_DELTA,
|
||||
K_G = 'G' + K_DELTA,
|
||||
K_H = 'H' + K_DELTA,
|
||||
K_I = 'I' + K_DELTA,
|
||||
K_J = 'J' + K_DELTA,
|
||||
K_K = 'K' + K_DELTA,
|
||||
K_L = 'L' + K_DELTA,
|
||||
K_M = 'M' + K_DELTA,
|
||||
K_N = 'N' + K_DELTA,
|
||||
K_O = 'O' + K_DELTA,
|
||||
K_P = 'P' + K_DELTA,
|
||||
K_Q = 'Q' + K_DELTA,
|
||||
K_R = 'R' + K_DELTA,
|
||||
K_S = 'S' + K_DELTA,
|
||||
K_T = 'T' + K_DELTA,
|
||||
K_U = 'U' + K_DELTA,
|
||||
K_V = 'V' + K_DELTA,
|
||||
K_W = 'W' + K_DELTA,
|
||||
K_X = 'X' + K_DELTA,
|
||||
K_Y = 'Y' + K_DELTA,
|
||||
K_Z = 'Z' + K_DELTA,
|
||||
K_0 = '0' + 128 + K_DELTA,
|
||||
K_1 = '1' + 128 + K_DELTA,
|
||||
K_2 = '2' + 128 + K_DELTA,
|
||||
K_3 = '3' + 128 + K_DELTA,
|
||||
K_4 = '4' + 128 + K_DELTA,
|
||||
K_5 = '5' + 128 + K_DELTA,
|
||||
K_6 = '6' + 128 + K_DELTA,
|
||||
K_7 = '7' + 128 + K_DELTA,
|
||||
K_8 = '8' + 128 + K_DELTA,
|
||||
K_9 = '9' + 128 + K_DELTA,
|
||||
|
||||
K_CTRL_LBRACKET = K_CTRL|XK_bracketleft|K_DELTA,
|
||||
K_CTRL_RBRACKET = K_CTRL|XK_bracketright|K_DELTA,
|
||||
K_CTRL_MINUS = K_CTRL|0x2d|K_DELTA,
|
||||
K_CTRL_GRAVE = K_CTRL|XK_grave|K_DELTA,
|
||||
K_CTRL_SLASH = K_CTRL|0x5f|K_DELTA,
|
||||
K_CTRL_BACKSLASH = K_CTRL|0x5c|K_DELTA,
|
||||
K_CTRL_COMMA = K_CTRL|0x2c|K_DELTA,
|
||||
K_CTRL_PERIOD = K_CTRL|XK_period|K_DELTA,
|
||||
K_CTRL_SEMICOLON = K_CTRL|XK_semicolon|K_DELTA,
|
||||
K_CTRL_EQUAL = K_CTRL|0x3d|K_DELTA,
|
||||
K_CTRL_APOSTROPHE= K_CTRL|0x27|K_DELTA,
|
||||
|
||||
K_BREAK = XK_Pause|K_DELTA,
|
||||
|
|
|
|||
|
|
@ -43,24 +43,24 @@ LAYOUT(FileSelectorLayout, 516, 400)
|
|||
ITEM(Button, cancel, SetLabel(t_("Cancel")).RightPosZ(8, 68).BottomPosZ(8, 24))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(PaletteLayout, 212, 332)
|
||||
LAYOUT(PaletteLayout, 216, 332)
|
||||
ITEM(TabCtrl, palette_tab, HSizePosZ(4, 4).VSizePosZ(4, 82))
|
||||
ITEM(Label, dv___1, SetLabel(t_("Color:")).LeftPosZ(4, 36).BottomPosZ(52, 24))
|
||||
ITEM(DataPusher, color, HSizePosZ(68, 32).BottomPosZ(54, 22))
|
||||
ITEM(Button, set_transparent, RightPosZ(4, 18).BottomPosZ(56, 18))
|
||||
UNTYPED(fetch_color, RightPosZ(4, 18).BottomPosZ(30, 18))
|
||||
ITEM(Label, dv___5, SetLabel(t_("R:")).LeftPosZ(4, 12).BottomPosZ(29, 19))
|
||||
ITEM(EditIntSpin, r, LeftPosZ(16, 40).BottomPosZ(29, 19))
|
||||
ITEM(Label, dv___7, SetLabel(t_("G:")).LeftPosZ(68, 12).BottomPosZ(29, 19))
|
||||
ITEM(EditIntSpin, g, LeftPosZ(80, 40).BottomPosZ(29, 19))
|
||||
ITEM(Label, dv___9, SetLabel(t_("B:")).LeftPosZ(130, 12).BottomPosZ(29, 19))
|
||||
ITEM(EditIntSpin, b, LeftPosZ(142, 40).BottomPosZ(29, 19))
|
||||
ITEM(EditIntSpin, r, LeftPosZ(16, 44).BottomPosZ(29, 19))
|
||||
ITEM(Label, dv___7, SetLabel(t_("G:")).LeftPosZ(72, 12).BottomPosZ(29, 19))
|
||||
ITEM(EditIntSpin, g, LeftPosZ(84, 44).BottomPosZ(29, 19))
|
||||
ITEM(Label, dv___9, SetLabel(t_("B:")).LeftPosZ(136, 12).BottomPosZ(29, 19))
|
||||
ITEM(EditIntSpin, b, LeftPosZ(150, 42).BottomPosZ(29, 19))
|
||||
ITEM(Label, dv___11, SetLabel(t_("H:")).LeftPosZ(4, 12).BottomPosZ(5, 19))
|
||||
ITEM(EditIntSpin, h, LeftPosZ(16, 40).BottomPosZ(5, 19))
|
||||
ITEM(Label, dv___13, SetLabel(t_("S:")).LeftPosZ(68, 12).BottomPosZ(5, 19))
|
||||
ITEM(EditIntSpin, s, LeftPosZ(80, 40).BottomPosZ(5, 19))
|
||||
ITEM(Label, dv___15, SetLabel(t_("V:")).LeftPosZ(130, 12).BottomPosZ(5, 19))
|
||||
ITEM(EditIntSpin, v, LeftPosZ(142, 40).BottomPosZ(5, 19))
|
||||
ITEM(EditIntSpin, h, LeftPosZ(16, 44).BottomPosZ(5, 19))
|
||||
ITEM(Label, dv___13, SetLabel(t_("S:")).LeftPosZ(72, 12).BottomPosZ(5, 19))
|
||||
ITEM(EditIntSpin, s, LeftPosZ(84, 44).BottomPosZ(5, 19))
|
||||
ITEM(Label, dv___15, SetLabel(t_("V:")).LeftPosZ(136, 12).BottomPosZ(5, 19))
|
||||
ITEM(EditIntSpin, v, LeftPosZ(148, 44).BottomPosZ(5, 19))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(PaletteSelectorLayout, 248, 320)
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#define LLOG(x) LOG(x)
|
||||
#define LLOG(x) // LOG(x)
|
||||
#define LTIMING(x) // RTIMING(x)
|
||||
|
||||
static ColorF xpmenuborder[] = {
|
||||
|
|
|
|||
|
|
@ -1,183 +1,183 @@
|
|||
#include "CtrlLib.h"
|
||||
|
||||
#ifndef CtrlCore_MenuImp_h
|
||||
#define CtrlCore_MenuImp_h
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
class MenuItemBase : public Ctrl, public Bar::Item
|
||||
{
|
||||
public:
|
||||
virtual Bar::Item& Text(const char *text);
|
||||
virtual Bar::Item& Key(dword key);
|
||||
virtual Bar::Item& Image(const UPP::Image& img);
|
||||
virtual Bar::Item& Enable(bool _enable);
|
||||
virtual Bar::Item& Tip(const char *tip);
|
||||
virtual Bar::Item& Help(const char *help);
|
||||
virtual Bar::Item& Topic(const char *help);
|
||||
virtual Bar::Item& Description(const char *desc);
|
||||
virtual Bar::Item& Check(bool check);
|
||||
virtual Bar::Item& Radio(bool check);
|
||||
|
||||
virtual String GetDesc() const;
|
||||
virtual dword GetAccessKeys() const;
|
||||
virtual void AssignAccessKeys(dword used);
|
||||
|
||||
protected:
|
||||
enum {
|
||||
NOTHING, CHECK0, CHECK1, RADIO0, RADIO1
|
||||
};
|
||||
|
||||
enum {
|
||||
NORMAL, HIGHLIGHT, PUSH
|
||||
};
|
||||
|
||||
String text;
|
||||
dword accel;
|
||||
int state;
|
||||
int leftgap, textgap;
|
||||
Font font;
|
||||
bool isenabled;
|
||||
byte type;
|
||||
byte accesskey;
|
||||
Size maxiconsize;
|
||||
const MenuBar::Style *style;
|
||||
|
||||
public:
|
||||
virtual void SyncState() = 0;
|
||||
|
||||
void DrawMenuText(Draw& w, int x, int y, const String& s, Font f, bool enabled, bool hl,
|
||||
Color color, Color hlcolor);
|
||||
void PaintTopItem(Draw& w, int state);
|
||||
|
||||
bool IsItemEnabled() const { return isenabled; }
|
||||
String GetText() const { return text; }
|
||||
MenuItemBase& LeftGap(int cx) { leftgap = cx; return *this; }
|
||||
MenuItemBase& TextGap(int cx) { textgap = cx; return *this; }
|
||||
MenuItemBase& SetFont(Font f) { font = f; return *this; }
|
||||
MenuItemBase& Style(const MenuBar::Style *s) { style = s; return *this; }
|
||||
Font GetFont() const { return font; }
|
||||
MenuItemBase& MaxIconSize(Size sz) { maxiconsize = sz; return *this; }
|
||||
|
||||
MenuItemBase();
|
||||
};
|
||||
|
||||
void DrawMenuText(Draw& w, int x, int y, const String& s, Font f, bool enabled,
|
||||
bool highlight, int mn, Color color, Color hltext);
|
||||
|
||||
class MenuItem : public MenuItemBase {
|
||||
public:
|
||||
virtual void Paint(Draw& w);
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual Size GetMinSize() const;
|
||||
virtual void LeftUp(Point, dword);
|
||||
virtual void RightUp(Point, dword);
|
||||
virtual void GotFocus();
|
||||
virtual void LostFocus();
|
||||
virtual bool Key(dword key, int count);
|
||||
virtual bool HotKey(dword key);
|
||||
virtual void SyncState();
|
||||
|
||||
virtual Bar::Item& Image(const UPP::Image& img);
|
||||
|
||||
private:
|
||||
UPP::Image licon, ricon;
|
||||
|
||||
void SendHelpLine();
|
||||
void ClearHelpLine();
|
||||
|
||||
protected:
|
||||
virtual int GetVisualState();
|
||||
|
||||
public:
|
||||
MenuItem& RightImage(const UPP::Image& img);
|
||||
};
|
||||
|
||||
class SubMenuBase {
|
||||
protected:
|
||||
MenuBar menu;
|
||||
Callback1<Bar&> proc;
|
||||
MenuBar *parentmenu;
|
||||
|
||||
void Pull(Ctrl *item, Point p, Size sz);
|
||||
|
||||
public:
|
||||
virtual void Pull() = 0;
|
||||
|
||||
void SetParent(MenuBar *m) { parentmenu = m; menu.MaxIconSize(m->GetMaxIconSize()); }
|
||||
void Set(Callback1<Bar&> _submenu) { proc = _submenu; }
|
||||
Callback1<Bar&> Get() { return proc; }
|
||||
|
||||
SubMenuBase() { parentmenu = NULL; }
|
||||
virtual ~SubMenuBase() {}
|
||||
};
|
||||
|
||||
class SubMenuItem : public MenuItem, public SubMenuBase {
|
||||
public:
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual void GotFocus();
|
||||
virtual bool HotKey(dword key);
|
||||
virtual bool Key(dword key, int count);
|
||||
virtual int GetVisualState();
|
||||
virtual void Pull();
|
||||
|
||||
protected:
|
||||
enum {
|
||||
TIMEID_PULL = BarCtrl::TIMEID_COUNT,
|
||||
TIMEID_COUNT
|
||||
};
|
||||
|
||||
public:
|
||||
typedef SubMenuItem CLASSNAME;
|
||||
|
||||
SubMenuItem();
|
||||
};
|
||||
|
||||
class TopSubMenuItem : public MenuItemBase, public SubMenuBase {
|
||||
public:
|
||||
virtual void Paint(Draw& w);
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual void GotFocus();
|
||||
virtual void LostFocus();
|
||||
virtual void LeftDown(Point, dword);
|
||||
virtual void SyncState();
|
||||
virtual Size GetMinSize() const;
|
||||
virtual bool Key(dword key, int);
|
||||
virtual bool HotKey(dword key);
|
||||
virtual void Pull();
|
||||
|
||||
private:
|
||||
int GetState();
|
||||
|
||||
public:
|
||||
TopSubMenuItem() { NoInitFocus(); }
|
||||
};
|
||||
|
||||
class TopMenuItem : public MenuItemBase {
|
||||
public:
|
||||
virtual void Paint(Draw& w);
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual void LeftUp(Point, dword);
|
||||
virtual void LeftDown(Point, dword);
|
||||
virtual void GotFocus();
|
||||
virtual void LostFocus();
|
||||
virtual bool Key(dword key, int count);
|
||||
virtual Size GetMinSize() const;
|
||||
virtual void SyncState();
|
||||
|
||||
static int GetStdHeight(Font font = StdFont());
|
||||
|
||||
private:
|
||||
int GetState();
|
||||
|
||||
public:
|
||||
TopMenuItem() { NoInitFocus(); }
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
#include "CtrlLib.h"
|
||||
|
||||
#ifndef CtrlCore_MenuImp_h
|
||||
#define CtrlCore_MenuImp_h
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
class MenuItemBase : public Ctrl, public Bar::Item
|
||||
{
|
||||
public:
|
||||
virtual Bar::Item& Text(const char *text);
|
||||
virtual Bar::Item& Key(dword key);
|
||||
virtual Bar::Item& Image(const UPP::Image& img);
|
||||
virtual Bar::Item& Enable(bool _enable);
|
||||
virtual Bar::Item& Tip(const char *tip);
|
||||
virtual Bar::Item& Help(const char *help);
|
||||
virtual Bar::Item& Topic(const char *help);
|
||||
virtual Bar::Item& Description(const char *desc);
|
||||
virtual Bar::Item& Check(bool check);
|
||||
virtual Bar::Item& Radio(bool check);
|
||||
|
||||
virtual String GetDesc() const;
|
||||
virtual dword GetAccessKeys() const;
|
||||
virtual void AssignAccessKeys(dword used);
|
||||
|
||||
protected:
|
||||
enum {
|
||||
NOTHING, CHECK0, CHECK1, RADIO0, RADIO1
|
||||
};
|
||||
|
||||
enum {
|
||||
NORMAL, HIGHLIGHT, PUSH
|
||||
};
|
||||
|
||||
String text;
|
||||
dword accel;
|
||||
int state;
|
||||
int leftgap, textgap;
|
||||
Font font;
|
||||
bool isenabled;
|
||||
byte type;
|
||||
byte accesskey;
|
||||
Size maxiconsize;
|
||||
const MenuBar::Style *style;
|
||||
|
||||
public:
|
||||
virtual void SyncState() = 0;
|
||||
|
||||
void DrawMenuText(Draw& w, int x, int y, const String& s, Font f, bool enabled, bool hl,
|
||||
Color color, Color hlcolor);
|
||||
void PaintTopItem(Draw& w, int state);
|
||||
|
||||
bool IsItemEnabled() const { return isenabled; }
|
||||
String GetText() const { return text; }
|
||||
MenuItemBase& LeftGap(int cx) { leftgap = cx; return *this; }
|
||||
MenuItemBase& TextGap(int cx) { textgap = cx; return *this; }
|
||||
MenuItemBase& SetFont(Font f) { font = f; return *this; }
|
||||
MenuItemBase& Style(const MenuBar::Style *s) { style = s; return *this; }
|
||||
Font GetFont() const { return font; }
|
||||
MenuItemBase& MaxIconSize(Size sz) { maxiconsize = sz; return *this; }
|
||||
|
||||
MenuItemBase();
|
||||
};
|
||||
|
||||
void DrawMenuText(Draw& w, int x, int y, const String& s, Font f, bool enabled,
|
||||
bool highlight, int mn, Color color, Color hltext);
|
||||
|
||||
class MenuItem : public MenuItemBase {
|
||||
public:
|
||||
virtual void Paint(Draw& w);
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual Size GetMinSize() const;
|
||||
virtual void LeftUp(Point, dword);
|
||||
virtual void RightUp(Point, dword);
|
||||
virtual void GotFocus();
|
||||
virtual void LostFocus();
|
||||
virtual bool Key(dword key, int count);
|
||||
virtual bool HotKey(dword key);
|
||||
virtual void SyncState();
|
||||
|
||||
virtual Bar::Item& Image(const UPP::Image& img);
|
||||
|
||||
private:
|
||||
UPP::Image licon, ricon;
|
||||
|
||||
void SendHelpLine();
|
||||
void ClearHelpLine();
|
||||
|
||||
protected:
|
||||
virtual int GetVisualState();
|
||||
|
||||
public:
|
||||
MenuItem& RightImage(const UPP::Image& img);
|
||||
};
|
||||
|
||||
class SubMenuBase {
|
||||
protected:
|
||||
MenuBar menu;
|
||||
Callback1<Bar&> proc;
|
||||
MenuBar *parentmenu;
|
||||
|
||||
void Pull(Ctrl *item, Point p, Size sz);
|
||||
|
||||
public:
|
||||
virtual void Pull() = 0;
|
||||
|
||||
void SetParent(MenuBar *m) { parentmenu = m; menu.MaxIconSize(m->GetMaxIconSize()); }
|
||||
void Set(Callback1<Bar&> _submenu) { proc = _submenu; }
|
||||
Callback1<Bar&> Get() { return proc; }
|
||||
|
||||
SubMenuBase() { parentmenu = NULL; }
|
||||
virtual ~SubMenuBase() {}
|
||||
};
|
||||
|
||||
class SubMenuItem : public MenuItem, public SubMenuBase {
|
||||
public:
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual void GotFocus();
|
||||
virtual bool HotKey(dword key);
|
||||
virtual bool Key(dword key, int count);
|
||||
virtual int GetVisualState();
|
||||
virtual void Pull();
|
||||
|
||||
protected:
|
||||
enum {
|
||||
TIMEID_PULL = BarCtrl::TIMEID_COUNT,
|
||||
TIMEID_COUNT
|
||||
};
|
||||
|
||||
public:
|
||||
typedef SubMenuItem CLASSNAME;
|
||||
|
||||
SubMenuItem();
|
||||
};
|
||||
|
||||
class TopSubMenuItem : public MenuItemBase, public SubMenuBase {
|
||||
public:
|
||||
virtual void Paint(Draw& w);
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual void GotFocus();
|
||||
virtual void LostFocus();
|
||||
virtual void LeftDown(Point, dword);
|
||||
virtual void SyncState();
|
||||
virtual Size GetMinSize() const;
|
||||
virtual bool Key(dword key, int);
|
||||
virtual bool HotKey(dword key);
|
||||
virtual void Pull();
|
||||
|
||||
private:
|
||||
int GetState();
|
||||
|
||||
public:
|
||||
TopSubMenuItem() { NoInitFocus(); }
|
||||
};
|
||||
|
||||
class TopMenuItem : public MenuItemBase {
|
||||
public:
|
||||
virtual void Paint(Draw& w);
|
||||
virtual void MouseEnter(Point, dword);
|
||||
virtual void MouseLeave();
|
||||
virtual void LeftUp(Point, dword);
|
||||
virtual void LeftDown(Point, dword);
|
||||
virtual void GotFocus();
|
||||
virtual void LostFocus();
|
||||
virtual bool Key(dword key, int count);
|
||||
virtual Size GetMinSize() const;
|
||||
virtual void SyncState();
|
||||
|
||||
static int GetStdHeight(Font font = StdFont());
|
||||
|
||||
private:
|
||||
int GetState();
|
||||
|
||||
public:
|
||||
TopMenuItem() { NoInitFocus(); }
|
||||
};
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -112,7 +112,9 @@ Size TreeCtrl::Item::GetValueSize() const
|
|||
|
||||
Size TreeCtrl::Item::GetCtrlSize() const
|
||||
{
|
||||
return IsNull(size) ? (ctrl ? ctrl->GetStdSize() : Size(0, 0)) : size;
|
||||
if(!ctrl) return Size(0, 0);
|
||||
Size csz = ctrl->GetStdSize();
|
||||
return Size(Nvl(size.cx, csz.cx), Nvl(size.cy, csz.cy));
|
||||
}
|
||||
|
||||
Size TreeCtrl::Item::GetSize() const
|
||||
|
|
|
|||
|
|
@ -617,7 +617,7 @@ void Draw::DrawDrawingOp(const Rect& target, const Drawing& w) {
|
|||
pos.trgini = GetOffset();
|
||||
VectorMap<int, Draw::Drawer>& map = sDrawerMap();
|
||||
StringStream s(w.data);
|
||||
LOGBEGIN();
|
||||
// LOGBEGIN();
|
||||
while(!s.IsEof()) {
|
||||
int code;
|
||||
s / code;
|
||||
|
|
@ -626,7 +626,7 @@ void Draw::DrawDrawingOp(const Rect& target, const Drawing& w) {
|
|||
break;
|
||||
(*map[i])(*this, s, pos);
|
||||
}
|
||||
LOGEND();
|
||||
// LOGEND();
|
||||
End();
|
||||
#ifdef _DEBUG
|
||||
ASSERT(GetCloffLevel() == cl);
|
||||
|
|
|
|||
|
|
@ -6,4 +6,3 @@ COMPRESSED
|
|||
229,207,192,109,9,243,116,126,133,220,130,95,153,1,141,102,13,245,223,207,248,223,34,80,147,253,170,224,28,100,151,156,155,65,215,24,115,104,41,32,175,205,190,168,39,53,148,255,194,110,247,87,190,4,217,37,87,216,173,136,161,90,236,164,252,92,115,80,111,15,229,215,105,62,168,33,108,33,191,250,170,14,93,149,42,32,203,130,25,211,157,220,12,1,171,156,75,165,15,13,58,106,64,191,79,3,232,233,34,65,211,68,232,235,173,1,89,204,16,105,62,236,15,7,123,153,102,21,232,37,205,115,201,98,136,97,185,112,69,163,98,131,58,9,248,153,135,234,82,215,217,125,67,97,1,244,146,124,79,77,31,28,241,34,32,160,254,155,137,79,135,65,4,219,35,211,40,42,49,97,134,2,61,195,233,247,186,183,32,232,26,12,101,76,143,136,129,25,57,31,9,160,22,58,231,99,128,135,129,200,52,28,24,83,153,9,68,232,201,75,145,98,222,144,247,118,60,66,89,42,197,122,89,80,60,231,122,172,101,213,254,102,134,25,173,109,146,42,211,212,138,121,56,186,203,38,
|
||||
53,220,120,161,75,240,179,248,113,137,244,162,129,43,98,17,177,92,79,48,171,177,99,56,27,215,154,150,200,131,241,26,127,214,48,199,39,232,64,48,177,23,182,56,218,207,32,115,172,221,172,65,170,239,142,80,77,57,250,180,242,248,189,208,17,230,196,16,26,185,169,121,15,230,198,210,180,171,81,78,6,149,91,58,208,153,177,181,123,156,201,143,226,150,7,95,133,242,55,247,190,81,154,70,143,219,118,21,166,102,247,251,150,67,50,137,176,32,7,57,20,167,73,58,60,54,121,180,117,8,60,147,151,62,139,204,247,234,94,74,47,80,118,212,89,143,182,48,183,202,18,166,70,56,235,219,77,58,47,190,61,175,10,93,244,229,198,152,126,184,160,214,192,161,197,138,218,4,121,155,142,20,84,81,120,14,156,74,125,107,114,121,134,129,117,9,179,3,15,227,138,249,216,29,230,105,92,147,28,66,53,232,137,136,159,67,87,222,234,174,75,165,207,23,230,14,43,110,54,19,158,3,215,164,251,15,33,40,131,246,8,89,31,67,163,225,190,8,133,223,170,88,33,99,48,65,
|
||||
1,215,16,144,139,113,234,126,205,216,230,206,202,125,195,236,95,121,116,48,108,46,207,167,214,156,8,53,150,100,150,135,87,134,197,131,147,167,117,226,195,131,213,154,25,46,158,55,75,35,252,166,15,134,12,96,62,245,97,28,67,13,115,106,84,127,14,124,183,141,85,229,212,231,106,179,138,43,99,225,187,93,76,240,148,189,214,154,227,189,148,98,156,196,250,27,186,212,164,174,69,170,158,222,230,214,21,7,204,109,47,17,143,51,117,247,160,80,12,254,7,99,121,167,180,
|
||||
|
||||
|
|
|
|||
|
|
@ -1,244 +1,244 @@
|
|||
#include "GLCtrl.h"
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#ifdef PLATFORM_X11
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Static members initialization
|
||||
int GLCtrl::Instances = 0;
|
||||
int GLCtrl::ContextActivated = 0;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
GLCtrl::GLCtrl( int depthsize, int stencilsize, bool doublebuffer,
|
||||
bool multisamplebuffering, int numberofsamples )
|
||||
{
|
||||
// Sets the current instance number and updates total instances
|
||||
InstanceNum = ++Instances;
|
||||
|
||||
WindowContext = NULL;
|
||||
|
||||
DepthSize = depthsize;
|
||||
StencilSize = stencilsize;
|
||||
DoubleBuffering = doublebuffer;
|
||||
NumberOfSamples = numberofsamples;
|
||||
|
||||
} // END Constructor class GLCtrl
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Destructor
|
||||
GLCtrl::~GLCtrl()
|
||||
{
|
||||
// If glx context is still there, destroy it
|
||||
// That can happen on unclean exit
|
||||
if(WindowContext)
|
||||
{
|
||||
glXDestroyContext( (Display *)Xdisplay, WindowContext );
|
||||
WindowContext = NULL;
|
||||
}
|
||||
|
||||
} // END Destructor class GLCtrl
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Ovverridden method to choose the correct visual
|
||||
XVisualInfo *GLCtrl::CreateVisual(void)
|
||||
{
|
||||
Vector<int> visual;
|
||||
visual << GLX_RGBA << GLX_DEPTH_SIZE << DepthSize;
|
||||
|
||||
if( StencilSize > 0 )
|
||||
visual << GLX_STENCIL_SIZE << StencilSize;
|
||||
|
||||
if( DoubleBuffering )
|
||||
visual << GLX_DOUBLEBUFFER;
|
||||
|
||||
if( MultiSampleBuffering && NumberOfSamples > 1 )
|
||||
{
|
||||
visual << GLX_SAMPLE_BUFFERS_ARB << 1 << GLX_SAMPLES_ARB << NumberOfSamples;
|
||||
}
|
||||
|
||||
visual << None;
|
||||
|
||||
// Try to find a visual
|
||||
XVisualInfo *visualInfo = NULL;
|
||||
visualInfo = glXChooseVisual( (Display*)Xdisplay, DefaultScreen(Xdisplay), visual );
|
||||
|
||||
if( visualInfo == NULL )
|
||||
{
|
||||
SetError(true);
|
||||
SetErrorMessage("GLCtrl : Impossible to find a suitable visual.");
|
||||
}
|
||||
|
||||
return visualInfo;
|
||||
|
||||
} // END GLCtrl::CreateVisual()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method for attribute setting
|
||||
void GLCtrl::SetAttributes(unsigned long &ValueMask, XSetWindowAttributes &winAttributes)
|
||||
{
|
||||
ValueMask |=
|
||||
CWBorderPixel
|
||||
| CWEventMask
|
||||
| CWSaveUnder
|
||||
;
|
||||
winAttributes.border_pixel = 0;
|
||||
winAttributes.event_mask = ExposureMask;
|
||||
winAttributes.save_under = XFalse;
|
||||
|
||||
} // END GLCtrl::SetAttributes()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Activates current OpenGL context
|
||||
void GLCtrl::ActivateContext()
|
||||
{
|
||||
if( Instances > 0 && ContextActivated != InstanceNum )
|
||||
{
|
||||
glXMakeCurrent( (Display*)Xdisplay, GetWindow(), WindowContext );
|
||||
ContextActivated = InstanceNum;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method to create OpenGL context
|
||||
void GLCtrl::AfterInit(bool Error)
|
||||
{
|
||||
// Gets the activw XVisualInfo
|
||||
XVisualInfo visualInfo = GetVisualInfo();
|
||||
|
||||
// Create an OpenGL rendering context
|
||||
WindowContext = glXCreateContext
|
||||
(
|
||||
(Display *)Xdisplay,
|
||||
&visualInfo,
|
||||
NULL, // No sharing of display lists
|
||||
GL_TRUE // Direct rendering if possible
|
||||
);
|
||||
|
||||
if( WindowContext == NULL )
|
||||
{
|
||||
SetErrorMessage("GLCtrl : Error creating GLX context.");
|
||||
SetError(true);
|
||||
}
|
||||
|
||||
// Activate the created glxwindow
|
||||
glXMakeCurrent( (Display*)Xdisplay, GetWindow(), WindowContext );
|
||||
|
||||
// Call user init function
|
||||
GLInit();
|
||||
|
||||
// Calls resize and paint functions
|
||||
GLResize( GetSize().cx, GetSize().cy );
|
||||
GLPaint();
|
||||
|
||||
} // END GLCtrl::AfterInit()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method to destroy OpenGL context
|
||||
void GLCtrl::BeforeTerminate(void)
|
||||
{
|
||||
// Calls user terminate function
|
||||
GLDone();
|
||||
|
||||
// Resets context and destroys it
|
||||
glXMakeCurrent( (Display*)Xdisplay, None, NULL );
|
||||
glXDestroyContext( (Display *)Xdisplay, WindowContext );
|
||||
WindowContext = NULL;
|
||||
|
||||
} // END GLCtrl::BeforeTerminate()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method to resize GL windows
|
||||
void GLCtrl::Resize(int x, int y)
|
||||
{
|
||||
// Activates the current context
|
||||
ActivateContext();
|
||||
|
||||
// Calls user resize hook
|
||||
GLResize(x, y);
|
||||
|
||||
} // END GLCtrl::Resize()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal OpenGL Paint method
|
||||
void GLCtrl::doPaint(void)
|
||||
{
|
||||
// Activates the current context
|
||||
ActivateContext();
|
||||
|
||||
// Calls user paint hook
|
||||
GLPaint();
|
||||
|
||||
// Swap buffers or flush as needed
|
||||
if( DoubleBuffering )
|
||||
glXSwapBuffers( (Display*)Xdisplay, GetWindow() ); // Buffer swap does implicit glFlush
|
||||
else
|
||||
glFlush();
|
||||
|
||||
} // END GLCtrl::doPaint()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Paint method - with graphic context
|
||||
void GLCtrl::Paint(Draw &draw)
|
||||
{
|
||||
// Calls internal OpenGL Paint method
|
||||
doPaint();
|
||||
|
||||
} // END GLCtrl::Paint()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Forces control resize
|
||||
void GLCtrl::PostResizeGL()
|
||||
{
|
||||
// Gets sizes from Control
|
||||
int w = GetSize().cx,
|
||||
h = GetSize().cy;
|
||||
|
||||
// Calls Resize method
|
||||
Resize(w, h);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Forces control repaint
|
||||
void GLCtrl::PostPaintGL()
|
||||
{
|
||||
// Calls internal OpenGL Paint method
|
||||
doPaint();
|
||||
|
||||
} // END GLCtrl::PostPaintGL()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Initializes OpenGL context to a standard view
|
||||
void GLCtrl::StdView()
|
||||
{
|
||||
glShadeModel(GL_SMOOTH);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
|
||||
glClearDepth(1.0f);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
|
||||
Size sz = GetSize();
|
||||
glViewport(0, 0, (GLsizei)sz.cx, (GLsizei)sz.cy);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(45.0f, (GLfloat)(sz.cx)/(GLfloat)(sz.cy), 1.0f, 100.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
} // END GLCtrl::StdView()
|
||||
|
||||
#endif
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
#include "GLCtrl.h"
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
#ifdef PLATFORM_X11
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Static members initialization
|
||||
int GLCtrl::Instances = 0;
|
||||
int GLCtrl::ContextActivated = 0;
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Constructor
|
||||
GLCtrl::GLCtrl( int depthsize, int stencilsize, bool doublebuffer,
|
||||
bool multisamplebuffering, int numberofsamples )
|
||||
{
|
||||
// Sets the current instance number and updates total instances
|
||||
InstanceNum = ++Instances;
|
||||
|
||||
WindowContext = NULL;
|
||||
|
||||
DepthSize = depthsize;
|
||||
StencilSize = stencilsize;
|
||||
DoubleBuffering = doublebuffer;
|
||||
NumberOfSamples = numberofsamples;
|
||||
|
||||
} // END Constructor class GLCtrl
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Destructor
|
||||
GLCtrl::~GLCtrl()
|
||||
{
|
||||
// If glx context is still there, destroy it
|
||||
// That can happen on unclean exit
|
||||
if(WindowContext)
|
||||
{
|
||||
glXDestroyContext( (Display *)Xdisplay, WindowContext );
|
||||
WindowContext = NULL;
|
||||
}
|
||||
|
||||
} // END Destructor class GLCtrl
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Ovverridden method to choose the correct visual
|
||||
XVisualInfo *GLCtrl::CreateVisual(void)
|
||||
{
|
||||
Vector<int> visual;
|
||||
visual << GLX_RGBA << GLX_DEPTH_SIZE << DepthSize;
|
||||
|
||||
if( StencilSize > 0 )
|
||||
visual << GLX_STENCIL_SIZE << StencilSize;
|
||||
|
||||
if( DoubleBuffering )
|
||||
visual << GLX_DOUBLEBUFFER;
|
||||
|
||||
if( MultiSampleBuffering && NumberOfSamples > 1 )
|
||||
{
|
||||
visual << GLX_SAMPLE_BUFFERS_ARB << 1 << GLX_SAMPLES_ARB << NumberOfSamples;
|
||||
}
|
||||
|
||||
visual << None;
|
||||
|
||||
// Try to find a visual
|
||||
XVisualInfo *visualInfo = NULL;
|
||||
visualInfo = glXChooseVisual( (Display*)Xdisplay, DefaultScreen(Xdisplay), visual );
|
||||
|
||||
if( visualInfo == NULL )
|
||||
{
|
||||
SetError(true);
|
||||
SetErrorMessage("GLCtrl : Impossible to find a suitable visual.");
|
||||
}
|
||||
|
||||
return visualInfo;
|
||||
|
||||
} // END GLCtrl::CreateVisual()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method for attribute setting
|
||||
void GLCtrl::SetAttributes(unsigned long &ValueMask, XSetWindowAttributes &winAttributes)
|
||||
{
|
||||
ValueMask |=
|
||||
CWBorderPixel
|
||||
| CWEventMask
|
||||
| CWSaveUnder
|
||||
;
|
||||
winAttributes.border_pixel = 0;
|
||||
winAttributes.event_mask = ExposureMask;
|
||||
winAttributes.save_under = XFalse;
|
||||
|
||||
} // END GLCtrl::SetAttributes()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Activates current OpenGL context
|
||||
void GLCtrl::ActivateContext()
|
||||
{
|
||||
if( Instances > 0 && ContextActivated != InstanceNum )
|
||||
{
|
||||
glXMakeCurrent( (Display*)Xdisplay, GetWindow(), WindowContext );
|
||||
ContextActivated = InstanceNum;
|
||||
}
|
||||
}
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method to create OpenGL context
|
||||
void GLCtrl::AfterInit(bool Error)
|
||||
{
|
||||
// Gets the activw XVisualInfo
|
||||
XVisualInfo visualInfo = GetVisualInfo();
|
||||
|
||||
// Create an OpenGL rendering context
|
||||
WindowContext = glXCreateContext
|
||||
(
|
||||
(Display *)Xdisplay,
|
||||
&visualInfo,
|
||||
NULL, // No sharing of display lists
|
||||
GL_TRUE // Direct rendering if possible
|
||||
);
|
||||
|
||||
if( WindowContext == NULL )
|
||||
{
|
||||
SetErrorMessage("GLCtrl : Error creating GLX context.");
|
||||
SetError(true);
|
||||
}
|
||||
|
||||
// Activate the created glxwindow
|
||||
glXMakeCurrent( (Display*)Xdisplay, GetWindow(), WindowContext );
|
||||
|
||||
// Call user init function
|
||||
GLInit();
|
||||
|
||||
// Calls resize and paint functions
|
||||
GLResize( GetSize().cx, GetSize().cy );
|
||||
GLPaint();
|
||||
|
||||
} // END GLCtrl::AfterInit()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method to destroy OpenGL context
|
||||
void GLCtrl::BeforeTerminate(void)
|
||||
{
|
||||
// Calls user terminate function
|
||||
GLDone();
|
||||
|
||||
// Resets context and destroys it
|
||||
glXMakeCurrent( (Display*)Xdisplay, None, NULL );
|
||||
glXDestroyContext( (Display *)Xdisplay, WindowContext );
|
||||
WindowContext = NULL;
|
||||
|
||||
} // END GLCtrl::BeforeTerminate()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Overridden method to resize GL windows
|
||||
void GLCtrl::Resize(int x, int y)
|
||||
{
|
||||
// Activates the current context
|
||||
ActivateContext();
|
||||
|
||||
// Calls user resize hook
|
||||
GLResize(x, y);
|
||||
|
||||
} // END GLCtrl::Resize()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Internal OpenGL Paint method
|
||||
void GLCtrl::doPaint(void)
|
||||
{
|
||||
// Activates the current context
|
||||
ActivateContext();
|
||||
|
||||
// Calls user paint hook
|
||||
GLPaint();
|
||||
|
||||
// Swap buffers or flush as needed
|
||||
if( DoubleBuffering )
|
||||
glXSwapBuffers( (Display*)Xdisplay, GetWindow() ); // Buffer swap does implicit glFlush
|
||||
else
|
||||
glFlush();
|
||||
|
||||
} // END GLCtrl::doPaint()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Paint method - with graphic context
|
||||
void GLCtrl::Paint(Draw &draw)
|
||||
{
|
||||
// Calls internal OpenGL Paint method
|
||||
doPaint();
|
||||
|
||||
} // END GLCtrl::Paint()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Forces control resize
|
||||
void GLCtrl::PostResizeGL()
|
||||
{
|
||||
// Gets sizes from Control
|
||||
int w = GetSize().cx,
|
||||
h = GetSize().cy;
|
||||
|
||||
// Calls Resize method
|
||||
Resize(w, h);
|
||||
|
||||
}
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Forces control repaint
|
||||
void GLCtrl::PostPaintGL()
|
||||
{
|
||||
// Calls internal OpenGL Paint method
|
||||
doPaint();
|
||||
|
||||
} // END GLCtrl::PostPaintGL()
|
||||
|
||||
|
||||
/////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Initializes OpenGL context to a standard view
|
||||
void GLCtrl::StdView()
|
||||
{
|
||||
glShadeModel(GL_SMOOTH);
|
||||
glClearColor(0.0f, 0.0f, 0.0f, 0.5f);
|
||||
glClearDepth(1.0f);
|
||||
glEnable(GL_DEPTH_TEST);
|
||||
glDepthFunc(GL_LEQUAL);
|
||||
glHint(GL_PERSPECTIVE_CORRECTION_HINT, GL_NICEST);
|
||||
|
||||
Size sz = GetSize();
|
||||
glViewport(0, 0, (GLsizei)sz.cx, (GLsizei)sz.cy);
|
||||
glMatrixMode(GL_PROJECTION);
|
||||
glLoadIdentity();
|
||||
gluPerspective(45.0f, (GLfloat)(sz.cx)/(GLfloat)(sz.cy), 1.0f, 100.0f);
|
||||
glMatrixMode(GL_MODELVIEW);
|
||||
glLoadIdentity();
|
||||
|
||||
} // END GLCtrl::StdView()
|
||||
|
||||
#endif
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
|
|
|||
|
|
@ -203,6 +203,60 @@ private:
|
|||
// One<Tree> tree;
|
||||
};
|
||||
|
||||
class GisCoords;
|
||||
class GisTransform;
|
||||
|
||||
class Gis2DPolynome {
|
||||
public:
|
||||
Gis2DPolynome() {}
|
||||
|
||||
void Calculate(const GisTransform& transform, const Rectf& src_extent);
|
||||
|
||||
Pointf Transform(double x, double y) const;
|
||||
Pointf Transform(const Pointf& pt) const { return Transform(pt.x, pt.y); }
|
||||
|
||||
enum COEF {
|
||||
COEF_1,
|
||||
COEF_X,
|
||||
COEF_Y,
|
||||
COEF_X2,
|
||||
COEF_XY,
|
||||
COEF_Y2,
|
||||
COEF_X3,
|
||||
COEF_X2Y,
|
||||
COEF_XY2,
|
||||
COEF_Y3,
|
||||
COEF_COUNT
|
||||
};
|
||||
Sizef coef[COEF_COUNT];
|
||||
};
|
||||
|
||||
inline Pointf operator * (const Pointf& xy, const Gis2DPolynome& poly) { return poly.Transform(xy); }
|
||||
|
||||
class Gis2DGrid : public Pte<Gis2DGrid> {
|
||||
public:
|
||||
Gis2DGrid(const Sizef& block_size = Sizef(1, 1), const Rect& block_limit = Rect(-180, -90, +180, +90));
|
||||
|
||||
void Grow(const GisTransform& transform, const Rectf& extent);
|
||||
|
||||
Point GetBlockIndex(const Pointf& point) const;
|
||||
Rect GetBlockSpan(const Rectf& rc) const;
|
||||
Pointf Transform(const Pointf& pt) const;
|
||||
|
||||
const Gis2DPolynome *GetBlock(int x, int y) const;
|
||||
const Gis2DPolynome *GetBlock(Point pt) const { return GetBlock(pt.x, pt.y); }
|
||||
|
||||
int SizeOf() const;
|
||||
|
||||
public:
|
||||
BiVector< BiArray<Gis2DPolynome> > block_rows;
|
||||
Sizef block_size;
|
||||
Rect block_span;
|
||||
Rect block_limit;
|
||||
};
|
||||
|
||||
inline Pointf operator * (const Pointf& pt, const Gis2DGrid& poly) { return poly.Transform(pt); }
|
||||
|
||||
String GisInterpolatorDelta(double xmin, double xmax, const GisFunction& fn, int buckets, int sections, int samples, int check);
|
||||
String GisInterpolatorTiming(double xmin, double xmax, const GisFunction& fn, int buckets, int sections, int samples, int check);
|
||||
|
||||
|
|
@ -482,6 +536,7 @@ public:
|
|||
public:
|
||||
GisCoords source;
|
||||
GisCoords target;
|
||||
Ptr<Gis2DGrid> grid;
|
||||
};
|
||||
|
||||
public:
|
||||
|
|
@ -514,6 +569,7 @@ public:
|
|||
GisCoords Source() const { return data->source; }
|
||||
GisCoords Target() const { return data->target; }
|
||||
GisTransform Reverse() const { return GisTransform(Target(), Source()); }
|
||||
Gis2DGrid *Grid() const { return data->grid; }
|
||||
|
||||
Data *operator ~ () const { return ~data; }
|
||||
|
||||
|
|
|
|||
|
|
@ -1110,6 +1110,164 @@ Pointf WorldTransform::Global3(const Pointf& pt) const
|
|||
}
|
||||
*/
|
||||
|
||||
void Gis2DPolynome::Calculate(const GisTransform& transform, const Rectf& src)
|
||||
{
|
||||
int xinter = 10, yinter = 10;
|
||||
LinearSolver xsolv(COEF_COUNT), ysolv(COEF_COUNT);
|
||||
double bases[COEF_COUNT];
|
||||
for(int ix = 0; ix <= xinter; ix++)
|
||||
for(int iy = 0; iy <= yinter; iy++) {
|
||||
double x = ix / (double)xinter, y = iy / (double)yinter;
|
||||
double x2 = x * x, y2 = y * y;
|
||||
Pointf dest = transform.Target(src.TopLeft() + src.Size() * Sizef(x, y));
|
||||
bases[COEF_1] = 1;
|
||||
bases[COEF_X] = x;
|
||||
bases[COEF_Y] = y;
|
||||
bases[COEF_X2] = x2;
|
||||
bases[COEF_XY] = x * y;
|
||||
bases[COEF_Y2] = y2;
|
||||
bases[COEF_X3] = x2 * x;
|
||||
bases[COEF_X2Y] = x2 * y;
|
||||
bases[COEF_XY2] = x * y2;
|
||||
bases[COEF_Y3] = y2 * y;
|
||||
xsolv.AddLSI(bases, dest.x);
|
||||
ysolv.AddLSI(bases, dest.y);
|
||||
}
|
||||
Vector<double> xcoef = xsolv.Solve();
|
||||
Vector<double> ycoef = ysolv.Solve();
|
||||
for(int i = 0; i < COEF_COUNT; i++)
|
||||
coef[i] = Sizef(xcoef[i], ycoef[i]);
|
||||
}
|
||||
|
||||
Pointf Gis2DPolynome::Transform(double x, double y) const
|
||||
{
|
||||
double x2 = x * x, y2 = y * y;
|
||||
return coef[COEF_1]
|
||||
+ coef[COEF_X] * x
|
||||
+ coef[COEF_Y] * y
|
||||
+ coef[COEF_XY] * (x * y)
|
||||
+ coef[COEF_X2] * x2
|
||||
+ coef[COEF_Y2] * y2
|
||||
+ coef[COEF_X3] * (x2 * x)
|
||||
+ coef[COEF_X2Y] * (x2 * y)
|
||||
+ coef[COEF_XY2] * (x * y2)
|
||||
+ coef[COEF_Y3] * (y2 * y)
|
||||
;
|
||||
}
|
||||
|
||||
Gis2DGrid::Gis2DGrid(const Sizef& block_size_, const Rect& block_limit_)
|
||||
: block_size(block_size_)
|
||||
, block_limit(block_limit_)
|
||||
{
|
||||
block_span = Rectf(0, 0, 0, 0);
|
||||
}
|
||||
|
||||
Point Gis2DGrid::GetBlockIndex(const Pointf& point) const
|
||||
{
|
||||
return Point(ffloor(point.x / block_size.cx), ffloor(point.y / block_size.cy));
|
||||
}
|
||||
|
||||
Rect Gis2DGrid::GetBlockSpan(const Rectf& rc) const
|
||||
{
|
||||
return Rect(ffloor(rc.left / block_size.cx), ffloor(rc.top / block_size.cy),
|
||||
ffloor(rc.right / block_size.cx) + 1, ffloor(rc.bottom / block_size.cy) + 1);
|
||||
}
|
||||
|
||||
Pointf Gis2DGrid::Transform(const Pointf& pt) const
|
||||
{
|
||||
Point block = GetBlockIndex(pt);
|
||||
if(const Gis2DPolynome *poly = GetBlock(block))
|
||||
return poly->Transform(pt.x / block_size.cx - block.x, pt.y / block_size.cy - block.y);
|
||||
return Null;
|
||||
}
|
||||
|
||||
const Gis2DPolynome *Gis2DGrid::GetBlock(int x, int y) const
|
||||
{
|
||||
return (x >= block_span.left && x < block_span.right && y >= block_span.top && y < block_span.bottom
|
||||
? &block_rows[y - block_span.top][x - block_span.left]
|
||||
: NULL);
|
||||
}
|
||||
|
||||
int Gis2DGrid::SizeOf() const
|
||||
{
|
||||
return block_span.Width() * block_span.Height() * (sizeof(Gis2DPolynome) + 32) + sizeof(*this);
|
||||
}
|
||||
|
||||
void Gis2DGrid::Grow(const GisTransform& transform, const Rectf& extent)
|
||||
{
|
||||
Rect target_span = GetBlockSpan(extent) & block_limit;
|
||||
if(block_span.Contains(target_span))
|
||||
return;
|
||||
if(block_span.IsEmpty())
|
||||
block_span = Rect(target_span.left, target_span.top, target_span.left, target_span.top);
|
||||
target_span |= block_span;
|
||||
int add_left = block_span.left - target_span.left;
|
||||
int add_right = target_span.right - block_span.right;
|
||||
ASSERT(add_left >= 0 && add_right >= 0);
|
||||
Rectf blk_extent(block_size.cx * block_span.left, block_size.cy * block_span.top,
|
||||
block_size.cx * block_span.right, block_size.cy * block_span.bottom);
|
||||
if(add_left || add_right) {
|
||||
Rectf row_extent = blk_extent;
|
||||
row_extent.bottom = row_extent.top + block_size.cy;
|
||||
for(int i = 0; i < block_rows.GetCount(); i++) {
|
||||
BiArray<Gis2DPolynome>& row = block_rows[i];
|
||||
if(add_left) {
|
||||
Rectf cell = row_extent;
|
||||
for(int n = 0; n < add_left; n++) {
|
||||
cell.right = cell.left;
|
||||
cell.left -= block_size.cx;
|
||||
row.AddHead().Calculate(transform, cell);
|
||||
}
|
||||
}
|
||||
if(add_right) {
|
||||
Rectf cell = row_extent;
|
||||
for(int n = 0; n < add_right; n++) {
|
||||
cell.left = cell.right;
|
||||
cell.right += block_size.cx;
|
||||
row.AddTail().Calculate(transform, cell);
|
||||
}
|
||||
}
|
||||
row_extent.OffsetVert(block_size.cy);
|
||||
}
|
||||
block_span.Inflate(add_left, 0, add_right, 0);
|
||||
blk_extent.Inflate(-block_size.cx * add_left, 0, block_size.cx * add_right, 0);
|
||||
}
|
||||
int add_top = block_span.top - target_span.top;
|
||||
if(add_top) {
|
||||
Rectf cell = blk_extent;
|
||||
for(int i = 0; i < add_top; i++) {
|
||||
cell.bottom = cell.top;
|
||||
cell.top -= block_size.cy;
|
||||
BiArray<Gis2DPolynome>& top = block_rows.AddHead();
|
||||
cell.right = blk_extent.left;
|
||||
for(int j = block_span.left; j < block_span.right; j++) {
|
||||
cell.left = cell.right;
|
||||
cell.right += block_size.cx;
|
||||
top.AddTail().Calculate(transform, cell);
|
||||
}
|
||||
}
|
||||
block_span.top -= add_top;
|
||||
blk_extent.top -= add_top * block_size.cy;
|
||||
}
|
||||
int add_bottom = target_span.bottom - block_span.bottom;
|
||||
if(add_bottom) {
|
||||
Rectf cell = blk_extent;
|
||||
for(int i = 0; i < add_bottom; i++) {
|
||||
cell.top = cell.bottom;
|
||||
cell.bottom += block_size.cy;
|
||||
BiArray<Gis2DPolynome>& bottom = block_rows.AddTail();
|
||||
cell.right = blk_extent.left;
|
||||
for(int j = block_span.left; j < block_span.right; j++) {
|
||||
cell.left = cell.right;
|
||||
cell.right += block_size.cx;
|
||||
bottom.AddTail().Calculate(transform, cell);
|
||||
}
|
||||
}
|
||||
block_span.bottom += add_bottom;
|
||||
blk_extent.bottom += add_bottom * block_size.cy;
|
||||
}
|
||||
}
|
||||
|
||||
static One<LinearSegmentTree::Node> CreateLinearSplit(Point s1, Point s2, Point t1, Point t2, const SegmentTreeInfo& info, int depth)
|
||||
{
|
||||
double m = info.src_trg.SourceDeviation(Pointf(s1) * info.img_src, Pointf(s2) * info.img_src);
|
||||
|
|
|
|||
|
|
@ -2219,7 +2219,7 @@ public:
|
|||
typedef DlgPathStyleMap CLASSNAME;
|
||||
DlgPathStyleMap();
|
||||
|
||||
String Run(PathStyleMap& map, String dflt = Null, bool editor = false, bool read_only = false);
|
||||
bool Run(PathStyleMap& map, String& style, bool editor = false, bool read_only = false);
|
||||
|
||||
private:
|
||||
// void UpdateMaps();
|
||||
|
|
@ -2232,8 +2232,8 @@ private:
|
|||
// Vector<int> map_index;
|
||||
};
|
||||
|
||||
String RunDlgPathStyleMap(PathStyleMap& map, const String& dflt, bool editor, bool read_only)
|
||||
{ return DlgPathStyleMap().Run(map, dflt, editor, read_only); }
|
||||
bool RunDlgPathStyleMap(PathStyleMap& map, String& style, bool editor, bool read_only)
|
||||
{ return DlgPathStyleMap().Run(map, style, editor, read_only); }
|
||||
|
||||
RegisterHelpTopicObjectTitle(DlgPathStyleMap, "Mapa stylù")
|
||||
|
||||
|
|
@ -2249,49 +2249,11 @@ DlgPathStyleMap::DlgPathStyleMap()
|
|||
// dialog.tab <<= THISBACK(OnTab);
|
||||
}
|
||||
|
||||
/*
|
||||
MEMBER_HELP(DlgPathStyleMap, "Styly čar",
|
||||
"čára, mapa stylů\n"
|
||||
"mapa stylů čar\n"
|
||||
"styly čar, mapa\n"
|
||||
)
|
||||
|
||||
void DlgPathStyleMap::PutHelp()
|
||||
bool DlgPathStyleMap::Run(PathStyleMap& m, String& style, bool editor, bool read_only)
|
||||
{
|
||||
HelpBody() <<
|
||||
"Dialog slouží k výběru stylu čáry nebo editaci stylů čar. "
|
||||
"V dialogu se zobrazují všechny styly čar, které jsou právě "
|
||||
"v systému k dispozici. Každý styl čáry je označen textovým "
|
||||
"názvem, který se používá jako odkaz na styl čáry. Kromě "
|
||||
"názvu se při vykreslování čáry zadává ještě šířka čáry "
|
||||
"a implicitní barva (některé segmenty čar mohou být vykresleny "
|
||||
"touto implicitní barvou, jiné pevně zadanou barvou).";
|
||||
|
||||
DlgPathStyleMap d;
|
||||
d.dialog.browser.Set(d.map = &PathStyleMap::App());
|
||||
HelpCenterImage(d.dialog) <<
|
||||
"Tabulka v horní části dialogu slouží k výběru stylu čáry. "
|
||||
"V obdélníkovém poli jsou uspořádány náhledy všech dostupných "
|
||||
"stylů čar. Dvojitým kliknutím na náhled čáry vyberete styl "
|
||||
"čáry pro další použití v místě, odkud byl dialog vyvolán "
|
||||
"(odpovídá funkci tlačítka " << HelpButton("OK", 600) << "). "
|
||||
"Pravým tlačítkem můžete zobrazit lokální nabídku funkcí pro práci "
|
||||
"se styly čar:\n\n";
|
||||
|
||||
MenuBar menu;
|
||||
d.dialog.browser.ToolLocal(menu);
|
||||
|
||||
// HelpBody()
|
||||
// << HelpImage(menu);
|
||||
}
|
||||
*/
|
||||
|
||||
String DlgPathStyleMap::Run(PathStyleMap& m, String dflt, bool editor, bool read_only)
|
||||
{
|
||||
if(editor)
|
||||
{
|
||||
if(editor) {
|
||||
dialog.ok.Hide();
|
||||
dialog.cancel.SetLabel("Zavřít");
|
||||
dialog.cancel.SetLabel(t_("Close"));
|
||||
}
|
||||
|
||||
map = &m;
|
||||
|
|
@ -2299,16 +2261,20 @@ String DlgPathStyleMap::Run(PathStyleMap& m, String dflt, bool editor, bool read
|
|||
// UpdateMaps();
|
||||
|
||||
dialog.browser.Set(map);
|
||||
while(dialog.Run() == IDOK)
|
||||
{
|
||||
dialog.browser.SetCursor(Nvl(style, ".solid"));
|
||||
while(dialog.Run() == IDOK) {
|
||||
int c = dialog.browser.GetCursor();
|
||||
if(c >= 0)
|
||||
return map->GetSortName(c);
|
||||
if(c >= 0) {
|
||||
style = map->GetSortName(c);
|
||||
if(style == ".solid") style = Null;
|
||||
return true;
|
||||
}
|
||||
BeepExclamation();
|
||||
}
|
||||
return Null;
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
void DlgPathStyleMap::UpdateMaps()
|
||||
{
|
||||
|
|
@ -2345,8 +2311,8 @@ PathStyleCtrl::PathStyleCtrl()
|
|||
|
||||
void PathStyleCtrl::DoAction()
|
||||
{
|
||||
String s = RunDlgPathStyleMap(*path_map, GetData(), false, false);
|
||||
if(!IsNull(s))
|
||||
String s = GetData();
|
||||
if(RunDlgPathStyleMap(*path_map, s, false, false))
|
||||
SetDataAction(s);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -267,7 +267,7 @@ private:
|
|||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
bool RunDlgPathEditor(PathStyle& style, const String& title = Null);
|
||||
String RunDlgPathStyleMap(PathStyleMap& map, const String& dflt = Null, bool editor = false, bool read_only = false);
|
||||
bool RunDlgPathStyleMap(PathStyleMap& map, String& style, bool editor = false, bool read_only = false);
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
|
|
|||
|
|
@ -2109,6 +2109,51 @@ One<MarkTool::Marker> MarkTool::Star(int size, Color color, Color outline, int o
|
|||
return new StarMarker(size, color, outline, outline_width);
|
||||
}
|
||||
|
||||
class ThickCrossMarker : public AreaMarker
|
||||
{
|
||||
public:
|
||||
ThickCrossMarker(int size, Color color, Color outline, int outline_width);
|
||||
|
||||
virtual void Paint(Draw& draw, const Vector<Point>& pt);
|
||||
|
||||
private:
|
||||
int s2, s6;
|
||||
};
|
||||
|
||||
ThickCrossMarker::ThickCrossMarker(int size, Color color, Color outline, int outline_width)
|
||||
: AreaMarker(size, color, outline, outline_width)
|
||||
{
|
||||
s2 = size >> 1;
|
||||
s6 = size / 6;
|
||||
}
|
||||
|
||||
void ThickCrossMarker::Paint(Draw& draw, const Vector<Point>& pt)
|
||||
{
|
||||
Vector<Point> out;
|
||||
out.SetCount(pt.GetCount() * 12);
|
||||
Point *op = out.Begin();
|
||||
for(const Point *ip = pt.Begin(), *ie = pt.End(); ip < ie; ip++, op += 12) {
|
||||
int x = ip->x, y = ip->y;
|
||||
op[0].x = op[11].x = x + s2;
|
||||
op[1].x = op[2].x = op[9].x = op[10].x = x + s6;
|
||||
op[3].x = op[4].x = op[7].x = op[8].x = x - s6;
|
||||
op[5].x = op[6].x = x - s2;
|
||||
|
||||
op[2].y = op[3].y = y + s2;
|
||||
op[0].y = op[1].y = op[4].y = op[5].y = y + s6;
|
||||
op[6].y = op[7].y = op[10].y = op[11].y = y - s6;
|
||||
op[8].y = op[9].y = y - s2;
|
||||
}
|
||||
Vector<int> seg;
|
||||
seg.SetCount(pt.GetCount(), 12);
|
||||
DrawPolygons(draw, out, seg, color, outline_width, outline);
|
||||
}
|
||||
|
||||
One<MarkTool::Marker> MarkTool::ThickCross(int size, Color color, Color outline, int outline_width)
|
||||
{
|
||||
return new ThickCrossMarker(size, color, outline, outline_width);
|
||||
}
|
||||
|
||||
class LetterMarker : public MarkTool::Marker
|
||||
{
|
||||
public:
|
||||
|
|
|
|||
|
|
@ -390,11 +390,12 @@ public:
|
|||
static One<Marker> Star(int size = 10, Color color = LtRed, Color outline = Black, int outline_width = 0);
|
||||
static One<Marker> Square45(int size = 10, Color color = LtRed, Color outline = Black, int outline_width = 0);
|
||||
static One<Marker> Nabla(int size = 10, Color color = LtRed, Color outline = Black, int outline_width = 0);
|
||||
static One<Marker> ThickCross(int size = 10, Color color = LtRed, Color outline = Black, int outline_width = 0);
|
||||
static One<Marker> Letter(char ascii, int angle = 0, Font font = StdFont(), Color color = LtRed, Color outline = Black);
|
||||
static One<Marker> Picture(Image pic, int size = 0, Color color = LtRed, bool antialias = false, bool ignore_hotspot = false);
|
||||
// angle in degrees, 360 = full circle
|
||||
|
||||
enum { CIRCLE, SQUARE, TRIANGLE, CROSS, DIAMOND, HEXAGON, STAR, SQUARE45, NABLA, STD_MARK_COUNT }; // standard markers
|
||||
enum { CIRCLE, SQUARE, TRIANGLE, CROSS, DIAMOND, HEXAGON, STAR, SQUARE45, NABLA, THICK_CROSS, STD_MARK_COUNT }; // standard markers
|
||||
static One<Marker> StandardMarker(int type, int size = 10, Color color = LtRed, Color outline = Black, int outline_width = 0);
|
||||
|
||||
MarkTool();
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ fiFI("Sulje")
|
|||
huHU("Bezár")
|
||||
plPL("Zamknij")
|
||||
ruRU("Закрыть")
|
||||
zhTW("關閉")
|
||||
|
||||
T_("Search")
|
||||
deDE("Suchen")
|
||||
|
|
@ -18,6 +19,7 @@ fiFI("")
|
|||
huHU("Keresés")
|
||||
plPL("")
|
||||
ruRU("Поиск")
|
||||
zhTW("")
|
||||
|
||||
T_("Append")
|
||||
deDE("Anfügen")
|
||||
|
|
@ -26,6 +28,7 @@ fiFI("Lisää loppuun")
|
|||
huHU("Hozzáfűzés")
|
||||
plPL("Dodaj")
|
||||
ruRU("Добавить")
|
||||
zhTW("")
|
||||
|
||||
T_("Insert ")
|
||||
deDE("Einfügen")
|
||||
|
|
@ -34,6 +37,7 @@ fiFI("Lisää väliin ")
|
|||
huHU("Beszúrás")
|
||||
plPL("Wstaw")
|
||||
ruRU("Вставить")
|
||||
zhTW("")
|
||||
|
||||
T_("Duplicate")
|
||||
deDE("Duplizieren")
|
||||
|
|
@ -42,6 +46,7 @@ fiFI("Kahdenna")
|
|||
huHU("Duplikálás")
|
||||
plPL("Zduplikuj")
|
||||
ruRU("Дублировать")
|
||||
zhTW("")
|
||||
|
||||
T_("Delete ")
|
||||
deDE("Löschen")
|
||||
|
|
@ -50,6 +55,7 @@ fiFI("Poista")
|
|||
huHU("Törlés")
|
||||
plPL("Usuń")
|
||||
ruRU("Удалить")
|
||||
zhTW("")
|
||||
|
||||
T_("Edit")
|
||||
deDE("Bearbeiten")
|
||||
|
|
@ -58,6 +64,7 @@ fiFI("Muokkaa")
|
|||
huHU("Szerkesztés")
|
||||
plPL("Edytuj")
|
||||
ruRU("Редактировать")
|
||||
zhTW("")
|
||||
|
||||
T_("Accept")
|
||||
deDE("Bestätigen")
|
||||
|
|
@ -66,6 +73,7 @@ fiFI("Hyväksy")
|
|||
huHU("Elfogadás")
|
||||
plPL("Zatwierdź")
|
||||
ruRU("Подтвердить")
|
||||
zhTW("")
|
||||
|
||||
T_("Cancel")
|
||||
deDE("Abruch")
|
||||
|
|
@ -74,6 +82,7 @@ fiFI("Peruuta")
|
|||
huHU("Mégsem")
|
||||
plPL("Anuluj")
|
||||
ruRU("Отмена")
|
||||
zhTW("取消")
|
||||
|
||||
T_("Move up")
|
||||
deDE("Nach oben")
|
||||
|
|
@ -82,6 +91,7 @@ fiFI("Siirrä ylös")
|
|||
huHU("Mozgatás fel")
|
||||
plPL("Przesuń do góry")
|
||||
ruRU("Вверх")
|
||||
zhTW("")
|
||||
|
||||
T_("Move down")
|
||||
deDE("Nach unten")
|
||||
|
|
@ -90,6 +100,7 @@ fiFI("Siirrä alas")
|
|||
huHU("Mozgatás le")
|
||||
plPL("Przesuń w dół")
|
||||
ruRU("Вниз")
|
||||
zhTW("")
|
||||
|
||||
T_("First %s")
|
||||
deDE("Erster %s")
|
||||
|
|
@ -98,6 +109,7 @@ fiFI("Ensimmäinen %s")
|
|||
huHU("Első %s")
|
||||
plPL("Pierwszy %s")
|
||||
ruRU("Первые %s")
|
||||
zhTW("")
|
||||
|
||||
T_("Previous %s")
|
||||
deDE("Vorheriger %s")
|
||||
|
|
@ -106,6 +118,7 @@ fiFI("Edellinen %s")
|
|||
huHU("Előző %s")
|
||||
plPL("Poprzedni %s")
|
||||
ruRU("Предыдущие $s")
|
||||
zhTW("")
|
||||
|
||||
T_("Next %s")
|
||||
deDE("Nächster %s")
|
||||
|
|
@ -114,6 +127,7 @@ fiFI("Seuraava %s")
|
|||
huHU("Következő %s")
|
||||
plPL("Następny %s")
|
||||
ruRU("Следующие %s")
|
||||
zhTW("")
|
||||
|
||||
T_("Last %s")
|
||||
deDE("Letzter %s")
|
||||
|
|
@ -122,6 +136,7 @@ fiFI("Viimeinen %s")
|
|||
huHU("Utolsó %s")
|
||||
plPL("Ostatni %s")
|
||||
ruRU("Последние %s")
|
||||
zhTW("")
|
||||
|
||||
T_("Immediate search")
|
||||
deDE("Sofort suchen")
|
||||
|
|
@ -130,6 +145,7 @@ fiFI("Välitön haku")
|
|||
huHU("Azonnali keresés")
|
||||
plPL("Wyszukiwanie natychmiastowe")
|
||||
ruRU("Непосредственный поиск")
|
||||
zhTW("")
|
||||
|
||||
T_("Hide rows")
|
||||
deDE("Reihen ausblenden")
|
||||
|
|
@ -138,6 +154,7 @@ fiFI("Piilota rivit")
|
|||
huHU("Sorok rejtése")
|
||||
plPL("Ukrywaj niepasujące wiersze")
|
||||
ruRU("Спрятать строки")
|
||||
zhTW("")
|
||||
|
||||
T_("Highlight found cells")
|
||||
deDE("Markiere gefundene Zellen")
|
||||
|
|
@ -146,6 +163,7 @@ fiFI("Korosta löydetyt solut")
|
|||
huHU("Talált cellák kiemelése")
|
||||
plPL("Podświetlaj znalezione komórki")
|
||||
ruRU("Подсветить найденные ячейки")
|
||||
zhTW("")
|
||||
|
||||
T_("Case sensitive")
|
||||
deDE("Gross-/Kleinschreibung beachten")
|
||||
|
|
@ -154,6 +172,7 @@ fiFI("Huomioi isot/pienet kirjaimet")
|
|||
huHU("Kis-/nagybetű érzékeny")
|
||||
plPL("Rozróżniaj małe i duże litery")
|
||||
ruRU("Учитывать регистр")
|
||||
zhTW("")
|
||||
|
||||
T_("row")
|
||||
deDE("Reihe")
|
||||
|
|
@ -162,6 +181,7 @@ fiFI("rivi")
|
|||
huHU("sor")
|
||||
plPL("wiersz")
|
||||
ruRU("ряды")
|
||||
zhTW("列")
|
||||
|
||||
T_("Insert a new %s into the table.")
|
||||
deDE("Neuen %s in die Tabelle einfügen")
|
||||
|
|
@ -170,6 +190,7 @@ fiFI("Lisää uusi %s taulukkoon.")
|
|||
huHU("Új %s beszúrása a táblázatba")
|
||||
plPL("Wstawia nowy %s do tabeli.")
|
||||
ruRU("Вставить новый %s в таблицу.")
|
||||
zhTW("插入新的 %s 到表格")
|
||||
|
||||
T_("Insert before")
|
||||
deDE("Davor einfügen")
|
||||
|
|
@ -178,6 +199,7 @@ fiFI("Lisää ennen")
|
|||
huHU("Beszúrás elé")
|
||||
plPL("Wstaw przed")
|
||||
ruRU("Вставить до")
|
||||
zhTW("")
|
||||
|
||||
T_("Insert a new %s into the table before current")
|
||||
deDE("Neuen %s in die Tabelle vor aktuellen einfügen")
|
||||
|
|
@ -186,6 +208,7 @@ fiFI("Lisää uusi %s taulukkoon ennen nykyistä")
|
|||
huHU("Új %s beszúrása a táblázatba az aktuális elé")
|
||||
plPL("Wstawia nowy %s do tabeli przed aktualnym")
|
||||
ruRU("Вставить новый %s в таблицу перед существующим")
|
||||
zhTW("在表格中目前項前插入新的 %s")
|
||||
|
||||
T_("Insert after")
|
||||
deDE("Danach einfügen")
|
||||
|
|
@ -194,6 +217,7 @@ fiFI("Lisää jälkeen")
|
|||
huHU("Beszúrás utána")
|
||||
plPL("Wstaw za")
|
||||
ruRU("Вставить после")
|
||||
zhTW("")
|
||||
|
||||
T_("Insert a new %s into the table after current")
|
||||
deDE("Neuen %s in die Tabelle nach aktuellen einfügen")
|
||||
|
|
@ -202,6 +226,7 @@ fiFI("Lisää uusi %s taulukkoon nykyisen jälkeen")
|
|||
huHU("Új %s beszúrása a táblázatba az aktuális mögé")
|
||||
plPL("Wstawia nowy %s do tabeli po aktualnym")
|
||||
ruRU("Вставить новый %s в таблицу после существующего")
|
||||
zhTW("在表格中目前項後插入新的 %s")
|
||||
|
||||
T_("Append a new %s at the end of the table.")
|
||||
deDE("Neue %s am Ende der Tabelle hinzufügen")
|
||||
|
|
@ -210,6 +235,7 @@ fiFI("Lisää uusi %s taulukon loppuun.")
|
|||
huHU("Új %s hozzáfűzése a táblázat végéhez")
|
||||
plPL("Dodaje nowy %s na końcu tabeli.")
|
||||
ruRU("Добавить новый %s в конце таблицы.")
|
||||
zhTW("在表格末尾插入新的 %s")
|
||||
|
||||
T_("Duplicate current table %s.")
|
||||
deDE("Neuen %s in die Tabelle am Ende einfügen")
|
||||
|
|
@ -218,6 +244,7 @@ fiFI("Kahdenna tämänhetkinen taulukko %s.")
|
|||
huHU("Az aktuális táblázat megkettőzése")
|
||||
plPL("Utwórz duplikat aktualnej tabeli %s.")
|
||||
ruRU("Дублировать текущий %s таблицы.")
|
||||
zhTW("複製目前表格 %s.")
|
||||
|
||||
T_("Edit active %s.")
|
||||
deDE("Aktuellen %s bearbeiten")
|
||||
|
|
@ -226,6 +253,7 @@ fiFI("Muokkaa aktiivista %s.")
|
|||
huHU("Az aktuális %s szerkesztése")
|
||||
plPL("Edytuje aktualny %s.")
|
||||
ruRU("Редактировать активный %s.")
|
||||
zhTW("編輯活動 %s")
|
||||
|
||||
T_("Delete active %s.")
|
||||
deDE("Aktuellen %s löschen")
|
||||
|
|
@ -234,6 +262,7 @@ fiFI("Poista aktiivinen %s.")
|
|||
huHU("Az aktív %s törlése")
|
||||
plPL("Usuń aktualny %s.")
|
||||
ruRU("Удалить активный %s.")
|
||||
zhTW("刪除活動 %s")
|
||||
|
||||
T_("Select all")
|
||||
deDE("Alle auswählen")
|
||||
|
|
@ -242,6 +271,7 @@ fiFI("Valitse kaikki")
|
|||
huHU("Minden kiválasztása")
|
||||
plPL("Zaznacz wszystkie")
|
||||
ruRU("Выделить всё")
|
||||
zhTW("全選")
|
||||
|
||||
T_("Select all table rows")
|
||||
deDE("Alle Reihen auswählen")
|
||||
|
|
@ -250,6 +280,7 @@ fiFI("Valitse kaikki taulukon rivit")
|
|||
huHU("Az összes sor kijelölése")
|
||||
plPL("Zaznacz wszystkie wiersze tabeli")
|
||||
ruRU("Выделить все ряды таблицы")
|
||||
zhTW("全選表格列")
|
||||
|
||||
T_("Columns")
|
||||
deDE("Spalten")
|
||||
|
|
@ -258,6 +289,7 @@ fiFI("Sarakkeet")
|
|||
huHU("Oszlopok")
|
||||
plPL("Kolumny")
|
||||
ruRU("Колонки")
|
||||
zhTW("")
|
||||
|
||||
T_("Copy")
|
||||
deDE("Kopieren")
|
||||
|
|
@ -266,6 +298,7 @@ fiFI("Kopioi")
|
|||
huHU("Másolás")
|
||||
plPL("Kopiuj")
|
||||
ruRU("Копировать")
|
||||
zhTW("複製")
|
||||
|
||||
T_("Cut")
|
||||
deDE("Ausschneiden")
|
||||
|
|
@ -274,6 +307,7 @@ fiFI("Leikkaa")
|
|||
huHU("Kivágás")
|
||||
plPL("Wytnij")
|
||||
ruRU("Вырезать")
|
||||
zhTW("剪下")
|
||||
|
||||
T_("Paste")
|
||||
deDE("Einfügen")
|
||||
|
|
@ -282,6 +316,7 @@ fiFI("Liitä")
|
|||
huHU("Beillesztés")
|
||||
plPL("Wklej")
|
||||
ruRU("Вставить")
|
||||
zhTW("貼上")
|
||||
|
||||
T_("Paste as")
|
||||
deDE("Einfügen als")
|
||||
|
|
@ -290,6 +325,7 @@ fiFI("Liitä nimellä")
|
|||
huHU("Beillesztés másként")
|
||||
plPL("Wklej jako")
|
||||
ruRU("Вставить как")
|
||||
zhTW("")
|
||||
|
||||
T_("appended")
|
||||
deDE("anhängen")
|
||||
|
|
@ -298,6 +334,7 @@ fiFI("lisätty loppuun")
|
|||
huHU("hozzáfűzve")
|
||||
plPL("dodane")
|
||||
ruRU("добавлено")
|
||||
zhTW("")
|
||||
|
||||
T_("inserted")
|
||||
deDE("einfügen")
|
||||
|
|
@ -306,6 +343,7 @@ fiFI("lisätty väliin")
|
|||
huHU("beszúrva")
|
||||
plPL("wstawione")
|
||||
ruRU("вставлено")
|
||||
zhTW("")
|
||||
|
||||
T_("Moving selection (%d %s) before row %d")
|
||||
deDE("Verschieben der Auswahl (%d %s) vor Reihe %d")
|
||||
|
|
@ -315,6 +353,7 @@ huHU("Kijelölés mozgatása (%d %s) a %d. sor elé")
|
|||
plPL("Przenoszenie selekcji (%d %s) przed %d wiersz")
|
||||
ruRU("Переместить отмеченное (%d %s) до строки "
|
||||
"%d")
|
||||
zhTW("")
|
||||
|
||||
T_("rows")
|
||||
deDE("Reihen")
|
||||
|
|
@ -323,6 +362,7 @@ fiFI("rivit")
|
|||
huHU("sorok")
|
||||
plPL("wierszy")
|
||||
ruRU("строк")
|
||||
zhTW("")
|
||||
|
||||
T_("Moving row %d before row %d")
|
||||
deDE("Verschieben der Reihe %d vor Reihe %d")
|
||||
|
|
@ -331,6 +371,7 @@ fiFI("Siirtää riviä %d ennen riviä %d")
|
|||
huHU("%d. sor mozgatása %d. sor elé")
|
||||
plPL("Przenoszenie wiersza %d przed wiersz %d")
|
||||
ruRU("Переместить строку %d до строки %d")
|
||||
zhTW("")
|
||||
|
||||
T_("Moving %d %s before row %d")
|
||||
deDE("Verschieben %d %s vor Reihe %d")
|
||||
|
|
@ -339,6 +380,7 @@ fiFI("Siirtää %d %s ennen riviä %d")
|
|||
huHU("%d %s mozgatása a %d. sor elé")
|
||||
plPL("Przenoszenie %d %s przed wiersz %d")
|
||||
ruRU("Переместить %d %s до строки %d")
|
||||
zhTW("")
|
||||
|
||||
T_("cell")
|
||||
deDE("Zelle")
|
||||
|
|
@ -347,6 +389,7 @@ fiFI("solu")
|
|||
huHU("cella")
|
||||
plPL("komórki")
|
||||
ruRU("ячейка")
|
||||
zhTW("")
|
||||
|
||||
T_("cells")
|
||||
deDE("Zellen")
|
||||
|
|
@ -355,9 +398,7 @@ fiFI("solut")
|
|||
huHU("cellák")
|
||||
plPL("komórek")
|
||||
ruRU("ячейки")
|
||||
|
||||
|
||||
// Obsolete
|
||||
zhTW("")
|
||||
|
||||
T_("Do you really want to delete selected %s ?")
|
||||
deDE("Möchten sie wirklich die ausgewählte %s löschen?")
|
||||
|
|
@ -367,6 +408,10 @@ huHU("Biztosan töröljük a kijelölt %s ?")
|
|||
plPL("Czy na pewno chcesz usunąć zaznaczone %s ?")
|
||||
ruRU("Вы действительно хотите удалить выделенный "
|
||||
"%s?")
|
||||
zhTW("")
|
||||
|
||||
|
||||
// Obsolete
|
||||
|
||||
T_("Swap %s with previous thus moving it up.")
|
||||
deDE("Vertauschen der %s mit dem Vorgänger zum Aufwärtsbewegen.")
|
||||
|
|
@ -376,6 +421,7 @@ huHU("%s felcserélése az előzővel - felfelé mozgatás")
|
|||
plPL("Zamień %s z poprzednim przesuwając go do góry.")
|
||||
ruRU("Поменять местами %s с предыдущим, подвинув "
|
||||
"вверх.")
|
||||
zhTW("將%s與前面換位上移之")
|
||||
|
||||
T_("Swap %s with next thus moving it down.")
|
||||
deDE("Vertauschen der %s mit dem Nachfolger zum Abwärtsbewegen")
|
||||
|
|
@ -385,6 +431,7 @@ huHU("%s felcserélése a következővel - lefelé mozgatás")
|
|||
plPL("Zamień %s z następnym przesuwając go w dół.")
|
||||
ruRU("Поменять местами %s со следующим, подвинув "
|
||||
"вниз.")
|
||||
zhTW("將%s與後面換位下移之")
|
||||
|
||||
T_("Find")
|
||||
deDE("Suchen")
|
||||
|
|
@ -393,6 +440,7 @@ fiFI("Etsi")
|
|||
huHU("Keresés")
|
||||
plPL("Znajdź")
|
||||
ruRU("Найти")
|
||||
zhTW("")
|
||||
|
||||
T_("Find options")
|
||||
deDE("Suche Optionen")
|
||||
|
|
@ -401,3 +449,4 @@ fiFI("Haku optiot")
|
|||
huHU("Keresés beállításai")
|
||||
plPL("Opcje szukania")
|
||||
ruRU("Опции поиска")
|
||||
zhTW("")
|
||||
|
|
|
|||
|
|
@ -34,3 +34,4 @@ file
|
|||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
|
|
|
|||
|
|
@ -15,3 +15,4 @@ custom() "idl",
|
|||
"midl /newtlb $(!/I) /h \"$(DIR)/$(TITLE)_idl.h\" /iid \"$(DIR)/$(TITLE"
|
||||
")_idl.cpp\" /tlb \"$(DIR)/$(TITLE).tlb\" \"$(PATH)\"\r\n",
|
||||
"$(DIR)/$(TITLE)_idl.h\r\n$(DIR)/$(TITLE).tlb\r\n";
|
||||
|
||||
|
|
|
|||
|
|
@ -13,6 +13,7 @@ roRO("Eroare la încărcare bibliotecii client bază de date OCI7")
|
|||
ruRU("")
|
||||
trTR("Hata: OCI7 Oracle veritabanı istemci kütüphanesi (Oracle database client "
|
||||
"library) yüklenemedi.")
|
||||
zhTW("")
|
||||
|
||||
T_("Connecting to server")
|
||||
csCZ("Navazuji spojení")
|
||||
|
|
@ -23,6 +24,7 @@ huHU("Kapcsolódás a szerverhez")
|
|||
roRO("Se onectează la server")
|
||||
ruRU("Подключение к серверу")
|
||||
trTR("Sunucuya bağlanıyor")
|
||||
zhTW("")
|
||||
|
||||
T_("Connecting to database server")
|
||||
csCZ("Spojuji s databází")
|
||||
|
|
@ -33,6 +35,7 @@ huHU("Kapcsolódás az adatbázis-szerverhez")
|
|||
roRO("Se conectează la server bază de date")
|
||||
ruRU("Подключение к SQL серверу")
|
||||
trTR("Veritabanı sunucusuna bağlanıyor")
|
||||
zhTW("")
|
||||
|
||||
|
||||
// Oci8.cpp
|
||||
|
|
@ -47,6 +50,7 @@ roRO("Eroare la rularea bibliotecii dinamice de conectare la OCI8")
|
|||
ruRU("")
|
||||
trTR("Hata: OCI8 Oracle connection dynamic library'sinin calıştırılması "
|
||||
"sırasında bir hata meydana geldi.")
|
||||
zhTW("")
|
||||
|
||||
T_("Unknown error.")
|
||||
csCZ("Neznámá chyba.")
|
||||
|
|
@ -57,6 +61,7 @@ huHU("Ismeretlen hiba.")
|
|||
roRO("Eroare necunoscută.")
|
||||
ruRU("Неизвестная ошибка")
|
||||
trTR("Bilinmeyen hata.")
|
||||
zhTW("")
|
||||
|
||||
T_("(unknown error)")
|
||||
csCZ("(neznámá chyba)")
|
||||
|
|
@ -67,6 +72,7 @@ huHU("(ismeretlen hiba)")
|
|||
roRO("(eroare necunoscută)")
|
||||
ruRU("(неизвестная ошибка)")
|
||||
trTR("(bilinmeyen hata)")
|
||||
zhTW("")
|
||||
|
||||
T_("<not supplied>")
|
||||
csCZ("<není zadáno>")
|
||||
|
|
@ -77,6 +83,7 @@ huHU("<nincs megadva>")
|
|||
roRO("<nu a fost specificat>")
|
||||
ruRU("<не поддерживается>")
|
||||
trTR("<sağlanmamış>")
|
||||
zhTW("")
|
||||
|
||||
T_("Error initializing connection")
|
||||
csCZ("Chyba při navazování spojení")
|
||||
|
|
@ -87,6 +94,7 @@ huHU("Hiba a kapcsolat inicializálása közben")
|
|||
roRO("Eroare la inițializarea conexiunii")
|
||||
ruRU("Ошибка запуска соединения")
|
||||
trTR("Bağlantı hatası")
|
||||
zhTW("")
|
||||
|
||||
T_("OCI8 connection")
|
||||
csCZ("Spojení OCI8")
|
||||
|
|
@ -97,6 +105,7 @@ huHU("OCI8 kapcsolat")
|
|||
roRO("Conexiune OCI8")
|
||||
ruRU("")
|
||||
trTR("OCI8 bağlantısı")
|
||||
zhTW("")
|
||||
|
||||
T_("Closing reference cursor")
|
||||
csCZ("Zavírám referenční kurzor")
|
||||
|
|
@ -107,6 +116,7 @@ huHU("Referencia-kurzor lezárása")
|
|||
roRO("Se închide cursorul de referință")
|
||||
ruRU("Закрыть курсор связи")
|
||||
trTR("Closing reference cursor")
|
||||
zhTW("")
|
||||
|
||||
T_("Error initializing OCI8 library (%s)")
|
||||
csCZ("Chyba při inicializaci OCI8")
|
||||
|
|
@ -117,6 +127,7 @@ huHU("Hiba az OCI8 library inicializálása közben (%s)")
|
|||
roRO("Eroare la inițializarea bibliotecii OCI8 (%s)")
|
||||
ruRU("")
|
||||
trTR("")
|
||||
zhTW("")
|
||||
|
||||
T_("Connecting to Oracle database.")
|
||||
csCZ("Připojování k databázi Oracle")
|
||||
|
|
@ -127,6 +138,7 @@ huHU("Kapcsolódás Oracle adatbázishoz.")
|
|||
roRO("Conectare la baza de date Oracle")
|
||||
ruRU("Подключение к базе данных Oracle")
|
||||
trTR("Oracle veritabanına bağlanılıyor...")
|
||||
zhTW("")
|
||||
|
||||
T_("Error loading OCI8 Oracle connection dynamic library.")
|
||||
csCZ("Nelze nalézt dynamickou knihovnu OCI8 pro spojení s Oracle")
|
||||
|
|
@ -137,6 +149,7 @@ huHU("Hiba az OCI8 Oracle connection dynamic library betöltésekor.")
|
|||
roRO("Eroare la încărcare bibliotecii client bază de date OCI8")
|
||||
ruRU("")
|
||||
trTR("")
|
||||
zhTW("")
|
||||
|
||||
T_("Connecting to server '%s'")
|
||||
csCZ("Připojování k serveru '%s'")
|
||||
|
|
@ -147,6 +160,7 @@ huHU("Kapcsolódás a következő szerverhez: '%s'")
|
|||
roRO("Conectare la server '%s'")
|
||||
ruRU("Подключение к серверу %s")
|
||||
trTR("%s sunucusuna bağlanılıyor.")
|
||||
zhTW("")
|
||||
|
||||
|
||||
// Obsolete
|
||||
|
|
@ -160,3 +174,4 @@ huHU("Hiba az OCI8 library inicializálásakor.")
|
|||
roRO("Eroare la inițializarea bibliotecii OCI8")
|
||||
ruRU("")
|
||||
trTR("OCI8 kütüphanesinin başlatılması sırasında bir hata meytdana geldi.")
|
||||
zhTW("")
|
||||
|
|
|
|||
|
|
@ -3,6 +3,7 @@
|
|||
NAMESPACE_UPP
|
||||
|
||||
#define LDUMP(x) // DUMP(x)
|
||||
#define LLOG(x) // LOG(x)
|
||||
|
||||
#define PDF_COMPRESS
|
||||
#define USE_TTF
|
||||
|
|
@ -288,8 +289,6 @@ PdfDraw::OutlineInfo PdfDraw::GetOutlineInfo(Font fnt)
|
|||
String data = LoadFile(fn);
|
||||
TTFReader ttf;
|
||||
if(ttf.Open(data, false, true)) {
|
||||
LOG("TTF!");
|
||||
DUMP(ttf.post.italicAngle);
|
||||
of.ttf = true;
|
||||
of.sitalic = ttf.post.italicAngle == 0 && fnt.IsItalic();
|
||||
}
|
||||
|
|
@ -745,7 +744,7 @@ String PdfDraw::Finish()
|
|||
|
||||
int size = GetFontData(sd.GetHandle(), 0, 0, NULL, 0);
|
||||
if(size == GDI_ERROR) {
|
||||
RLOG("PdfDraw::Finish: GDI_ERROR on font " << pdffont.GetKey(i));
|
||||
LLOG("PdfDraw::Finish: GDI_ERROR on font " << pdffont.GetKey(i));
|
||||
return Null;
|
||||
}
|
||||
StringBuffer fontbuffer(size);
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -10,3 +10,4 @@ file
|
|||
DlgCalc.cpp,
|
||||
DlgCalc.lay,
|
||||
CalcHelp.cpp;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,37 +1,37 @@
|
|||
uses
|
||||
Web;
|
||||
|
||||
acceptflags
|
||||
NOSSL;
|
||||
|
||||
library(WIN32 !NOSSL !SHARED) "out32\\ssleay32 out32\\libeay32";
|
||||
|
||||
library(WIN32) "gdi32";
|
||||
|
||||
library(LINUX !NOSSL) "crypto ssl";
|
||||
|
||||
library(WIN32 !NOSSL SHARED) "out32dll\\ssleay32.lib out32dll\\libeay32.lib ";
|
||||
|
||||
link(WIN32 DEBUG MSC SO) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC SO) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 DEBUG MSC71 SO) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC71 SO) "/nodefaultib:libc";
|
||||
|
||||
link(WIN32 DEBUG MSC) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 DEBUG MSC71) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC71) "/nodefaultlib:libc";
|
||||
|
||||
file
|
||||
WebSSL.h,
|
||||
util.cpp,
|
||||
Info readonly separator,
|
||||
Copying,
|
||||
Copying-plain,
|
||||
Authors;
|
||||
uses
|
||||
Web;
|
||||
|
||||
acceptflags
|
||||
NOSSL;
|
||||
|
||||
library(WIN32 !NOSSL !SHARED) "out32\\ssleay32 out32\\libeay32";
|
||||
|
||||
library(WIN32) "gdi32";
|
||||
|
||||
library(LINUX !NOSSL) "crypto ssl";
|
||||
|
||||
library(WIN32 !NOSSL SHARED) "out32dll\\ssleay32.lib out32dll\\libeay32.lib ";
|
||||
|
||||
link(WIN32 DEBUG MSC SO) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC SO) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 DEBUG MSC71 SO) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC71 SO) "/nodefaultib:libc";
|
||||
|
||||
link(WIN32 DEBUG MSC) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 DEBUG MSC71) "/nodefaultlib:libc";
|
||||
|
||||
link(WIN32 MT MSC71) "/nodefaultlib:libc";
|
||||
|
||||
file
|
||||
WebSSL.h,
|
||||
util.cpp,
|
||||
Info readonly separator,
|
||||
Copying,
|
||||
Copying-plain,
|
||||
Authors;
|
||||
|
|
|
|||
|
|
@ -19,6 +19,7 @@ srSP("")
|
|||
trTR("Eğer otomatik olarak yönlendirlmediyseniz lütfen %s bağlantısını "
|
||||
"kullanın.")
|
||||
zhCN("如果没有自动重定向,请使用%s.")
|
||||
zhTW("")
|
||||
|
||||
T_("this link")
|
||||
csCZ("tento odkaz")
|
||||
|
|
@ -34,6 +35,7 @@ ruRU("эту ссылку")
|
|||
srSP("")
|
||||
trTR("bu bağlantı")
|
||||
zhCN("本链接")
|
||||
zhTW("")
|
||||
|
||||
T_("Redirection to another web address")
|
||||
csCZ("Přesměrování na jinou adresu")
|
||||
|
|
@ -49,6 +51,7 @@ ruRU("Перенаправление на другой веб адрес")
|
|||
srSP("")
|
||||
trTR("başka bir ağ adresine yönlendiriliyor")
|
||||
zhCN("重定向到其他web地址")
|
||||
zhTW("")
|
||||
|
||||
T_("... (total length: %d bytes)")
|
||||
csCZ("... (celková délka: %d bytů)")
|
||||
|
|
@ -64,6 +67,7 @@ ruRU("... (полный размер: %d байт)")
|
|||
srSP("")
|
||||
trTR("... (toplam boyut: %d byte)")
|
||||
zhCN("... (总长: %d 字节)")
|
||||
zhTW("")
|
||||
|
||||
T_("The web server is unable to satisfy your request:\n<p>\n")
|
||||
csCZ("Internetový server nebyl schopen vyřídit požadavek:\n<p>\n")
|
||||
|
|
@ -81,6 +85,7 @@ ruRU("Этот веб сервер не может удовлетворить "
|
|||
srSP("")
|
||||
trTR("Ağ sunucusu isteğinizi yerine getiremiyor:\n<p>\n")
|
||||
zhCN("web服务器不支持您的请求:\n<p>\n")
|
||||
zhTW("")
|
||||
|
||||
T_("Reason:")
|
||||
csCZ("Důvod chyby: ")
|
||||
|
|
@ -96,6 +101,7 @@ ruRU("Причина:")
|
|||
srSP("")
|
||||
trTR("Sebep:")
|
||||
zhCN("原因:")
|
||||
zhTW("")
|
||||
|
||||
T_("Detailed query data:")
|
||||
csCZ("Detailní informace o dotazu:")
|
||||
|
|
@ -111,6 +117,7 @@ ruRU("Детали запроса:")
|
|||
srSP("")
|
||||
trTR("Detaylı sorgulama verileri:")
|
||||
zhCN("详细查询数据")
|
||||
zhTW("")
|
||||
|
||||
T_("Web server error")
|
||||
csCZ("Chyba internetového serveru")
|
||||
|
|
@ -126,6 +133,7 @@ ruRU("Ошибка веб сервера")
|
|||
srSP("")
|
||||
trTR("Sunucu hatası")
|
||||
zhCN("Web服务器错误")
|
||||
zhTW("")
|
||||
|
||||
|
||||
// httpcli.cpp
|
||||
|
|
@ -145,6 +153,7 @@ ruRU("%s:%d превишен интервал ожидания при получ
|
|||
srSP("")
|
||||
trTR("%s:%d: Üstbilgi alışverişi zaman aşımına uğradı.")
|
||||
zhCN("%s:%d 接收头超时")
|
||||
zhTW("")
|
||||
|
||||
T_("%s:%d: connecting to host timed out")
|
||||
csCZ("%s:%d: vypršel časový limit pro připojení k hostiteli")
|
||||
|
|
@ -161,6 +170,7 @@ ruRU("%s:%d превишен интервал ожидания при подкл
|
|||
srSP("")
|
||||
trTR("%s:%d: Sunucu bağlantısı zaman aşımına uğradı")
|
||||
zhCN("%s:%d: 连接到主机超时")
|
||||
zhTW("")
|
||||
|
||||
T_("%s:%d: timed out sending request to server")
|
||||
csCZ("%s:%d: vypršel časový limit při odesílání požadavku")
|
||||
|
|
@ -176,6 +186,7 @@ ruRU("%s:%d: таймаут отправки запроса на сервер")
|
|||
srSP("")
|
||||
trTR("%s:%d: İstek zaman aşımına uğradı")
|
||||
zhCN("%s:%d: 发送请求到服务器超时")
|
||||
zhTW("")
|
||||
|
||||
T_("%s:%d: invalid server response: %s")
|
||||
csCZ("%s:%d: neplatná odezva ze serveru: %s")
|
||||
|
|
@ -191,6 +202,7 @@ ruRU("%s:%d: неправильный ответ сервера: %s")
|
|||
srSP("")
|
||||
trTR("%s:%d: Sunucudan gelen yanıt geçersiz")
|
||||
zhCN("%s:%d: 无效服务器反应: %s")
|
||||
zhTW("")
|
||||
|
||||
T_("%s:%d: maximum data length exceeded (%d B)")
|
||||
csCZ("%s:%d: byla překročena maximální délka dat (%d B)")
|
||||
|
|
@ -207,6 +219,7 @@ ruRU("%s:%d: превышен максимальный размер данных
|
|||
srSP("")
|
||||
trTR("%s:%d: maksimum veri boyutu aşıldı (%d B)")
|
||||
zhCN("%s:%d: 超出了最大数据长度(%d B)")
|
||||
zhTW("")
|
||||
|
||||
T_("%s:%d: maximum header length exceeded (%d B)")
|
||||
csCZ("%s:%d: byla překročena maximální délka hlaviček (%d B)")
|
||||
|
|
@ -223,6 +236,7 @@ ruRU("%s:%d: превышен максимальный размер заголо
|
|||
srSP("")
|
||||
trTR("%s:%d:Maksimum üstbilgi boyutu aşıldı (%d B)")
|
||||
zhCN("%s:%d: 超出了最大头长度(%d B)")
|
||||
zhTW("")
|
||||
|
||||
T_("%s:%d: timed out when receiving server response")
|
||||
csCZ("%s:%d: vypršel časový limit při načítání odpovědi")
|
||||
|
|
@ -238,6 +252,7 @@ ruRU("%s:%d: таймаут при приёме ответа от сервера
|
|||
srSP("")
|
||||
trTR("%s:%d: Sunucudan yanıt beklenirken zaman aşımı meydana geldi")
|
||||
zhCN("%s:%d: 接收服务器反应时超时")
|
||||
zhTW("")
|
||||
|
||||
T_("Maximum content size exceeded: %d")
|
||||
csCZ("Překročena maximální povolená délka datového obsahu: %d")
|
||||
|
|
@ -254,6 +269,7 @@ ruRU("Превышен максимальный размер содержимо
|
|||
srSP("")
|
||||
trTR("Maksimum içerik boyutu aşıldı: %d")
|
||||
zhCN("最大内容长度超出:%d")
|
||||
zhTW("")
|
||||
|
||||
T_("Partial input: %d out of %d")
|
||||
csCZ("Přijata neúplná data: %d z %d")
|
||||
|
|
@ -269,6 +285,7 @@ ruRU("Частичный ввод: %d из %d")
|
|||
srSP("")
|
||||
trTR("Kısmi girdi: %d/%d")
|
||||
zhCN("部分输入: %d out of %d")
|
||||
zhTW("")
|
||||
|
||||
|
||||
// smtp.cpp
|
||||
|
|
@ -287,6 +304,7 @@ ruRU("Ошибка связи. Таймаут.")
|
|||
srSP("")
|
||||
trTR("Bağlantı başarısız: Zaman aşımı.")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
||||
T_("Error writing data to socket: communication port closed.")
|
||||
csCZ("Chyba při zápisu dat do socketu: komunikační kanál byl uzavřen.")
|
||||
|
|
@ -303,6 +321,7 @@ ruRU("Ошибка посылки данных в сокет: порт связ
|
|||
srSP("")
|
||||
trTR("Sokete yazma hatası: bağlantı kesildi.")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
||||
T_("Error writing data to socket, error code: ")
|
||||
csCZ("Chyba při zápisu dat do socketu, kód chyby: ")
|
||||
|
|
@ -318,6 +337,7 @@ ruRU("Ошибка посылки данных в сокет: код оибки:
|
|||
srSP("")
|
||||
trTR("Sokete yazma hatası meydana geldi. Hata kodu: ")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
||||
T_("Error reading data from socket: commuication port closed.")
|
||||
csCZ("Chyba při čtení dat ze socketu: komunikační kanál byl uzavřen.")
|
||||
|
|
@ -334,6 +354,7 @@ ruRU("Ошибка чтения данных из сокета: порт свя
|
|||
srSP("")
|
||||
trTR("Soket okuma hatası: bağlantı kesildi.")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
||||
T_("Host not set.")
|
||||
csCZ("Hostitel není zadán.")
|
||||
|
|
@ -349,6 +370,7 @@ ruRU("Сервер не определен")
|
|||
srSP("")
|
||||
trTR("Host hazır değil.")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
||||
T_("Recipient not set.")
|
||||
csCZ("Není zadán příjemce.")
|
||||
|
|
@ -364,6 +386,7 @@ ruRU("Получатель не определен")
|
|||
srSP("")
|
||||
trTR("Alıcı hazır değil.")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
||||
|
||||
// sproc.cpp
|
||||
|
|
@ -382,6 +405,7 @@ ruRU("ошибка pipe(); код ошибки = %d")
|
|||
srSP("")
|
||||
trTR("pipe() hatası; hata kodu = %d")
|
||||
zhCN("pipe() error; error code = %d")
|
||||
zhTW("")
|
||||
|
||||
T_("fork() error; error code = %d")
|
||||
csCZ("chyba fork(); kód chyby = %d")
|
||||
|
|
@ -397,6 +421,7 @@ ruRU("ошибка fork(); код ошибки = %d")
|
|||
srSP("")
|
||||
trTR("fork() hatası; hata kodu = %d")
|
||||
zhCN("fork() error; error code = %d")
|
||||
zhTW("")
|
||||
|
||||
T_("Opening host '%s' / port %d failed, error = %s")
|
||||
csCZ("Připojování k hostiteli '%s' / port %d selhalo, chyba = %s")
|
||||
|
|
@ -414,6 +439,7 @@ srSP("")
|
|||
trTR("'%s' hostuna '%d' portundan bağlanma girişi başarısız oldu. Hata "
|
||||
"= %s")
|
||||
zhCN("Opening host '%s' / port %d failed, error = %s")
|
||||
zhTW("")
|
||||
|
||||
T_("Error running process: %s\nCommand: %s")
|
||||
csCZ("Chyba při spouštění procesu: %s\nPříkaz: %s")
|
||||
|
|
@ -431,6 +457,7 @@ srSP("")
|
|||
trTR("'%s' işleminin çalıştırılması sırasında hata oluştu\nKomut: "
|
||||
"%s")
|
||||
zhCN("运行进城错误:%s\n命令: %s")
|
||||
zhTW("")
|
||||
|
||||
T_("Communication error; process = %s")
|
||||
csCZ("Chyba spojení; proces = %s")
|
||||
|
|
@ -446,6 +473,7 @@ ruRU("Ошибка коммуникации; процесс = %s")
|
|||
srSP("")
|
||||
trTR("İletişim hatası; işlem = %s")
|
||||
zhCN("通信错误; 进城 = %s")
|
||||
zhTW("")
|
||||
|
||||
T_("Missing command line (host = %s).")
|
||||
csCZ("Chybí příkazová řádka (hostitel = %s).")
|
||||
|
|
@ -461,6 +489,7 @@ ruRU("Не указана командная строка (хост = %s)")
|
|||
srSP("")
|
||||
trTR("Eksik komut satırı (Host = %s).")
|
||||
zhCN("缺少命令行(主机 = %s).")
|
||||
zhTW("")
|
||||
|
||||
|
||||
// Obsolete
|
||||
|
|
@ -479,3 +508,4 @@ ruRU("Не могу открыть сокет %s:%d: %s")
|
|||
srSP("")
|
||||
trTR("Hata: Soket açılamadı. %s:%d: %s")
|
||||
zhCN("")
|
||||
zhTW("")
|
||||
|
|
|
|||
|
|
@ -292,7 +292,7 @@ HtmlTag HtmlSelect(String name) {
|
|||
return HtmlTag("SELECT").Name(name);
|
||||
}
|
||||
|
||||
Htmls HtmlOption(const Value& val, const char *text, bool selected)
|
||||
Htmls HtmlOption(Value val, const char *text, bool selected)
|
||||
{
|
||||
HtmlTag option("OPTION");
|
||||
option.Data(val);
|
||||
|
|
|
|||
|
|
@ -111,11 +111,9 @@ static String SendRecv(Socket& socket, const String& s, String *transcript = 0,
|
|||
}
|
||||
}
|
||||
else if(amount == 0)
|
||||
throw Exc(t_("Error reading data from socket: commuication port closed."));
|
||||
else if((err = Socket::GetErrorCode()) != SOCKERR(EWOULDBLOCK)) {
|
||||
String str;
|
||||
throw Exc(str << "Chyba pøi ètení dat ze socketu, kód chyby: " << err);
|
||||
}
|
||||
throw Exc(t_("Error reading data from socket: communication port closed."));
|
||||
else if((err = Socket::GetErrorCode()) != SOCKERR(EWOULDBLOCK))
|
||||
throw Exc(NFormat(t_("Error reading socket, error code: %s"), err));
|
||||
else
|
||||
Sleep(100);
|
||||
}
|
||||
|
|
@ -205,6 +203,21 @@ bool SmtpMail::Send()
|
|||
org << ipaddr;
|
||||
|
||||
SendRecvOK(socket, "HELO " + org + "\r\n", trans_ptr);
|
||||
if(!IsNull(auth_user)) {
|
||||
String ans = SendRecv(socket, "AUTH LOGIN\r\n", trans_ptr);
|
||||
while(ans[0] != '2')
|
||||
if(ans[0] == '3' && ans[1] == '3' && ans[2] == '4' && ans[3] == ' ') {
|
||||
String param = Base64Decode(ans.GetIter(4), ans.End());
|
||||
if(param == "Username:")
|
||||
ans = SendRecv(socket, Base64Encode(auth_user) + "\r\n", trans_ptr);
|
||||
else if(param == "Password:")
|
||||
ans = SendRecv(socket, Base64Encode(auth_pwd) + "\r\n", trans_ptr);
|
||||
else
|
||||
throw Exc(ans);
|
||||
}
|
||||
else
|
||||
throw Exc(ans);
|
||||
}
|
||||
SendRecvOK(socket, "MAIL FROM:<" + from + ">\r\n", trans_ptr);
|
||||
for(int i = 0; i < to.GetCount(); i++)
|
||||
SendRecv(socket, "RCPT TO:<" + to[i] + ">\r\n", trans_ptr);
|
||||
|
|
|
|||
|
|
@ -18,6 +18,7 @@ public:
|
|||
SmtpMail& Transcript(bool t = true) { transcript = t; return *this; }
|
||||
SmtpMail& AttachFile(const char *filename, const char *mime = 0);
|
||||
SmtpMail& Attach(const char *name, String data, const char *mime = 0);
|
||||
SmtpMail& Auth(String user, String pwd) { auth_user = user; auth_pwd = pwd; return *this; }
|
||||
|
||||
bool Send();
|
||||
|
||||
|
|
@ -35,6 +36,8 @@ private:
|
|||
|
||||
String host;
|
||||
int port; // default = 25
|
||||
String auth_user;
|
||||
String auth_pwd;
|
||||
String from;
|
||||
Vector<String> to;
|
||||
Vector<char> as;
|
||||
|
|
|
|||
|
|
@ -1,6 +1,7 @@
|
|||
description "Visual style for ToolBar and MenuBar";
|
||||
|
||||
file
|
||||
BlueBar.h,
|
||||
BlueSkin.iml,
|
||||
BlueSkin.cpp;
|
||||
description "Visual style for ToolBar and MenuBar";
|
||||
|
||||
file
|
||||
BlueBar.h,
|
||||
BlueSkin.iml,
|
||||
BlueSkin.cpp;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,92 +1,92 @@
|
|||
#include "ide.h"
|
||||
|
||||
void CopyFolder(const char *_dst, const char *_src, Index<String>& used, bool all)
|
||||
{
|
||||
String dst = NativePath(_dst);
|
||||
String src = NativePath(_src);
|
||||
DUMP(_dst);
|
||||
DUMP(dst);
|
||||
DUMP(src);
|
||||
DUMP(_src);
|
||||
if(dst == src)
|
||||
return;
|
||||
FindFile ff(AppendFileName(src, "*"));
|
||||
bool realize = true;
|
||||
while(ff) {
|
||||
String s = AppendFileName(src, ff.GetName());
|
||||
String d = AppendFileName(dst, ff.GetName());
|
||||
DUMP(s);
|
||||
DUMP(d);
|
||||
if(ff.IsFolder())
|
||||
CopyFolder(d, s, used, all);
|
||||
else
|
||||
if(ff.IsFile() && (all || used.Find(s) >= 0)) {
|
||||
if(realize) {
|
||||
RealizeDirectory(dst);
|
||||
realize = false;
|
||||
}
|
||||
DUMP(d);
|
||||
SaveFile(d, LoadFile(s));
|
||||
SetFileTime(d, ff.GetLastWriteTime());
|
||||
}
|
||||
ff.Next();
|
||||
}
|
||||
}
|
||||
|
||||
void Ide::ExportProject() {
|
||||
WithExportLayout<TopWindow> dlg;
|
||||
CtrlLayoutOKCancel(dlg, "Export project");
|
||||
FrameRight<Button> dsb;
|
||||
DirSel(dlg.outdir, dsb);
|
||||
CtrlRetriever r;
|
||||
if(IsNull(export_name))
|
||||
export_name = main;
|
||||
r(dlg.outdir, export_outdir);
|
||||
r(dlg.name, export_name);
|
||||
r(dlg.usedonly, export_usedonly);
|
||||
if(dlg.Execute() != IDOK)
|
||||
return;
|
||||
r.Retrieve();
|
||||
SaveFile(false);
|
||||
::Workspace wspc;
|
||||
wspc.Scan(main);
|
||||
Index<String> used;
|
||||
HdependClearDependencies();
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
const Package& p = wspc.GetPackage(i);
|
||||
String pn = wspc[i];
|
||||
for(int j = 0; j < p.GetCount(); j++) {
|
||||
const Package::File& f = p[j];
|
||||
if(!f.separator) {
|
||||
String p = SourcePath(pn, f);
|
||||
used.FindAdd(p);
|
||||
Vector<String> d = HdependGetDependencies(p);
|
||||
for(int q = 0; q < d.GetCount(); q++)
|
||||
used.FindAdd(d[q]);
|
||||
for(int q = 0; q < f.depends.GetCount(); q++)
|
||||
used.FindAdd(SourcePath(pn, f.depends[q].text));
|
||||
}
|
||||
}
|
||||
used.FindAdd(SourcePath(pn, "init"));
|
||||
}
|
||||
String ep = AppendFileName(export_outdir, export_name);
|
||||
if(FileExists(ep)) {
|
||||
if(!PromptYesNo("There is a [* " + DeQtf(export_name) + "] file in the output directory.&"
|
||||
"Do you want to delete it?")) return;
|
||||
FileDelete(ep);
|
||||
}
|
||||
if(DirectoryExists(ep)) {
|
||||
if(!PromptYesNo("Do you want to replace existing [* " + DeQtf(export_name) + "] export?"))
|
||||
return;
|
||||
DeleteFolderDeep(ep);
|
||||
}
|
||||
|
||||
Progress pi("Exporting project");
|
||||
pi.SetTotal(wspc.GetCount());
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
if(pi.StepCanceled())
|
||||
return;
|
||||
CopyFolder(AppendFileName(ep, wspc[i]), PackageDirectory(wspc[i]), used, !export_usedonly);
|
||||
}
|
||||
SaveMakeFile(AppendFileName(ep, "Makefile"), true);
|
||||
}
|
||||
#include "ide.h"
|
||||
|
||||
bool IsDoc(String s)
|
||||
{
|
||||
s = ToLower(s);
|
||||
return s.Find("readme") >= 0 || s.Find("copying") >= 0 || s.Find("license") >= 0 ||
|
||||
s.Find("authors") >= 0;
|
||||
}
|
||||
|
||||
void CopyFolder(const char *_dst, const char *_src, Index<String>& used, bool all)
|
||||
{
|
||||
String dst = NativePath(_dst);
|
||||
String src = NativePath(_src);
|
||||
if(dst == src)
|
||||
return;
|
||||
FindFile ff(AppendFileName(src, "*"));
|
||||
bool realize = true;
|
||||
while(ff) {
|
||||
String s = AppendFileName(src, ff.GetName());
|
||||
String d = AppendFileName(dst, ff.GetName());
|
||||
if(ff.IsFolder())
|
||||
CopyFolder(d, s, used, all);
|
||||
else
|
||||
if(ff.IsFile() && (all || IsDoc(s) || used.Find(s) >= 0)) {
|
||||
if(realize) {
|
||||
RealizeDirectory(dst);
|
||||
realize = false;
|
||||
}
|
||||
SaveFile(d, LoadFile(s));
|
||||
SetFileTime(d, ff.GetLastWriteTime());
|
||||
}
|
||||
ff.Next();
|
||||
}
|
||||
}
|
||||
|
||||
void Ide::ExportProject() {
|
||||
WithExportLayout<TopWindow> dlg;
|
||||
CtrlLayoutOKCancel(dlg, "Export project");
|
||||
FrameRight<Button> dsb;
|
||||
DirSel(dlg.outdir, dsb);
|
||||
CtrlRetriever r;
|
||||
if(IsNull(export_name))
|
||||
export_name = main;
|
||||
r(dlg.outdir, export_outdir);
|
||||
r(dlg.name, export_name);
|
||||
r(dlg.usedonly, export_usedonly);
|
||||
if(dlg.Execute() != IDOK)
|
||||
return;
|
||||
r.Retrieve();
|
||||
SaveFile(false);
|
||||
::Workspace wspc;
|
||||
wspc.Scan(main);
|
||||
Index<String> used;
|
||||
HdependClearDependencies();
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
const Package& p = wspc.GetPackage(i);
|
||||
String pn = wspc[i];
|
||||
for(int j = 0; j < p.GetCount(); j++) {
|
||||
const Package::File& f = p[j];
|
||||
if(!f.separator) {
|
||||
String p = SourcePath(pn, f);
|
||||
used.FindAdd(p);
|
||||
Vector<String> d = HdependGetDependencies(p);
|
||||
for(int q = 0; q < d.GetCount(); q++)
|
||||
used.FindAdd(d[q]);
|
||||
for(int q = 0; q < f.depends.GetCount(); q++)
|
||||
used.FindAdd(SourcePath(pn, f.depends[q].text));
|
||||
}
|
||||
}
|
||||
used.FindAdd(SourcePath(pn, "init"));
|
||||
}
|
||||
String ep = AppendFileName(export_outdir, export_name);
|
||||
if(FileExists(ep)) {
|
||||
if(!PromptYesNo("There is a [* " + DeQtf(export_name) + "] file in the output directory.&"
|
||||
"Do you want to delete it?")) return;
|
||||
FileDelete(ep);
|
||||
}
|
||||
if(DirectoryExists(ep)) {
|
||||
if(!PromptYesNo("Do you want to replace existing [* " + DeQtf(export_name) + "] export?"))
|
||||
return;
|
||||
DeleteFolderDeep(ep);
|
||||
}
|
||||
|
||||
Progress pi("Exporting project");
|
||||
pi.SetTotal(wspc.GetCount());
|
||||
for(int i = 0; i < wspc.GetCount(); i++) {
|
||||
if(pi.StepCanceled())
|
||||
return;
|
||||
CopyFolder(AppendFileName(ep, wspc[i]), PackageDirectory(wspc[i]), used, !export_usedonly);
|
||||
}
|
||||
SaveMakeFile(AppendFileName(ep, "Makefile"), true);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -208,7 +208,7 @@ void LocalHost::Launch(const char *_cmdline, bool console)
|
|||
PutConsole("Unable to launch " + String(_cmdline));
|
||||
#endif
|
||||
#ifdef PLATFORM_POSIX
|
||||
String script = ConfigFile("console-script-" + AsString(getpid()));
|
||||
String script = ConfigFile("console-script-" + AsString(getpid()) + ".tmp");
|
||||
if(console) {
|
||||
FileStream out(script, FileStream::CREATE, 0777);
|
||||
out << "#!/bin/sh\n"
|
||||
|
|
|
|||
|
|
@ -1,256 +1,256 @@
|
|||
#include "ide.h"
|
||||
|
||||
void AssistEditor::CreateIndex()
|
||||
{
|
||||
searchindex.Clear();
|
||||
Renumber2();
|
||||
indexitem.Clear();
|
||||
if(!assist_active) {
|
||||
indexframe.Show(false);
|
||||
return;
|
||||
}
|
||||
const Index<String>& cppkeywords = CppKeywords();
|
||||
String sop = "operator";
|
||||
String klass;
|
||||
for(int i = 0; i < min(GetLineCount(), 10000); i++) {
|
||||
String l = GetEncodedLine(i, CHARSET_UTF8);
|
||||
int plevel = 0;
|
||||
int tlevel = 0;
|
||||
Color ink = Gray;
|
||||
bool fn = false;
|
||||
bool td = false;
|
||||
if(l[0] > 32) {
|
||||
String nklass, id;
|
||||
try {
|
||||
CParser p(l);
|
||||
if(p.Char('#')) {
|
||||
if(p.Id("define") && p.IsId()) {
|
||||
id = p.ReadId();
|
||||
ink = Magenta;
|
||||
}
|
||||
}
|
||||
else {
|
||||
while(!p.IsEof())
|
||||
if(p.Id("typedef")) {
|
||||
td = true;
|
||||
ink = LtBlue;
|
||||
}
|
||||
else
|
||||
if((p.Id("class") || p.Id("struct") || p.Id("union") || p.Id("enum")) && tlevel == 0 && p.IsId()) {
|
||||
id = p.ReadId();
|
||||
if(p.Char(';'))
|
||||
id.Clear();
|
||||
ink = LtBlue;
|
||||
break;
|
||||
}
|
||||
else
|
||||
if(p.Char('~') && p.IsId())
|
||||
id = '~' + p.ReadId();
|
||||
else
|
||||
if(p.Char2(':', ':') && tlevel == 0)
|
||||
nklass = id;
|
||||
else
|
||||
if(p.IsId() && tlevel == 0) {
|
||||
id = p.ReadId();
|
||||
if(id == sop) {
|
||||
static char oc[] = "<>!^&*+=-%";
|
||||
while(strchr(oc, *p.GetPtr())) {
|
||||
id.Cat(*p.GetPtr());
|
||||
p.SkipTerm();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if(p.Char('(')) {
|
||||
if(plevel == 0) {
|
||||
fn = true;
|
||||
ink = Black;
|
||||
int q = i;
|
||||
for(;;) {
|
||||
if(p.IsEof()) {
|
||||
if(++q >= GetLineCount() || q > i + 6) {
|
||||
id.Clear();
|
||||
break;
|
||||
}
|
||||
l = GetEncodedLine(q, CHARSET_UTF8);
|
||||
p.Set(l);
|
||||
}
|
||||
if(p.Char('{'))
|
||||
break;
|
||||
if(p.Char(';')) {
|
||||
id.Clear();
|
||||
break;
|
||||
}
|
||||
p.SkipTerm();
|
||||
}
|
||||
break;
|
||||
}
|
||||
plevel++;
|
||||
}
|
||||
else
|
||||
if(p.Char(')'))
|
||||
plevel--;
|
||||
else
|
||||
if(p.Char('>')) {
|
||||
tlevel--;
|
||||
id.Clear();
|
||||
}
|
||||
else
|
||||
if(p.Char('<'))
|
||||
tlevel++;
|
||||
else
|
||||
if(p.Char(';') || p.Char('=') && plevel == 0) {
|
||||
if(!td) ink = Green;
|
||||
break;
|
||||
}
|
||||
else
|
||||
p.SkipTerm();
|
||||
}
|
||||
}
|
||||
catch(CParser::Error) {}
|
||||
if(id.GetCount() && CppKeywords().Find(id) < 0) {
|
||||
if(nklass != klass) {
|
||||
klass = nklass;
|
||||
if(klass.GetCount()) {
|
||||
IndexItem& m = indexitem.Add();
|
||||
m.text = klass + "::";
|
||||
m.ink = LtBlue;
|
||||
m.line = i;
|
||||
}
|
||||
}
|
||||
if(klass.GetCount())
|
||||
id = " " + id;
|
||||
IndexItem& m = indexitem.Add();
|
||||
m.text = id;
|
||||
m.ink = ink;
|
||||
m.line = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void AssistEditor::SyncIndex()
|
||||
{
|
||||
searchindex.NullText(String("Search (") + GetKeyDesc(IdeKeys::AK_SEARCHINDEX().key[0]) + ") ",
|
||||
StdFont().Italic(), SColorDisabled());
|
||||
bool b = indexitem.GetCount() && showindex && assist_active;
|
||||
indexframe.Show(b);
|
||||
index.Clear();
|
||||
if(!b) return;
|
||||
String s = ~searchindex;
|
||||
for(int i = 0; i < indexitem.GetCount(); i++) {
|
||||
const IndexItem& m = indexitem[i];
|
||||
if(s.GetCount() == 0 || ToUpper(m.text).Find(s) >= 0)
|
||||
index.Add(AttrText(m.text).Ink(m.ink), m.line);
|
||||
}
|
||||
}
|
||||
|
||||
void AssistEditor::IndexSync()
|
||||
{
|
||||
if(index.IsCursor()) {
|
||||
int q = index.Get(1);
|
||||
for(int i = 0; i < GetLineCount(); i++)
|
||||
if(GetLine2(i) >= q) {
|
||||
SetCursor(GetPos(i));
|
||||
TopCursor();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AssistEditor::IndexClick()
|
||||
{
|
||||
IndexSync();
|
||||
SetFocus();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void AssistEditor::SyncIndexCursor()
|
||||
{
|
||||
CodeEditor::SelectionChanged();
|
||||
if(!index.IsCursor())
|
||||
index.SetCursor(0);
|
||||
if(!index.GetCount() || searchindex.HasFocus())
|
||||
return;
|
||||
int ln = GetLine2(GetCursorLine());
|
||||
int ii = index.GetCursor();
|
||||
while(ii > 0 && (int)index.Get(ii, 1) > ln)
|
||||
ii--;
|
||||
while(ii < index.GetCount() - 1 && (int)index.Get(ii + 1, 1) <= ln)
|
||||
ii++;
|
||||
index.SetCursor(ii);
|
||||
}
|
||||
|
||||
void AssistEditor::SelectionChanged()
|
||||
{
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void AssistEditor::SearchIndex()
|
||||
{
|
||||
SyncIndex();
|
||||
index.GoBegin();
|
||||
IndexSync();
|
||||
}
|
||||
|
||||
bool AssistEditor::IndexKey(dword key)
|
||||
{
|
||||
switch(key) {
|
||||
case K_ENTER:
|
||||
case K_ESCAPE:
|
||||
searchindex.Clear();
|
||||
SetFocus();
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
return true;
|
||||
case K_UP:
|
||||
case K_DOWN:
|
||||
index.Key(key, 1);
|
||||
IndexSync();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AssistEditor::IsIndex()
|
||||
{
|
||||
return showindex;
|
||||
}
|
||||
|
||||
void AssistEditor::ShowIndex(bool b)
|
||||
{
|
||||
showindex = b;
|
||||
indexframe.Show(showindex);
|
||||
if(showindex) {
|
||||
SetFocus();
|
||||
CreateIndex();
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void AssistEditor::SerializeIndex(Stream& s)
|
||||
{
|
||||
int version = 0;
|
||||
s / version;
|
||||
s % indexframe;
|
||||
s % showindex;
|
||||
if(searchindex.HasFocus())
|
||||
SetFocus();
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void Ide::ToggleIndex()
|
||||
{
|
||||
editor.ShowIndex(!editor.IsIndex());
|
||||
}
|
||||
|
||||
void Ide::SearchIndex()
|
||||
{
|
||||
editor.ShowIndex(true);
|
||||
if(editor.index.IsVisible())
|
||||
editor.searchindex.SetFocus();
|
||||
}
|
||||
#include "ide.h"
|
||||
|
||||
void AssistEditor::CreateIndex()
|
||||
{
|
||||
searchindex.Clear();
|
||||
Renumber2();
|
||||
indexitem.Clear();
|
||||
if(!assist_active) {
|
||||
indexframe.Show(false);
|
||||
return;
|
||||
}
|
||||
const Index<String>& cppkeywords = CppKeywords();
|
||||
String sop = "operator";
|
||||
String klass;
|
||||
for(int i = 0; i < min(GetLineCount(), 10000); i++) {
|
||||
String l = GetEncodedLine(i, CHARSET_UTF8);
|
||||
int plevel = 0;
|
||||
int tlevel = 0;
|
||||
Color ink = Gray;
|
||||
bool fn = false;
|
||||
bool td = false;
|
||||
if(l[0] > 32) {
|
||||
String nklass, id;
|
||||
try {
|
||||
CParser p(l);
|
||||
if(p.Char('#')) {
|
||||
if(p.Id("define") && p.IsId()) {
|
||||
id = p.ReadId();
|
||||
ink = Magenta;
|
||||
}
|
||||
}
|
||||
else {
|
||||
while(!p.IsEof())
|
||||
if(p.Id("typedef")) {
|
||||
td = true;
|
||||
ink = LtBlue;
|
||||
}
|
||||
else
|
||||
if((p.Id("class") || p.Id("struct") || p.Id("union") || p.Id("enum")) && tlevel == 0 && p.IsId()) {
|
||||
id = p.ReadId();
|
||||
if(p.Char(';'))
|
||||
id.Clear();
|
||||
ink = LtBlue;
|
||||
break;
|
||||
}
|
||||
else
|
||||
if(p.Char('~') && p.IsId())
|
||||
id = '~' + p.ReadId();
|
||||
else
|
||||
if(p.Char2(':', ':') && tlevel == 0)
|
||||
nklass = id;
|
||||
else
|
||||
if(p.IsId() && tlevel == 0) {
|
||||
id = p.ReadId();
|
||||
if(id == sop) {
|
||||
static char oc[] = "<>!^&*+=-%";
|
||||
while(strchr(oc, *p.GetPtr())) {
|
||||
id.Cat(*p.GetPtr());
|
||||
p.SkipTerm();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
if(p.Char('(')) {
|
||||
if(plevel == 0) {
|
||||
fn = true;
|
||||
ink = Black;
|
||||
int q = i;
|
||||
for(;;) {
|
||||
if(p.IsEof()) {
|
||||
if(++q >= GetLineCount() || q > i + 6) {
|
||||
id.Clear();
|
||||
break;
|
||||
}
|
||||
l = GetEncodedLine(q, CHARSET_UTF8);
|
||||
p.Set(l);
|
||||
}
|
||||
if(p.Char('{'))
|
||||
break;
|
||||
if(p.Char(';')) {
|
||||
id.Clear();
|
||||
break;
|
||||
}
|
||||
p.SkipTerm();
|
||||
}
|
||||
break;
|
||||
}
|
||||
plevel++;
|
||||
}
|
||||
else
|
||||
if(p.Char(')'))
|
||||
plevel--;
|
||||
else
|
||||
if(p.Char('>')) {
|
||||
tlevel--;
|
||||
id.Clear();
|
||||
}
|
||||
else
|
||||
if(p.Char('<'))
|
||||
tlevel++;
|
||||
else
|
||||
if(p.Char(';') || p.Char('=') && plevel == 0) {
|
||||
if(!td) ink = Green;
|
||||
break;
|
||||
}
|
||||
else
|
||||
p.SkipTerm();
|
||||
}
|
||||
}
|
||||
catch(CParser::Error) {}
|
||||
if(id.GetCount() && CppKeywords().Find(id) < 0) {
|
||||
if(nklass != klass) {
|
||||
klass = nklass;
|
||||
if(klass.GetCount()) {
|
||||
IndexItem& m = indexitem.Add();
|
||||
m.text = klass + "::";
|
||||
m.ink = LtBlue;
|
||||
m.line = i;
|
||||
}
|
||||
}
|
||||
if(klass.GetCount())
|
||||
id = " " + id;
|
||||
IndexItem& m = indexitem.Add();
|
||||
m.text = id;
|
||||
m.ink = ink;
|
||||
m.line = i;
|
||||
}
|
||||
}
|
||||
}
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void AssistEditor::SyncIndex()
|
||||
{
|
||||
searchindex.NullText(String("Search (") + GetKeyDesc(IdeKeys::AK_SEARCHINDEX().key[0]) + ") ",
|
||||
StdFont().Italic(), SColorDisabled());
|
||||
bool b = indexitem.GetCount() && showindex && assist_active;
|
||||
indexframe.Show(b);
|
||||
index.Clear();
|
||||
if(!b) return;
|
||||
String s = ~searchindex;
|
||||
for(int i = 0; i < indexitem.GetCount(); i++) {
|
||||
const IndexItem& m = indexitem[i];
|
||||
if(s.GetCount() == 0 || ToUpper(m.text).Find(s) >= 0)
|
||||
index.Add(AttrText(m.text).Ink(m.ink), m.line);
|
||||
}
|
||||
}
|
||||
|
||||
void AssistEditor::IndexSync()
|
||||
{
|
||||
if(index.IsCursor()) {
|
||||
int q = index.Get(1);
|
||||
for(int i = 0; i < GetLineCount(); i++)
|
||||
if(GetLine2(i) >= q) {
|
||||
SetCursor(GetPos(i));
|
||||
TopCursor();
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AssistEditor::IndexClick()
|
||||
{
|
||||
IndexSync();
|
||||
SetFocus();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void AssistEditor::SyncIndexCursor()
|
||||
{
|
||||
CodeEditor::SelectionChanged();
|
||||
if(!index.IsCursor())
|
||||
index.SetCursor(0);
|
||||
if(!index.GetCount() || searchindex.HasFocus())
|
||||
return;
|
||||
int ln = GetLine2(GetCursorLine());
|
||||
int ii = index.GetCursor();
|
||||
while(ii > 0 && (int)index.Get(ii, 1) > ln)
|
||||
ii--;
|
||||
while(ii < index.GetCount() - 1 && (int)index.Get(ii + 1, 1) <= ln)
|
||||
ii++;
|
||||
index.SetCursor(ii);
|
||||
}
|
||||
|
||||
void AssistEditor::SelectionChanged()
|
||||
{
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void AssistEditor::SearchIndex()
|
||||
{
|
||||
SyncIndex();
|
||||
index.GoBegin();
|
||||
IndexSync();
|
||||
}
|
||||
|
||||
bool AssistEditor::IndexKey(dword key)
|
||||
{
|
||||
switch(key) {
|
||||
case K_ENTER:
|
||||
case K_ESCAPE:
|
||||
searchindex.Clear();
|
||||
SetFocus();
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
return true;
|
||||
case K_UP:
|
||||
case K_DOWN:
|
||||
index.Key(key, 1);
|
||||
IndexSync();
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool AssistEditor::IsIndex()
|
||||
{
|
||||
return showindex;
|
||||
}
|
||||
|
||||
void AssistEditor::ShowIndex(bool b)
|
||||
{
|
||||
showindex = b;
|
||||
indexframe.Show(showindex);
|
||||
if(showindex) {
|
||||
SetFocus();
|
||||
CreateIndex();
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
}
|
||||
|
||||
void AssistEditor::SerializeIndex(Stream& s)
|
||||
{
|
||||
int version = 0;
|
||||
s / version;
|
||||
s % indexframe;
|
||||
s % showindex;
|
||||
if(searchindex.HasFocus())
|
||||
SetFocus();
|
||||
SyncIndex();
|
||||
SyncIndexCursor();
|
||||
}
|
||||
|
||||
void Ide::ToggleIndex()
|
||||
{
|
||||
editor.ShowIndex(!editor.IsIndex());
|
||||
}
|
||||
|
||||
void Ide::SearchIndex()
|
||||
{
|
||||
editor.ShowIndex(true);
|
||||
if(editor.index.IsVisible())
|
||||
editor.searchindex.SetFocus();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -718,6 +718,12 @@ void LayDes::CreateCtrl(const String& _type)
|
|||
LayoutItem& m = l.item.Insert(c);
|
||||
m.Create(_type);
|
||||
Point p = dragbase;
|
||||
Size sza, szb;
|
||||
GetZoomRatio(sza, szb);
|
||||
if(sza.cx)
|
||||
p.x = szb.cx * p.x / sza.cx;
|
||||
if(sza.cy)
|
||||
p.y = szb.cy * p.y / sza.cy;
|
||||
if(usegrid) {
|
||||
p.x = p.x / (int)~setting.gridx * (int)~setting.gridx;
|
||||
p.y = p.y / (int)~setting.gridy * (int)~setting.gridy;
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#include "ide.h"
|
||||
#include "ide.h"
|
||||
|
||||
struct OptionDisplay : Display {
|
||||
virtual void Paint(Draw& w, const Rect& r, const Value& q, Color ink,
|
||||
|
|
|
|||
|
|
@ -1,152 +1,152 @@
|
|||
#include "ide.h"
|
||||
|
||||
bool Ide::IsValgrind()
|
||||
{
|
||||
static bool is;
|
||||
ONCELOCK {
|
||||
is = system("which valgrind") == 0;
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
void Ide::Valgrind()
|
||||
{
|
||||
if(!IsValgrind())
|
||||
return;
|
||||
static String ValgrindLogFile;
|
||||
if(IsNull(ValgrindLogFile)) {
|
||||
StringStream ss;
|
||||
CreateHostRunDir()->Execute("valgrind --help", ss);
|
||||
String txt = ss;
|
||||
if(txt.Find("--log-file-exactly") > 0)
|
||||
ValgrindLogFile = "--log-file-exactly=";
|
||||
else
|
||||
ValgrindLogFile = "--log-file=";
|
||||
}
|
||||
|
||||
if(!Build())
|
||||
return;
|
||||
One<Host> h = CreateHostRunDir();
|
||||
h->ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
String cmdline;
|
||||
String fn = GetTempFileName();
|
||||
cmdline << "valgrind --xml=yes --num-callers=40 " << ValgrindLogFile << fn << ' ';
|
||||
String ValgSupp = ConfigFile("valgrind.supp");
|
||||
if(!IsNull(LoadFile(ValgSupp)))
|
||||
cmdline << "--suppressions=" << ValgSupp << ' ';
|
||||
cmdline << '\"' << h->GetHostPath(target) << "\" ";
|
||||
cmdline << runarg;
|
||||
ConsoleClear();
|
||||
PutConsole("Valgrind..");
|
||||
if(IsNull(h->Execute(cmdline))) {
|
||||
PutConsole("Error executing valgrind");
|
||||
return;
|
||||
}
|
||||
PutConsole("Parsing valgrind output..");
|
||||
Sync();
|
||||
String txt = LoadFile(fn);
|
||||
DeleteFile(fn);
|
||||
try {
|
||||
XmlParser p(txt);
|
||||
while(!p.IsTag())
|
||||
p.Skip();
|
||||
p.PassTag("valgrindoutput");
|
||||
while(!p.End()) {
|
||||
if(p.Tag("error")) {
|
||||
String hdr = "Error (missing description)";
|
||||
String pos;
|
||||
Vector<String> ln;
|
||||
bool src = false;
|
||||
while(!p.End()) {
|
||||
if(p.Tag("what")) {
|
||||
hdr = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("stack")) {
|
||||
while(!p.End()) {
|
||||
String ip = "?";
|
||||
String obj;
|
||||
String fn;
|
||||
String dir;
|
||||
String file;
|
||||
String line;
|
||||
if(p.Tag("frame")) {
|
||||
bool hasdir = false;
|
||||
bool hasfile = false;
|
||||
bool hasline = false;
|
||||
bool haspos = false;
|
||||
while(!p.End()) {
|
||||
if(p.Tag("ip")) {
|
||||
ip = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("obj")) {
|
||||
obj = p.ReadText();
|
||||
p.SkipEnd();
|
||||
haspos = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("fn")) {
|
||||
fn = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("dir")) {
|
||||
dir = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasdir = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("file")) {
|
||||
file = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasfile = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("line")) {
|
||||
line = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasline = true;
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
src = src || hasline && hasdir && hasfile;
|
||||
if(pos.IsEmpty() && haspos)
|
||||
pos << fn << ' ' << ip << ' '<< obj;
|
||||
if(hasline && hasdir && hasfile)
|
||||
ln.Add(AppendFileName(dir, file) + ':' + line);
|
||||
else {
|
||||
String h;
|
||||
h << fn << ' ' << ip << ' ' << obj;
|
||||
if(hasdir && hasfile)
|
||||
h << AppendFileName(dir, file);
|
||||
else
|
||||
h << file << ' ';
|
||||
h << line;
|
||||
ln.Add(h);
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
PutConsole(hdr);
|
||||
PutConsole(" " + pos);
|
||||
if(src)
|
||||
for(int i = 0; i < ln.GetCount(); i++)
|
||||
PutConsole(" " + ln[i]);
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
catch(XmlError) {
|
||||
PutConsole("Error parsing valgrind output");
|
||||
}
|
||||
}
|
||||
#include "ide.h"
|
||||
|
||||
bool Ide::IsValgrind()
|
||||
{
|
||||
static bool is;
|
||||
ONCELOCK {
|
||||
is = system("which valgrind") == 0;
|
||||
}
|
||||
return is;
|
||||
}
|
||||
|
||||
void Ide::Valgrind()
|
||||
{
|
||||
if(!IsValgrind())
|
||||
return;
|
||||
static String ValgrindLogFile;
|
||||
if(IsNull(ValgrindLogFile)) {
|
||||
StringStream ss;
|
||||
CreateHostRunDir()->Execute("valgrind --help", ss);
|
||||
String txt = ss;
|
||||
if(txt.Find("--log-file-exactly") > 0)
|
||||
ValgrindLogFile = "--log-file-exactly=";
|
||||
else
|
||||
ValgrindLogFile = "--log-file=";
|
||||
}
|
||||
|
||||
if(!Build())
|
||||
return;
|
||||
One<Host> h = CreateHostRunDir();
|
||||
h->ChDir(Nvl(rundir, GetFileFolder(target)));
|
||||
String cmdline;
|
||||
String fn = GetTempFileName();
|
||||
cmdline << "valgrind --xml=yes --num-callers=40 " << ValgrindLogFile << fn << ' ';
|
||||
String ValgSupp = ConfigFile("valgrind.supp");
|
||||
if(!IsNull(LoadFile(ValgSupp)))
|
||||
cmdline << "--suppressions=" << ValgSupp << ' ';
|
||||
cmdline << '\"' << h->GetHostPath(target) << "\" ";
|
||||
cmdline << runarg;
|
||||
ConsoleClear();
|
||||
PutConsole("Valgrind..");
|
||||
if(IsNull(h->Execute(cmdline))) {
|
||||
PutConsole("Error executing valgrind");
|
||||
return;
|
||||
}
|
||||
PutConsole("Parsing valgrind output..");
|
||||
Sync();
|
||||
String txt = LoadFile(fn);
|
||||
DeleteFile(fn);
|
||||
try {
|
||||
XmlParser p(txt);
|
||||
while(!p.IsTag())
|
||||
p.Skip();
|
||||
p.PassTag("valgrindoutput");
|
||||
while(!p.End()) {
|
||||
if(p.Tag("error")) {
|
||||
String hdr = "Error (missing description)";
|
||||
String pos;
|
||||
Vector<String> ln;
|
||||
bool src = false;
|
||||
while(!p.End()) {
|
||||
if(p.Tag("what")) {
|
||||
hdr = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("stack")) {
|
||||
while(!p.End()) {
|
||||
String ip = "?";
|
||||
String obj;
|
||||
String fn;
|
||||
String dir;
|
||||
String file;
|
||||
String line;
|
||||
if(p.Tag("frame")) {
|
||||
bool hasdir = false;
|
||||
bool hasfile = false;
|
||||
bool hasline = false;
|
||||
bool haspos = false;
|
||||
while(!p.End()) {
|
||||
if(p.Tag("ip")) {
|
||||
ip = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("obj")) {
|
||||
obj = p.ReadText();
|
||||
p.SkipEnd();
|
||||
haspos = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("fn")) {
|
||||
fn = p.ReadText();
|
||||
p.SkipEnd();
|
||||
}
|
||||
else
|
||||
if(p.Tag("dir")) {
|
||||
dir = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasdir = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("file")) {
|
||||
file = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasfile = true;
|
||||
}
|
||||
else
|
||||
if(p.Tag("line")) {
|
||||
line = p.ReadText();
|
||||
p.SkipEnd();
|
||||
hasline = true;
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
src = src || hasline && hasdir && hasfile;
|
||||
if(pos.IsEmpty() && haspos)
|
||||
pos << fn << ' ' << ip << ' '<< obj;
|
||||
if(hasline && hasdir && hasfile)
|
||||
ln.Add(AppendFileName(dir, file) + ':' + line);
|
||||
else {
|
||||
String h;
|
||||
h << fn << ' ' << ip << ' ' << obj;
|
||||
if(hasdir && hasfile)
|
||||
h << AppendFileName(dir, file);
|
||||
else
|
||||
h << file << ' ';
|
||||
h << line;
|
||||
ln.Add(h);
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
PutConsole(hdr);
|
||||
PutConsole(" " + pos);
|
||||
if(src)
|
||||
for(int i = 0; i < ln.GetCount(); i++)
|
||||
PutConsole(" " + ln[i]);
|
||||
}
|
||||
else
|
||||
p.Skip();
|
||||
}
|
||||
}
|
||||
catch(XmlError) {
|
||||
PutConsole("Error parsing valgrind output");
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,3 +56,4 @@ COMPRESSED
|
|||
31,88,15,187,57,245,126,171,170,37,149,239,239,127,121,170,151,24,111,47,79,117,93,24,247,189,68,21,231,88,2,91,37,219,79,123,48,129,83,120,164,191,209,213,170,206,185,111,114,197,170,165,224,13,175,90,181,118,209,163,92,185,106,37,205,35,92,189,234,169,190,119,95,193,234,98,144,189,220,160,114,241,106,9,209,94,180,197,126,247,160,115,62,232,138,225,187,174,233,141,213,27,232,126,88,135,226,109,191,219,197,75,8,15,222,117,250,71,221,22,62,215,239,226,19,39,167,102,36,61,7,117,199,114,6,130,167,79,233,115,247,47,195,238,201,80,156,117,251,239,123,195,33,140,186,255,73,116,206,206,96,146,206,254,49,60,222,249,104,183,209,253,203,65,247,108,40,62,190,235,158,136,83,156,237,99,15,150,55,24,118,240,189,222,137,248,216,239,13,123,39,71,52,46,118,226,234,247,142,222,13,197,187,211,227,195,110,159,218,117,61,61,237,155,193,104,0,190,82,172,59,16,103,253,211,15,189,67,127,175,163,39,157,1,108,103,244,196,92,112,102,118,3,187,238,156,
|
||||
88,192,253,220,59,57,108,137,110,143,134,236,254,229,172,223,29,32,128,96,203,189,247,176,149,46,252,216,59,57,56,62,63,164,222,96,251,48,210,201,233,16,230,129,45,195,99,195,83,130,157,53,60,248,29,61,27,46,15,230,43,223,142,134,77,197,154,174,71,51,67,217,107,210,8,214,48,24,156,80,191,55,248,89,192,214,212,9,252,249,188,99,6,132,99,128,177,222,119,78,14,232,100,221,85,57,24,128,224,16,159,78,207,49,126,8,112,57,62,244,192,134,160,236,138,195,238,219,238,193,176,247,1,240,2,158,132,233,6,231,239,237,96,124,66,131,33,1,242,248,88,156,116,15,96,31,248,246,160,219,255,208,59,32,56,245,187,103,157,94,95,80,91,181,126,31,71,59,61,169,231,138,47,219,120,252,128,210,221,15,136,76,231,39,199,8,149,126,247,207,231,176,223,26,148,194,49,59,71,128,190,8,124,120,213,162,171,194,160,143,61,88,20,94,103,87,70,163,22,189,10,63,88,244,249,4,8,121,42,222,119,62,113,143,55,139,21,140,112,176,12,211,12,206,199,47,
|
||||
56,2,139,246,157,253,83,132,213,62,254,76,203,132,133,1,224,204,96,120,196,135,157,247,157,163,238,192,65,38,90,138,234,87,215,18,131,179,238,65,15,255,1,191,3,50,3,174,28,11,7,227,15,78,129,108,255,124,142,88,0,63,168,193,68,7,208,1,71,66,252,230,35,23,72,244,136,187,39,26,215,96,45,138,17,84,208,97,203,174,165,138,215,226,248,116,64,200,123,216,25,118,4,237,0,254,222,239,194,211,102,160,126,247,4,224,74,4,220,57,56,56,239,3,49,227,147,248,38,172,110,112,14,228,221,59,225,67,68,68,34,54,210,235,31,26,202,197,243,176,80,234,244,142,207,251,26,119,205,34,97,37,167,0,106,28,154,112,215,30,224,224,244,237,16,232,172,187,221,34,220,17,189,183,86,132,156,31,188,83,167,142,147,184,7,254,14,142,110,191,11,143,119,14,63,244,136,210,121,62,160,181,65,79,193,12,190,194,17,204,112,10,222,141,29,8,225,207,157,151,186,226,165,72,230,210,36,113,241,255,0,68,186,0,53,
|
||||
|
||||
|
|
|
|||
|
|
@ -22,6 +22,7 @@
|
|||
#include <ide/Browser/Browser.h>
|
||||
#include <ide/QuickTabs/QuickTabs.h>
|
||||
#include <CodeEditor/CodeEditor.h>
|
||||
#include <usvn/usvn.h>
|
||||
|
||||
#include "UppDlg.h"
|
||||
|
||||
|
|
@ -774,13 +775,14 @@ public:
|
|||
void GotoPos(String path, int line);
|
||||
void GotoCpp(const CppPos& pos);
|
||||
|
||||
Vector<String> SvnDirs();
|
||||
|
||||
void File(Bar& menu);
|
||||
void EditWorkspace();
|
||||
void EditAnyFile();
|
||||
bool IsProjectFile(const String& f) const;
|
||||
void SaveFile(bool always = false);
|
||||
void DoSaveFile() { SaveFile(); }
|
||||
void ExportProject();
|
||||
void FileBookmark (Bar& menu);
|
||||
void SwapPackagesFiles();
|
||||
void Times();
|
||||
|
|
@ -821,6 +823,8 @@ public:
|
|||
void Project(Bar& menu);
|
||||
void SyncT(int kind);
|
||||
void ConvertST();
|
||||
void ExportProject();
|
||||
void SyncSvn();
|
||||
|
||||
void BuildMenu(Bar& menu);
|
||||
void BuildPackageMenu(Bar& menu);
|
||||
|
|
|
|||
|
|
@ -14,7 +14,8 @@ uses
|
|||
plugin\bz2,
|
||||
HexView,
|
||||
art\BlueBar,
|
||||
plugin/astyle;
|
||||
plugin/astyle,
|
||||
usvn;
|
||||
|
||||
link(WIN32 MSC) /MAP;
|
||||
|
||||
|
|
|
|||
|
|
@ -305,6 +305,8 @@ void Ide::Project(Bar& menu) {
|
|||
FilePropertiesMenu(menu);
|
||||
menu.MenuSeparator();
|
||||
menu.Add("Export project..", THISBACK(ExportProject));
|
||||
if(SvnDirs().GetCount())
|
||||
menu.Add("SVN Synchronize..", THISBACK(SyncSvn));
|
||||
}
|
||||
|
||||
void Ide::FilePropertiesMenu(Bar& menu)
|
||||
|
|
|
|||
|
|
@ -251,3 +251,23 @@ void Ide::Times()
|
|||
}
|
||||
while(statdlg.Run() == IDRETRY);
|
||||
}
|
||||
|
||||
Vector<String> Ide::SvnDirs()
|
||||
{
|
||||
Vector<String> d = GetUppDirs();
|
||||
Vector<String> r;
|
||||
for(int i = 0; i < d.GetCount(); i++)
|
||||
if(DirectoryExists(AppendFileName(d[i], ".svn")))
|
||||
r.Add(d[i]);
|
||||
DUMPC(r);
|
||||
return r;
|
||||
}
|
||||
|
||||
void Ide::SyncSvn()
|
||||
{
|
||||
SvnSync svn;
|
||||
Vector<String> r = SvnDirs();
|
||||
for(int i = 0; i < r.GetCount(); i++)
|
||||
svn.Dir(r[i]);
|
||||
svn.DoSync();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -14,4 +14,5 @@
|
|||
#include "HexView/init"
|
||||
#include "art\BlueBar/init"
|
||||
#include "plugin/astyle/init"
|
||||
#include "usvn/init"
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,179 +1,137 @@
|
|||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
fun:XftFontOpen
|
||||
}
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontInfoEqual
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Addr8
|
||||
obj:/lib/ld-2.6.1.so
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Addr8
|
||||
obj:/lib/ld-2.7.so
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Param
|
||||
write(buf)
|
||||
fun:__write_nocancel
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:realloc
|
||||
fun:add_codeset
|
||||
fun:initialize
|
||||
fun:_XlcCreateLC
|
||||
fun:_XlcDefaultLoader
|
||||
fun:_XOpenLC
|
||||
fun:_XrmInitParseInfo
|
||||
fun:NewDatabase
|
||||
fun:XrmGetStringDatabase
|
||||
fun:XGetDefault
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
obj:/usr/lib/libfontconfig.so.1.2.0
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
obj:/usr/lib/libfontconfig.so.1.3.0
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Addr8
|
||||
obj:/lib/ld-2.7.so
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontInfoEqual
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
fun:XftFontOpen
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp14sCheckComposedEPKc
|
||||
fun:_ZN3Upp4Draw17InitPlatformFontsEv
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp8FontInfo4DataD1Ev
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontInfoEqual
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
fun:XftFontOpen
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontOpenInfo
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp14sCheckComposedEPKc
|
||||
fun:_ZN3Upp4Draw17InitPlatformFontsEv
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp8FontInfo4DataD1Ev
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
fun:XftFontOpen
|
||||
}
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontInfoEqual
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:calloc
|
||||
fun:g_malloc0
|
||||
obj:/usr/lib/libgobject-2.0.so.0.1400.1
|
||||
obj:/usr/lib/libgobject-2.0.so.0.1400.1
|
||||
fun:g_type_register_fundamental
|
||||
obj:/usr/lib/libgobject-2.0.so.0.1400.1
|
||||
fun:g_type_init_with_debug_flags
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Addr8
|
||||
obj:/lib/ld-2.6.1.so
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Addr8
|
||||
obj:/lib/ld-2.7.so
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Param
|
||||
write(buf)
|
||||
fun:__write_nocancel
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:realloc
|
||||
obj:/usr/lib/libfontconfig.so.1.2.0
|
||||
obj:/usr/lib/libfontconfig.so.1.2.0
|
||||
fun:FcFontRenderPrepare
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:memalign
|
||||
fun:posix_memalign
|
||||
obj:/usr/lib/libglib-2.0.so.0.1400.1
|
||||
fun:g_slice_alloc
|
||||
fun:g_slice_alloc0
|
||||
fun:add_codeset
|
||||
fun:initialize
|
||||
fun:_XlcCreateLC
|
||||
fun:_XlcDefaultLoader
|
||||
fun:_XOpenLC
|
||||
fun:_XrmInitParseInfo
|
||||
fun:NewDatabase
|
||||
fun:XrmGetStringDatabase
|
||||
fun:XGetDefault
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
fun:g_malloc
|
||||
fun:g_strdup
|
||||
obj:/usr/lib/libgobject-2.0.so.0.1400.1
|
||||
fun:g_object_get_valist
|
||||
fun:g_object_get
|
||||
obj:/usr/lib/libfontconfig.so.1.2.0
|
||||
}
|
||||
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Leak
|
||||
fun:malloc
|
||||
obj:/usr/lib/libfontconfig.so.1.3.0
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Addr8
|
||||
obj:/lib/ld-2.7.so
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontInfoEqual
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
fun:XftFontOpen
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp14sCheckComposedEPKc
|
||||
fun:_ZN3Upp4Draw17InitPlatformFontsEv
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp8FontInfo4DataD1Ev
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontInfoEqual
|
||||
fun:XftFontOpenInfo
|
||||
fun:XftFontOpenPattern
|
||||
fun:XftFontOpen
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Cond
|
||||
fun:XftFontOpenInfo
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp14sCheckComposedEPKc
|
||||
fun:_ZN3Upp4Draw17InitPlatformFontsEv
|
||||
}
|
||||
|
||||
{
|
||||
<insert a suppression name here>
|
||||
Memcheck:Value8
|
||||
obj:/usr/lib/libXft.so.2.1.2
|
||||
fun:_ZN3Upp8FontInfo4DataD1Ev
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1 +1 @@
|
|||
#define IDE_VERSION "807.r127"
|
||||
#define IDE_VERSION "808.r132"
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,489 +1,489 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* ASEnhancer.cpp
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
// can trace only if NDEBUG is not defined
|
||||
#ifndef NDEBUG
|
||||
// #define TRACEswitch
|
||||
// #define TRACEcase
|
||||
// #define TRACEmisc
|
||||
#endif
|
||||
|
||||
#include "astyle.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#ifdef TRACEswitch
|
||||
#define TRswitch(a,b) *traceOut << lineNumber << a << b << endl;
|
||||
#else
|
||||
#define TRswitch(a,b) ((void)0)
|
||||
#endif // TRACEswitch
|
||||
#ifdef TRACEcase
|
||||
#define TRcase(a,b) *traceOut << lineNumber << a << b << endl;
|
||||
#else
|
||||
#define TRcase(a,b) ((void)0)
|
||||
#endif // TRACEcase
|
||||
#ifdef TRACEmisc
|
||||
#define TRmisc(a) *traceOut << lineNumber << a << endl;
|
||||
#else
|
||||
#define TRmisc(a) ((void)0)
|
||||
#endif // TRACEmisc
|
||||
|
||||
|
||||
namespace astyle
|
||||
{
|
||||
|
||||
// ---------------------------- functions for ASEnhancer Class -------------------------------------
|
||||
|
||||
/**
|
||||
* ASEnhancer constructor
|
||||
*/
|
||||
ASEnhancer::ASEnhancer()
|
||||
{
|
||||
// variables are initialized by init()
|
||||
traceOut = new StringStream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor of ASEnhancer
|
||||
* Display the TRACE entries.
|
||||
*/
|
||||
ASEnhancer::~ASEnhancer()
|
||||
{
|
||||
#if defined(TRACEswitch) || defined(TRACEcase) || defined(TRACEmisc)
|
||||
WString line;
|
||||
WString msg = "TRACE Entries\n\n";
|
||||
char countLine[50];
|
||||
int count = 0;
|
||||
|
||||
while (getline(*traceOut, line))
|
||||
{
|
||||
msg += line + '\n';
|
||||
count++;
|
||||
}
|
||||
sprintf(countLine, "\n%d Entries", count);
|
||||
msg += countLine;
|
||||
// write a text file to "My Documents" (Windows)
|
||||
char filename [_MAX_PATH + _MAX_FNAME + _MAX_EXT + 1]; // full path and filename
|
||||
strcpy(filename, getenv("USERPROFILE"));
|
||||
strcat(filename, "\\My Documents\\tracee.txt");
|
||||
ofstream outfile(filename);
|
||||
outfile << msg;
|
||||
outfile.close();
|
||||
#endif
|
||||
delete traceOut;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the ASEnhancer.
|
||||
*
|
||||
* init() is called each time an ASFormatter object is initialized.
|
||||
*/
|
||||
void ASEnhancer::init(int _indentLength,
|
||||
WString _indentString,
|
||||
bool _isCStyle,
|
||||
bool _isJavaStyle,
|
||||
bool _isSharpStyle,
|
||||
bool _caseIndent,
|
||||
bool _emptyLineFill)
|
||||
{
|
||||
// formatting variables from ASFormatter and ASBeautifier
|
||||
indentLength = _indentLength;
|
||||
if (_indentString[0] == '\t')
|
||||
useTabs = true;
|
||||
else
|
||||
useTabs = false;
|
||||
isCStyle = _isCStyle;
|
||||
isJavaStyle = _isJavaStyle;
|
||||
isSharpStyle = _isSharpStyle;
|
||||
caseIndent = _caseIndent;
|
||||
emptyLineFill = _emptyLineFill;
|
||||
|
||||
// unindent variables
|
||||
lineNumber = 0;
|
||||
bracketCount = 0;
|
||||
isInComment = false;
|
||||
isInQuote = false;
|
||||
switchDepth = 0;
|
||||
lookingForCaseBracket = false;
|
||||
unindentNextLine = false;
|
||||
|
||||
#if defined(TRACEswitch) || defined(TRACEcase) || defined(TRACEmisc)
|
||||
*traceOut << "New file -------------" << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* additional formatting for line of source code.
|
||||
* every line of source code in a source code file should be sent
|
||||
* one after the other to this function.
|
||||
* indents event tables
|
||||
* unindents the case blocks
|
||||
*
|
||||
* @param line the original formatted line will be updated if necessary.
|
||||
*/
|
||||
void ASEnhancer::enhance(WString &line)
|
||||
{
|
||||
static Array<switchVariables> swVector; // stack Vector of switch variables
|
||||
static switchVariables sw; // switch variables struct
|
||||
|
||||
static bool nextLineIsEventTable; // begin event table is reached
|
||||
static bool isInEventTable; // need to indent an event table
|
||||
|
||||
bool isSpecialChar = false;
|
||||
int lineLength; // length of the line being parsed
|
||||
|
||||
lineNumber++;
|
||||
lineLength = line.GetCount();
|
||||
|
||||
// check for beginning of event table
|
||||
if (nextLineIsEventTable)
|
||||
{
|
||||
isInEventTable = true;
|
||||
nextLineIsEventTable = false;
|
||||
}
|
||||
|
||||
if (lineLength == 0
|
||||
&& ! isInEventTable
|
||||
&& ! emptyLineFill)
|
||||
return;
|
||||
|
||||
// test for unindent on attached brackets
|
||||
if (unindentNextLine)
|
||||
{
|
||||
sw.unindentDepth++;
|
||||
sw.unindentCase = true;
|
||||
unindentNextLine = false;
|
||||
TRcase(" unindent case ", sw.unindentDepth);
|
||||
}
|
||||
|
||||
// parse characters in the current line.
|
||||
|
||||
for (int i = 0; i < lineLength; i++)
|
||||
{
|
||||
char ch = line[i];
|
||||
|
||||
// bypass whitespace
|
||||
if (isWhiteSpaceX(ch))
|
||||
continue;
|
||||
|
||||
// handle special characters (i.e. backslash+character such as \n, \t, ...)
|
||||
if (isSpecialChar)
|
||||
{
|
||||
isSpecialChar = false;
|
||||
continue;
|
||||
}
|
||||
if (!(isInComment) && line.Mid(i, 2) == WString("\\\\"))
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (!(isInComment) && ch == '\\')
|
||||
{
|
||||
isSpecialChar = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// handle quotes (such as 'x' and "Hello Dolly")
|
||||
if (!(isInComment) && (ch == '"' || ch == '\''))
|
||||
if (!isInQuote)
|
||||
{
|
||||
quoteChar = ch;
|
||||
isInQuote = true;
|
||||
}
|
||||
else if (quoteChar == ch)
|
||||
{
|
||||
isInQuote = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isInQuote)
|
||||
continue;
|
||||
|
||||
// handle comments
|
||||
|
||||
if (!(isInComment) && line.Mid(i, 2) == WString("//"))
|
||||
{
|
||||
// check for windows line markers
|
||||
//@@ CHECK !!!! if (line.Mid(i + 2, 1) > WString("\xf0"))
|
||||
if (line.Mid(i + 2, 1) > WString("\xf0") && line.Mid(i + 2, 1) > WString("\xff"))
|
||||
lineNumber--;
|
||||
break; // finished with the line
|
||||
}
|
||||
else if (!(isInComment) && line.Mid(i, 2) == WString("/*"))
|
||||
{
|
||||
isInComment = true;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else if ((isInComment) && line.Mid(i, 2) == WString("*/"))
|
||||
{
|
||||
isInComment = false;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isInComment)
|
||||
continue;
|
||||
|
||||
// if we have reached this far then we are NOT in a comment or String of special characters
|
||||
|
||||
if (line[i] == '{') // if open bracket
|
||||
bracketCount++;
|
||||
|
||||
if (line[i] == '}') // if close bracket
|
||||
bracketCount--;
|
||||
|
||||
// ---------------- process event tables --------------------------------------
|
||||
|
||||
// check for event table begin
|
||||
if (findKeyword(line, i, "BEGIN_EVENT_TABLE")
|
||||
|| findKeyword(line, i, "BEGIN_MESSAGE_MAP"))
|
||||
nextLineIsEventTable = true;
|
||||
|
||||
// check for event table end
|
||||
if (findKeyword(line, i, "END_EVENT_TABLE")
|
||||
|| findKeyword(line, i, "END_MESSAGE_MAP"))
|
||||
isInEventTable = false;
|
||||
|
||||
// ---------------- process switch statements ---------------------------------
|
||||
|
||||
if (findKeyword(line, i, "switch")) // if switch statement
|
||||
{
|
||||
switchDepth++; // bump switch depth
|
||||
TRswitch(" switch ", switchDepth);
|
||||
swVector.push_back(sw); // save current variables
|
||||
sw.switchBracketCount = 0;
|
||||
sw.unindentCase = false; // don't clear case until end of switch
|
||||
i += 5; // bypass switch statement
|
||||
continue;
|
||||
}
|
||||
|
||||
// just want switch statements from this point
|
||||
|
||||
if (caseIndent || switchDepth == 0) // from here just want switch statements
|
||||
continue; // get next char
|
||||
|
||||
if (line[i] == '{') // if open bracket
|
||||
{
|
||||
sw.switchBracketCount++;
|
||||
if (lookingForCaseBracket) // if 1st after case statement
|
||||
{
|
||||
sw.unindentCase = true; // unindenting this case
|
||||
sw.unindentDepth++; // bump depth
|
||||
lookingForCaseBracket = false; // not looking now
|
||||
TRcase(" unindent case ", sw.unindentDepth);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
lookingForCaseBracket = false; // no opening bracket, don't indent
|
||||
|
||||
if (line[i] == '}') // if close bracket
|
||||
{
|
||||
sw.switchBracketCount--;
|
||||
if (sw.switchBracketCount == 0) // if end of switch statement
|
||||
{
|
||||
TRswitch(" endsw ", switchDepth);
|
||||
switchDepth--; // one less switch
|
||||
sw = swVector.back(); // restore sw struct
|
||||
swVector.pop_back(); // remove last entry from stack
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// look for case or default header
|
||||
|
||||
if (findKeyword(line, i, "case") || findKeyword(line, i, "default"))
|
||||
{
|
||||
if (sw.unindentCase) // if unindented last case
|
||||
{
|
||||
sw.unindentCase = false; // stop unindenting previous case
|
||||
sw.unindentDepth--; // reduce depth
|
||||
}
|
||||
for (; i < lineLength; i++) // bypass colon
|
||||
{
|
||||
if (line[i] == ':')
|
||||
if ((i + 1 < lineLength) && (line[i + 1] == ':'))
|
||||
i++; // bypass scope resolution operator
|
||||
else
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
for (; i < lineLength; i++) // bypass whitespace
|
||||
{
|
||||
if (!(isWhiteSpaceX(line[i])))
|
||||
break;
|
||||
}
|
||||
if (i < lineLength) // check for bracket
|
||||
{
|
||||
if (line[i] == '{') // if bracket found
|
||||
{
|
||||
sw.switchBracketCount++;
|
||||
unindentNextLine = true; // start unindenting on next line
|
||||
continue;
|
||||
}
|
||||
}
|
||||
lookingForCaseBracket = true; // bracket must be on next line
|
||||
i--; // need to check for comments
|
||||
continue;
|
||||
}
|
||||
} // end of for loop
|
||||
|
||||
if (isInEventTable) // if need to indent
|
||||
indentLine(line, 1); // do it
|
||||
|
||||
if (sw.unindentDepth > 0) // if need to unindent
|
||||
unindentLine(line, sw.unindentDepth); // do it
|
||||
}
|
||||
|
||||
/**
|
||||
* indent a line by a given number of tabsets
|
||||
* by inserting leading whitespace to the line argument.
|
||||
*
|
||||
* @param line a pointer to the line to indent.
|
||||
* @param unindent the number of tabsets to insert.
|
||||
* @return the number of characters inserted.
|
||||
*/
|
||||
int ASEnhancer::indentLine(WString &line, const int indent) const
|
||||
{
|
||||
if (line.GetCount() == 0
|
||||
&& ! emptyLineFill)
|
||||
return 0;
|
||||
|
||||
int charsToInsert; // number of chars to insert
|
||||
|
||||
if (useTabs) // if formatted with tabs
|
||||
{
|
||||
charsToInsert = indent; // tabs to insert
|
||||
line.Insert(0, WString('\t', charsToInsert)); // insert the tabs
|
||||
}
|
||||
else
|
||||
{
|
||||
charsToInsert = indent * indentLength; // compute chars to insert
|
||||
line.Insert(0, WString('\t', charsToInsert)); // insert the tabs
|
||||
}
|
||||
|
||||
return charsToInsert;
|
||||
}
|
||||
|
||||
/**
|
||||
* unindent a line by a given number of tabsets
|
||||
* by erasing the leading whitespace from the line argument.
|
||||
*
|
||||
* @param line a pointer to the line to unindent.
|
||||
* @param unindent the number of tabsets to erase.
|
||||
* @return the number of characters erased.
|
||||
*/
|
||||
int ASEnhancer::unindentLine(WString &line, const int unindent) const
|
||||
{
|
||||
int whitespace = ASString_Find_First_Not_Of(line, " \t");
|
||||
if (whitespace == -1) // if line is blank
|
||||
whitespace = line.GetCount(); // must remove padding, if any
|
||||
|
||||
if (whitespace == 0)
|
||||
return 0;
|
||||
|
||||
int charsToErase; // number of chars to erase
|
||||
|
||||
if (useTabs) // if formatted with tabs
|
||||
{
|
||||
charsToErase = unindent; // tabs to erase
|
||||
if (charsToErase <= whitespace) // if there is enough whitespace
|
||||
line.Remove(0, charsToErase); // erase the tabs
|
||||
else
|
||||
charsToErase = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
charsToErase = unindent * indentLength; // compute chars to erase
|
||||
if (charsToErase <= whitespace) // if there is enough whitespace
|
||||
line.Remove(0, charsToErase); // erase the spaces
|
||||
else
|
||||
charsToErase = 0;
|
||||
}
|
||||
|
||||
return charsToErase;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if a specific line position contains a keyword.
|
||||
*
|
||||
* @return true if the word was found. false if the word was not found.
|
||||
*/
|
||||
bool ASEnhancer::findKeyword(const WString &line, int i, const char *keyword) const
|
||||
{
|
||||
if (line.Mid(i, strlen(keyword)) == WString(keyword))
|
||||
{
|
||||
// check that this is a header and not a part of a longer word
|
||||
// (e.g. not at its begining, not at its middle...)
|
||||
|
||||
int lineLength = line.GetCount();
|
||||
int wordEnd = i + strlen(keyword);
|
||||
char startCh = keyword[0]; // first char of header
|
||||
char endCh = 0; // char just after header
|
||||
char prevCh = 0; // char just before header
|
||||
|
||||
if (wordEnd < lineLength)
|
||||
{
|
||||
endCh = line[wordEnd];
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
prevCh = line[i-1];
|
||||
}
|
||||
|
||||
if (prevCh != 0
|
||||
&& isLegalNameCharX(startCh)
|
||||
&& isLegalNameCharX(prevCh))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (wordEnd >= lineLength
|
||||
|| !isLegalNameCharX(startCh)
|
||||
|| !isLegalNameCharX(endCh))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // end namespace astyle
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* ASEnhancer.cpp
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
// can trace only if NDEBUG is not defined
|
||||
#ifndef NDEBUG
|
||||
// #define TRACEswitch
|
||||
// #define TRACEcase
|
||||
// #define TRACEmisc
|
||||
#endif
|
||||
|
||||
#include "astyle.h"
|
||||
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
#ifdef TRACEswitch
|
||||
#define TRswitch(a,b) *traceOut << lineNumber << a << b << endl;
|
||||
#else
|
||||
#define TRswitch(a,b) ((void)0)
|
||||
#endif // TRACEswitch
|
||||
#ifdef TRACEcase
|
||||
#define TRcase(a,b) *traceOut << lineNumber << a << b << endl;
|
||||
#else
|
||||
#define TRcase(a,b) ((void)0)
|
||||
#endif // TRACEcase
|
||||
#ifdef TRACEmisc
|
||||
#define TRmisc(a) *traceOut << lineNumber << a << endl;
|
||||
#else
|
||||
#define TRmisc(a) ((void)0)
|
||||
#endif // TRACEmisc
|
||||
|
||||
|
||||
namespace astyle
|
||||
{
|
||||
|
||||
// ---------------------------- functions for ASEnhancer Class -------------------------------------
|
||||
|
||||
/**
|
||||
* ASEnhancer constructor
|
||||
*/
|
||||
ASEnhancer::ASEnhancer()
|
||||
{
|
||||
// variables are initialized by init()
|
||||
traceOut = new StringStream;
|
||||
}
|
||||
|
||||
/**
|
||||
* Destructor of ASEnhancer
|
||||
* Display the TRACE entries.
|
||||
*/
|
||||
ASEnhancer::~ASEnhancer()
|
||||
{
|
||||
#if defined(TRACEswitch) || defined(TRACEcase) || defined(TRACEmisc)
|
||||
WString line;
|
||||
WString msg = "TRACE Entries\n\n";
|
||||
char countLine[50];
|
||||
int count = 0;
|
||||
|
||||
while (getline(*traceOut, line))
|
||||
{
|
||||
msg += line + '\n';
|
||||
count++;
|
||||
}
|
||||
sprintf(countLine, "\n%d Entries", count);
|
||||
msg += countLine;
|
||||
// write a text file to "My Documents" (Windows)
|
||||
char filename [_MAX_PATH + _MAX_FNAME + _MAX_EXT + 1]; // full path and filename
|
||||
strcpy(filename, getenv("USERPROFILE"));
|
||||
strcat(filename, "\\My Documents\\tracee.txt");
|
||||
ofstream outfile(filename);
|
||||
outfile << msg;
|
||||
outfile.close();
|
||||
#endif
|
||||
delete traceOut;
|
||||
}
|
||||
|
||||
/**
|
||||
* initialize the ASEnhancer.
|
||||
*
|
||||
* init() is called each time an ASFormatter object is initialized.
|
||||
*/
|
||||
void ASEnhancer::init(int _indentLength,
|
||||
WString _indentString,
|
||||
bool _isCStyle,
|
||||
bool _isJavaStyle,
|
||||
bool _isSharpStyle,
|
||||
bool _caseIndent,
|
||||
bool _emptyLineFill)
|
||||
{
|
||||
// formatting variables from ASFormatter and ASBeautifier
|
||||
indentLength = _indentLength;
|
||||
if (_indentString[0] == '\t')
|
||||
useTabs = true;
|
||||
else
|
||||
useTabs = false;
|
||||
isCStyle = _isCStyle;
|
||||
isJavaStyle = _isJavaStyle;
|
||||
isSharpStyle = _isSharpStyle;
|
||||
caseIndent = _caseIndent;
|
||||
emptyLineFill = _emptyLineFill;
|
||||
|
||||
// unindent variables
|
||||
lineNumber = 0;
|
||||
bracketCount = 0;
|
||||
isInComment = false;
|
||||
isInQuote = false;
|
||||
switchDepth = 0;
|
||||
lookingForCaseBracket = false;
|
||||
unindentNextLine = false;
|
||||
|
||||
#if defined(TRACEswitch) || defined(TRACEcase) || defined(TRACEmisc)
|
||||
*traceOut << "New file -------------" << endl;
|
||||
#endif
|
||||
}
|
||||
|
||||
/**
|
||||
* additional formatting for line of source code.
|
||||
* every line of source code in a source code file should be sent
|
||||
* one after the other to this function.
|
||||
* indents event tables
|
||||
* unindents the case blocks
|
||||
*
|
||||
* @param line the original formatted line will be updated if necessary.
|
||||
*/
|
||||
void ASEnhancer::enhance(WString &line)
|
||||
{
|
||||
static Array<switchVariables> swVector; // stack Vector of switch variables
|
||||
static switchVariables sw; // switch variables struct
|
||||
|
||||
static bool nextLineIsEventTable; // begin event table is reached
|
||||
static bool isInEventTable; // need to indent an event table
|
||||
|
||||
bool isSpecialChar = false;
|
||||
int lineLength; // length of the line being parsed
|
||||
|
||||
lineNumber++;
|
||||
lineLength = line.GetCount();
|
||||
|
||||
// check for beginning of event table
|
||||
if (nextLineIsEventTable)
|
||||
{
|
||||
isInEventTable = true;
|
||||
nextLineIsEventTable = false;
|
||||
}
|
||||
|
||||
if (lineLength == 0
|
||||
&& ! isInEventTable
|
||||
&& ! emptyLineFill)
|
||||
return;
|
||||
|
||||
// test for unindent on attached brackets
|
||||
if (unindentNextLine)
|
||||
{
|
||||
sw.unindentDepth++;
|
||||
sw.unindentCase = true;
|
||||
unindentNextLine = false;
|
||||
TRcase(" unindent case ", sw.unindentDepth);
|
||||
}
|
||||
|
||||
// parse characters in the current line.
|
||||
|
||||
for (int i = 0; i < lineLength; i++)
|
||||
{
|
||||
char ch = line[i];
|
||||
|
||||
// bypass whitespace
|
||||
if (isWhiteSpaceX(ch))
|
||||
continue;
|
||||
|
||||
// handle special characters (i.e. backslash+character such as \n, \t, ...)
|
||||
if (isSpecialChar)
|
||||
{
|
||||
isSpecialChar = false;
|
||||
continue;
|
||||
}
|
||||
if (!(isInComment) && line.Mid(i, 2) == WString("\\\\"))
|
||||
{
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
if (!(isInComment) && ch == '\\')
|
||||
{
|
||||
isSpecialChar = true;
|
||||
continue;
|
||||
}
|
||||
|
||||
// handle quotes (such as 'x' and "Hello Dolly")
|
||||
if (!(isInComment) && (ch == '"' || ch == '\''))
|
||||
if (!isInQuote)
|
||||
{
|
||||
quoteChar = ch;
|
||||
isInQuote = true;
|
||||
}
|
||||
else if (quoteChar == ch)
|
||||
{
|
||||
isInQuote = false;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isInQuote)
|
||||
continue;
|
||||
|
||||
// handle comments
|
||||
|
||||
if (!(isInComment) && line.Mid(i, 2) == WString("//"))
|
||||
{
|
||||
// check for windows line markers
|
||||
//@@ CHECK !!!! if (line.Mid(i + 2, 1) > WString("\xf0"))
|
||||
if (line.Mid(i + 2, 1) > WString("\xf0") && line.Mid(i + 2, 1) > WString("\xff"))
|
||||
lineNumber--;
|
||||
break; // finished with the line
|
||||
}
|
||||
else if (!(isInComment) && line.Mid(i, 2) == WString("/*"))
|
||||
{
|
||||
isInComment = true;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
else if ((isInComment) && line.Mid(i, 2) == WString("*/"))
|
||||
{
|
||||
isInComment = false;
|
||||
i++;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (isInComment)
|
||||
continue;
|
||||
|
||||
// if we have reached this far then we are NOT in a comment or String of special characters
|
||||
|
||||
if (line[i] == '{') // if open bracket
|
||||
bracketCount++;
|
||||
|
||||
if (line[i] == '}') // if close bracket
|
||||
bracketCount--;
|
||||
|
||||
// ---------------- process event tables --------------------------------------
|
||||
|
||||
// check for event table begin
|
||||
if (findKeyword(line, i, "BEGIN_EVENT_TABLE")
|
||||
|| findKeyword(line, i, "BEGIN_MESSAGE_MAP"))
|
||||
nextLineIsEventTable = true;
|
||||
|
||||
// check for event table end
|
||||
if (findKeyword(line, i, "END_EVENT_TABLE")
|
||||
|| findKeyword(line, i, "END_MESSAGE_MAP"))
|
||||
isInEventTable = false;
|
||||
|
||||
// ---------------- process switch statements ---------------------------------
|
||||
|
||||
if (findKeyword(line, i, "switch")) // if switch statement
|
||||
{
|
||||
switchDepth++; // bump switch depth
|
||||
TRswitch(" switch ", switchDepth);
|
||||
swVector.push_back(sw); // save current variables
|
||||
sw.switchBracketCount = 0;
|
||||
sw.unindentCase = false; // don't clear case until end of switch
|
||||
i += 5; // bypass switch statement
|
||||
continue;
|
||||
}
|
||||
|
||||
// just want switch statements from this point
|
||||
|
||||
if (caseIndent || switchDepth == 0) // from here just want switch statements
|
||||
continue; // get next char
|
||||
|
||||
if (line[i] == '{') // if open bracket
|
||||
{
|
||||
sw.switchBracketCount++;
|
||||
if (lookingForCaseBracket) // if 1st after case statement
|
||||
{
|
||||
sw.unindentCase = true; // unindenting this case
|
||||
sw.unindentDepth++; // bump depth
|
||||
lookingForCaseBracket = false; // not looking now
|
||||
TRcase(" unindent case ", sw.unindentDepth);
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
lookingForCaseBracket = false; // no opening bracket, don't indent
|
||||
|
||||
if (line[i] == '}') // if close bracket
|
||||
{
|
||||
sw.switchBracketCount--;
|
||||
if (sw.switchBracketCount == 0) // if end of switch statement
|
||||
{
|
||||
TRswitch(" endsw ", switchDepth);
|
||||
switchDepth--; // one less switch
|
||||
sw = swVector.back(); // restore sw struct
|
||||
swVector.pop_back(); // remove last entry from stack
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
// look for case or default header
|
||||
|
||||
if (findKeyword(line, i, "case") || findKeyword(line, i, "default"))
|
||||
{
|
||||
if (sw.unindentCase) // if unindented last case
|
||||
{
|
||||
sw.unindentCase = false; // stop unindenting previous case
|
||||
sw.unindentDepth--; // reduce depth
|
||||
}
|
||||
for (; i < lineLength; i++) // bypass colon
|
||||
{
|
||||
if (line[i] == ':')
|
||||
if ((i + 1 < lineLength) && (line[i + 1] == ':'))
|
||||
i++; // bypass scope resolution operator
|
||||
else
|
||||
break;
|
||||
}
|
||||
i++;
|
||||
for (; i < lineLength; i++) // bypass whitespace
|
||||
{
|
||||
if (!(isWhiteSpaceX(line[i])))
|
||||
break;
|
||||
}
|
||||
if (i < lineLength) // check for bracket
|
||||
{
|
||||
if (line[i] == '{') // if bracket found
|
||||
{
|
||||
sw.switchBracketCount++;
|
||||
unindentNextLine = true; // start unindenting on next line
|
||||
continue;
|
||||
}
|
||||
}
|
||||
lookingForCaseBracket = true; // bracket must be on next line
|
||||
i--; // need to check for comments
|
||||
continue;
|
||||
}
|
||||
} // end of for loop
|
||||
|
||||
if (isInEventTable) // if need to indent
|
||||
indentLine(line, 1); // do it
|
||||
|
||||
if (sw.unindentDepth > 0) // if need to unindent
|
||||
unindentLine(line, sw.unindentDepth); // do it
|
||||
}
|
||||
|
||||
/**
|
||||
* indent a line by a given number of tabsets
|
||||
* by inserting leading whitespace to the line argument.
|
||||
*
|
||||
* @param line a pointer to the line to indent.
|
||||
* @param unindent the number of tabsets to insert.
|
||||
* @return the number of characters inserted.
|
||||
*/
|
||||
int ASEnhancer::indentLine(WString &line, const int indent) const
|
||||
{
|
||||
if (line.GetCount() == 0
|
||||
&& ! emptyLineFill)
|
||||
return 0;
|
||||
|
||||
int charsToInsert; // number of chars to insert
|
||||
|
||||
if (useTabs) // if formatted with tabs
|
||||
{
|
||||
charsToInsert = indent; // tabs to insert
|
||||
line.Insert(0, WString('\t', charsToInsert)); // insert the tabs
|
||||
}
|
||||
else
|
||||
{
|
||||
charsToInsert = indent * indentLength; // compute chars to insert
|
||||
line.Insert(0, WString('\t', charsToInsert)); // insert the tabs
|
||||
}
|
||||
|
||||
return charsToInsert;
|
||||
}
|
||||
|
||||
/**
|
||||
* unindent a line by a given number of tabsets
|
||||
* by erasing the leading whitespace from the line argument.
|
||||
*
|
||||
* @param line a pointer to the line to unindent.
|
||||
* @param unindent the number of tabsets to erase.
|
||||
* @return the number of characters erased.
|
||||
*/
|
||||
int ASEnhancer::unindentLine(WString &line, const int unindent) const
|
||||
{
|
||||
int whitespace = ASString_Find_First_Not_Of(line, " \t");
|
||||
if (whitespace == -1) // if line is blank
|
||||
whitespace = line.GetCount(); // must remove padding, if any
|
||||
|
||||
if (whitespace == 0)
|
||||
return 0;
|
||||
|
||||
int charsToErase; // number of chars to erase
|
||||
|
||||
if (useTabs) // if formatted with tabs
|
||||
{
|
||||
charsToErase = unindent; // tabs to erase
|
||||
if (charsToErase <= whitespace) // if there is enough whitespace
|
||||
line.Remove(0, charsToErase); // erase the tabs
|
||||
else
|
||||
charsToErase = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
charsToErase = unindent * indentLength; // compute chars to erase
|
||||
if (charsToErase <= whitespace) // if there is enough whitespace
|
||||
line.Remove(0, charsToErase); // erase the spaces
|
||||
else
|
||||
charsToErase = 0;
|
||||
}
|
||||
|
||||
return charsToErase;
|
||||
}
|
||||
|
||||
/**
|
||||
* check if a specific line position contains a keyword.
|
||||
*
|
||||
* @return true if the word was found. false if the word was not found.
|
||||
*/
|
||||
bool ASEnhancer::findKeyword(const WString &line, int i, const char *keyword) const
|
||||
{
|
||||
if (line.Mid(i, strlen(keyword)) == WString(keyword))
|
||||
{
|
||||
// check that this is a header and not a part of a longer word
|
||||
// (e.g. not at its begining, not at its middle...)
|
||||
|
||||
int lineLength = line.GetCount();
|
||||
int wordEnd = i + strlen(keyword);
|
||||
char startCh = keyword[0]; // first char of header
|
||||
char endCh = 0; // char just after header
|
||||
char prevCh = 0; // char just before header
|
||||
|
||||
if (wordEnd < lineLength)
|
||||
{
|
||||
endCh = line[wordEnd];
|
||||
}
|
||||
if (i > 0)
|
||||
{
|
||||
prevCh = line[i-1];
|
||||
}
|
||||
|
||||
if (prevCh != 0
|
||||
&& isLegalNameCharX(startCh)
|
||||
&& isLegalNameCharX(prevCh))
|
||||
{
|
||||
return false;
|
||||
}
|
||||
else if (wordEnd >= lineLength
|
||||
|| !isLegalNameCharX(startCh)
|
||||
|| !isLegalNameCharX(endCh))
|
||||
{
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
} // end namespace astyle
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,395 +1,395 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* ASResource.cpp
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
#include "astyle.h"
|
||||
|
||||
|
||||
namespace astyle
|
||||
{
|
||||
const WString ASResource::AS_IF = WString("if");
|
||||
const WString ASResource::AS_ELSE = WString("else");
|
||||
const WString ASResource::AS_FOR = WString("for");
|
||||
const WString ASResource::AS_DO = WString("do");
|
||||
const WString ASResource::AS_WHILE = WString("while");
|
||||
const WString ASResource::AS_SWITCH = WString("switch");
|
||||
const WString ASResource::AS_CASE = WString("case");
|
||||
const WString ASResource::AS_DEFAULT = WString("default");
|
||||
const WString ASResource::AS_CLASS = WString("class");
|
||||
const WString ASResource::AS_STRUCT = WString("struct");
|
||||
const WString ASResource::AS_UNION = WString("union");
|
||||
const WString ASResource::AS_INTERFACE = WString("interface");
|
||||
const WString ASResource::AS_NAMESPACE = WString("namespace");
|
||||
const WString ASResource::AS_EXTERN = WString("extern");
|
||||
const WString ASResource::AS_PUBLIC = WString("public");
|
||||
const WString ASResource::AS_PROTECTED = WString("protected");
|
||||
const WString ASResource::AS_PRIVATE = WString("private");
|
||||
const WString ASResource::AS_STATIC = WString("static");
|
||||
const WString ASResource::AS_SYNCHRONIZED = WString("synchronized");
|
||||
const WString ASResource::AS_OPERATOR = WString("operator");
|
||||
const WString ASResource::AS_TEMPLATE = WString("template");
|
||||
const WString ASResource::AS_TRY = WString("try");
|
||||
const WString ASResource::AS_CATCH = WString("catch");
|
||||
const WString ASResource::AS_FINALLY = WString("finally");
|
||||
const WString ASResource::AS_THROWS = WString("throws");
|
||||
const WString ASResource::AS_CONST = WString("const");
|
||||
|
||||
const WString ASResource::AS_ASM = WString("asm");
|
||||
|
||||
const WString ASResource::AS_BAR_DEFINE = WString("#define");
|
||||
const WString ASResource::AS_BAR_INCLUDE = WString("#include");
|
||||
const WString ASResource::AS_BAR_IF = WString("#if");
|
||||
const WString ASResource::AS_BAR_EL = WString("#el");
|
||||
const WString ASResource::AS_BAR_ENDIF = WString("#endif");
|
||||
|
||||
const WString ASResource::AS_OPEN_BRACKET = WString("{");
|
||||
const WString ASResource::AS_CLOSE_BRACKET = WString("}");
|
||||
const WString ASResource::AS_OPEN_LINE_COMMENT = WString("//");
|
||||
const WString ASResource::AS_OPEN_COMMENT = WString("/*");
|
||||
const WString ASResource::AS_CLOSE_COMMENT = WString("*/");
|
||||
|
||||
const WString ASResource::AS_ASSIGN = WString("=");
|
||||
const WString ASResource::AS_PLUS_ASSIGN = WString("+=");
|
||||
const WString ASResource::AS_MINUS_ASSIGN = WString("-=");
|
||||
const WString ASResource::AS_MULT_ASSIGN = WString("*=");
|
||||
const WString ASResource::AS_DIV_ASSIGN = WString("/=");
|
||||
const WString ASResource::AS_MOD_ASSIGN = WString("%=");
|
||||
const WString ASResource::AS_OR_ASSIGN = WString("|=");
|
||||
const WString ASResource::AS_AND_ASSIGN = WString("&=");
|
||||
const WString ASResource::AS_XOR_ASSIGN = WString("^=");
|
||||
const WString ASResource::AS_GR_GR_ASSIGN = WString(">>=");
|
||||
const WString ASResource::AS_LS_LS_ASSIGN = WString("<<=");
|
||||
const WString ASResource::AS_GR_GR_GR_ASSIGN = WString(">>>=");
|
||||
const WString ASResource::AS_LS_LS_LS_ASSIGN = WString("<<<=");
|
||||
const WString ASResource::AS_RETURN = WString("return");
|
||||
|
||||
const WString ASResource::AS_EQUAL = WString("==");
|
||||
const WString ASResource::AS_PLUS_PLUS = WString("++");
|
||||
const WString ASResource::AS_MINUS_MINUS = WString("--");
|
||||
const WString ASResource::AS_NOT_EQUAL = WString("!=");
|
||||
const WString ASResource::AS_GR_EQUAL = WString(">=");
|
||||
const WString ASResource::AS_GR_GR = WString(">>");
|
||||
const WString ASResource::AS_GR_GR_GR = WString(">>>");
|
||||
const WString ASResource::AS_LS_EQUAL = WString("<=");
|
||||
const WString ASResource::AS_LS_LS = WString("<<");
|
||||
const WString ASResource::AS_LS_LS_LS = WString("<<<");
|
||||
const WString ASResource::AS_ARROW = WString("->");
|
||||
const WString ASResource::AS_AND = WString("&&");
|
||||
const WString ASResource::AS_OR = WString("||");
|
||||
const WString ASResource::AS_COLON_COLON = WString("::");
|
||||
const WString ASResource::AS_PAREN_PAREN = WString("()");
|
||||
const WString ASResource::AS_BLPAREN_BLPAREN = WString("[]");
|
||||
|
||||
const WString ASResource::AS_PLUS = WString("+");
|
||||
const WString ASResource::AS_MINUS = WString("-");
|
||||
const WString ASResource::AS_MULT = WString("*");
|
||||
const WString ASResource::AS_DIV = WString("/");
|
||||
const WString ASResource::AS_MOD = WString("%");
|
||||
const WString ASResource::AS_GR = WString(">");
|
||||
const WString ASResource::AS_LS = WString("<");
|
||||
const WString ASResource::AS_NOT = WString("!");
|
||||
const WString ASResource::AS_BIT_OR = WString("|");
|
||||
const WString ASResource::AS_BIT_AND = WString("&");
|
||||
const WString ASResource::AS_BIT_NOT = WString("~");
|
||||
const WString ASResource::AS_BIT_XOR = WString("^");
|
||||
const WString ASResource::AS_QUESTION = WString("?");
|
||||
const WString ASResource::AS_COLON = WString(":");
|
||||
const WString ASResource::AS_COMMA = WString(",");
|
||||
const WString ASResource::AS_SEMICOLON = WString(";");
|
||||
|
||||
const WString ASResource::AS_FOREACH = WString("foreach");
|
||||
const WString ASResource::AS_LOCK = WString("lock");
|
||||
const WString ASResource::AS_UNSAFE = WString("unsafe");
|
||||
const WString ASResource::AS_FIXED = WString("fixed");
|
||||
const WString ASResource::AS_GET = WString("get");
|
||||
const WString ASResource::AS_SET = WString("set");
|
||||
const WString ASResource::AS_ADD = WString("add");
|
||||
const WString ASResource::AS_REMOVE = WString("remove");
|
||||
|
||||
const WString ASResource::AS_CONST_CAST = WString("const_cast");
|
||||
const WString ASResource::AS_DYNAMIC_CAST = WString("dynamic_cast");
|
||||
const WString ASResource::AS_REINTERPRET_CAST = WString("reinterpret_cast");
|
||||
const WString ASResource::AS_STATIC_CAST = WString("static_cast");
|
||||
|
||||
|
||||
/**
|
||||
* Build the vector of assignment operators.
|
||||
* Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
|
||||
*
|
||||
* @param assignmentOperators a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildAssignmentOperators(Vector<const WString*> &assignmentOperators)
|
||||
{
|
||||
assignmentOperators.push_back(&AS_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_PLUS_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_MINUS_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_MULT_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_DIV_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_MOD_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_OR_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_AND_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_XOR_ASSIGN);
|
||||
|
||||
// Java
|
||||
assignmentOperators.push_back(&AS_GR_GR_GR_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_GR_GR_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_LS_LS_ASSIGN);
|
||||
|
||||
// Unknown
|
||||
assignmentOperators.push_back(&AS_LS_LS_LS_ASSIGN);
|
||||
|
||||
assignmentOperators.push_back(&AS_RETURN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of C++ cast operators.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param castOperators a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildCastOperators(Vector<const WString*> &castOperators)
|
||||
{
|
||||
castOperators.push_back(&AS_CONST_CAST);
|
||||
castOperators.push_back(&AS_DYNAMIC_CAST);
|
||||
castOperators.push_back(&AS_REINTERPRET_CAST);
|
||||
castOperators.push_back(&AS_STATIC_CAST);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of header words.
|
||||
* Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
|
||||
*
|
||||
* @param headers a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildHeaders(Vector<const WString*> &headers, int fileType, bool beautifier)
|
||||
{
|
||||
headers.push_back(&AS_IF);
|
||||
headers.push_back(&AS_ELSE);
|
||||
headers.push_back(&AS_FOR);
|
||||
headers.push_back(&AS_WHILE);
|
||||
headers.push_back(&AS_DO);
|
||||
headers.push_back(&AS_SWITCH);
|
||||
headers.push_back(&AS_TRY);
|
||||
headers.push_back(&AS_CATCH);
|
||||
|
||||
if (beautifier)
|
||||
{
|
||||
headers.push_back(&AS_CASE);
|
||||
headers.push_back(&AS_DEFAULT);
|
||||
headers.push_back(&AS_CONST);
|
||||
headers.push_back(&AS_STATIC);
|
||||
headers.push_back(&AS_EXTERN);
|
||||
headers.push_back(&AS_TEMPLATE);
|
||||
}
|
||||
|
||||
if (fileType == JAVA_TYPE)
|
||||
{
|
||||
headers.push_back(&AS_FINALLY);
|
||||
headers.push_back(&AS_SYNCHRONIZED);
|
||||
}
|
||||
|
||||
if (fileType == SHARP_TYPE)
|
||||
{
|
||||
headers.push_back(&AS_FINALLY);
|
||||
headers.push_back(&AS_FOREACH);
|
||||
headers.push_back(&AS_LOCK);
|
||||
headers.push_back(&AS_UNSAFE);
|
||||
headers.push_back(&AS_FIXED);
|
||||
headers.push_back(&AS_GET);
|
||||
headers.push_back(&AS_SET);
|
||||
headers.push_back(&AS_ADD);
|
||||
headers.push_back(&AS_REMOVE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of non-assignment operators.
|
||||
* Used by ONLY ASBeautifier.cpp
|
||||
*
|
||||
* @param nonParenHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildNonAssignmentOperators(Vector<const WString*> &nonAssignmentOperators)
|
||||
{
|
||||
nonAssignmentOperators.push_back(&AS_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_PLUS_PLUS);
|
||||
nonAssignmentOperators.push_back(&AS_MINUS_MINUS);
|
||||
nonAssignmentOperators.push_back(&AS_NOT_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_GR_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_GR_GR_GR);
|
||||
nonAssignmentOperators.push_back(&AS_GR_GR);
|
||||
nonAssignmentOperators.push_back(&AS_LS_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_LS_LS_LS);
|
||||
nonAssignmentOperators.push_back(&AS_LS_LS);
|
||||
nonAssignmentOperators.push_back(&AS_ARROW);
|
||||
nonAssignmentOperators.push_back(&AS_AND);
|
||||
nonAssignmentOperators.push_back(&AS_OR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of header non-paren headers.
|
||||
* Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
|
||||
*
|
||||
* @param nonParenHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildNonParenHeaders(Vector<const WString*> &nonParenHeaders, int fileType, bool beautifier)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_ELSE);
|
||||
nonParenHeaders.push_back(&AS_DO);
|
||||
nonParenHeaders.push_back(&AS_TRY);
|
||||
|
||||
if (beautifier)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_CASE);
|
||||
nonParenHeaders.push_back(&AS_DEFAULT);
|
||||
nonParenHeaders.push_back(&AS_CONST);
|
||||
nonParenHeaders.push_back(&AS_STATIC);
|
||||
nonParenHeaders.push_back(&AS_EXTERN);
|
||||
nonParenHeaders.push_back(&AS_TEMPLATE);
|
||||
}
|
||||
|
||||
if (fileType == JAVA_TYPE)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_FINALLY);
|
||||
}
|
||||
|
||||
if (fileType == SHARP_TYPE)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_FINALLY);
|
||||
nonParenHeaders.push_back(&AS_UNSAFE);
|
||||
nonParenHeaders.push_back(&AS_GET);
|
||||
nonParenHeaders.push_back(&AS_SET);
|
||||
nonParenHeaders.push_back(&AS_ADD);
|
||||
nonParenHeaders.push_back(&AS_REMOVE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of operators.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param operators a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildOperators(Vector<const WString*> &operators)
|
||||
{
|
||||
operators.push_back(&AS_PLUS_ASSIGN);
|
||||
operators.push_back(&AS_MINUS_ASSIGN);
|
||||
operators.push_back(&AS_MULT_ASSIGN);
|
||||
operators.push_back(&AS_DIV_ASSIGN);
|
||||
operators.push_back(&AS_MOD_ASSIGN);
|
||||
operators.push_back(&AS_OR_ASSIGN);
|
||||
operators.push_back(&AS_AND_ASSIGN);
|
||||
operators.push_back(&AS_XOR_ASSIGN);
|
||||
operators.push_back(&AS_EQUAL);
|
||||
operators.push_back(&AS_PLUS_PLUS);
|
||||
operators.push_back(&AS_MINUS_MINUS);
|
||||
operators.push_back(&AS_NOT_EQUAL);
|
||||
operators.push_back(&AS_GR_EQUAL);
|
||||
operators.push_back(&AS_GR_GR_GR_ASSIGN);
|
||||
operators.push_back(&AS_GR_GR_ASSIGN);
|
||||
operators.push_back(&AS_GR_GR_GR);
|
||||
operators.push_back(&AS_GR_GR);
|
||||
operators.push_back(&AS_LS_EQUAL);
|
||||
operators.push_back(&AS_LS_LS_LS_ASSIGN);
|
||||
operators.push_back(&AS_LS_LS_ASSIGN);
|
||||
operators.push_back(&AS_LS_LS_LS);
|
||||
operators.push_back(&AS_LS_LS);
|
||||
operators.push_back(&AS_ARROW);
|
||||
operators.push_back(&AS_AND);
|
||||
operators.push_back(&AS_OR);
|
||||
operators.push_back(&AS_COLON_COLON);
|
||||
operators.push_back(&AS_PLUS);
|
||||
operators.push_back(&AS_MINUS);
|
||||
operators.push_back(&AS_MULT);
|
||||
operators.push_back(&AS_DIV);
|
||||
operators.push_back(&AS_MOD);
|
||||
operators.push_back(&AS_QUESTION);
|
||||
operators.push_back(&AS_COLON);
|
||||
operators.push_back(&AS_ASSIGN);
|
||||
operators.push_back(&AS_LS);
|
||||
operators.push_back(&AS_GR);
|
||||
operators.push_back(&AS_NOT);
|
||||
operators.push_back(&AS_BIT_OR);
|
||||
operators.push_back(&AS_BIT_AND);
|
||||
operators.push_back(&AS_BIT_NOT);
|
||||
operators.push_back(&AS_BIT_XOR);
|
||||
operators.push_back(&AS_OPERATOR);
|
||||
operators.push_back(&AS_COMMA);
|
||||
operators.push_back(&AS_RETURN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of pre-block statements.
|
||||
* Used by ONLY ASBeautifier.cpp
|
||||
*
|
||||
* @param preBlockStatements a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildPreBlockStatements(Vector<const WString*> &preBlockStatements)
|
||||
{
|
||||
preBlockStatements.push_back(&AS_CLASS);
|
||||
preBlockStatements.push_back(&AS_STRUCT);
|
||||
preBlockStatements.push_back(&AS_UNION);
|
||||
preBlockStatements.push_back(&AS_INTERFACE);
|
||||
preBlockStatements.push_back(&AS_NAMESPACE);
|
||||
preBlockStatements.push_back(&AS_THROWS);
|
||||
preBlockStatements.push_back(&AS_EXTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of pre-command headers.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param preCommandHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildPreCommandHeaders(Vector<const WString*> &preCommandHeaders)
|
||||
{
|
||||
preCommandHeaders.push_back(&AS_EXTERN);
|
||||
preCommandHeaders.push_back(&AS_THROWS);
|
||||
preCommandHeaders.push_back(&AS_CONST);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of pre-definition headers.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param preDefinitionHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildPreDefinitionHeaders(Vector<const WString*> &preDefinitionHeaders)
|
||||
{
|
||||
preDefinitionHeaders.push_back(&AS_CLASS);
|
||||
preDefinitionHeaders.push_back(&AS_INTERFACE);
|
||||
preDefinitionHeaders.push_back(&AS_NAMESPACE);
|
||||
preDefinitionHeaders.push_back(&AS_STRUCT);
|
||||
}
|
||||
|
||||
|
||||
} // end namespace astyle
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* ASResource.cpp
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
#include "astyle.h"
|
||||
|
||||
|
||||
namespace astyle
|
||||
{
|
||||
const WString ASResource::AS_IF = WString("if");
|
||||
const WString ASResource::AS_ELSE = WString("else");
|
||||
const WString ASResource::AS_FOR = WString("for");
|
||||
const WString ASResource::AS_DO = WString("do");
|
||||
const WString ASResource::AS_WHILE = WString("while");
|
||||
const WString ASResource::AS_SWITCH = WString("switch");
|
||||
const WString ASResource::AS_CASE = WString("case");
|
||||
const WString ASResource::AS_DEFAULT = WString("default");
|
||||
const WString ASResource::AS_CLASS = WString("class");
|
||||
const WString ASResource::AS_STRUCT = WString("struct");
|
||||
const WString ASResource::AS_UNION = WString("union");
|
||||
const WString ASResource::AS_INTERFACE = WString("interface");
|
||||
const WString ASResource::AS_NAMESPACE = WString("namespace");
|
||||
const WString ASResource::AS_EXTERN = WString("extern");
|
||||
const WString ASResource::AS_PUBLIC = WString("public");
|
||||
const WString ASResource::AS_PROTECTED = WString("protected");
|
||||
const WString ASResource::AS_PRIVATE = WString("private");
|
||||
const WString ASResource::AS_STATIC = WString("static");
|
||||
const WString ASResource::AS_SYNCHRONIZED = WString("synchronized");
|
||||
const WString ASResource::AS_OPERATOR = WString("operator");
|
||||
const WString ASResource::AS_TEMPLATE = WString("template");
|
||||
const WString ASResource::AS_TRY = WString("try");
|
||||
const WString ASResource::AS_CATCH = WString("catch");
|
||||
const WString ASResource::AS_FINALLY = WString("finally");
|
||||
const WString ASResource::AS_THROWS = WString("throws");
|
||||
const WString ASResource::AS_CONST = WString("const");
|
||||
|
||||
const WString ASResource::AS_ASM = WString("asm");
|
||||
|
||||
const WString ASResource::AS_BAR_DEFINE = WString("#define");
|
||||
const WString ASResource::AS_BAR_INCLUDE = WString("#include");
|
||||
const WString ASResource::AS_BAR_IF = WString("#if");
|
||||
const WString ASResource::AS_BAR_EL = WString("#el");
|
||||
const WString ASResource::AS_BAR_ENDIF = WString("#endif");
|
||||
|
||||
const WString ASResource::AS_OPEN_BRACKET = WString("{");
|
||||
const WString ASResource::AS_CLOSE_BRACKET = WString("}");
|
||||
const WString ASResource::AS_OPEN_LINE_COMMENT = WString("//");
|
||||
const WString ASResource::AS_OPEN_COMMENT = WString("/*");
|
||||
const WString ASResource::AS_CLOSE_COMMENT = WString("*/");
|
||||
|
||||
const WString ASResource::AS_ASSIGN = WString("=");
|
||||
const WString ASResource::AS_PLUS_ASSIGN = WString("+=");
|
||||
const WString ASResource::AS_MINUS_ASSIGN = WString("-=");
|
||||
const WString ASResource::AS_MULT_ASSIGN = WString("*=");
|
||||
const WString ASResource::AS_DIV_ASSIGN = WString("/=");
|
||||
const WString ASResource::AS_MOD_ASSIGN = WString("%=");
|
||||
const WString ASResource::AS_OR_ASSIGN = WString("|=");
|
||||
const WString ASResource::AS_AND_ASSIGN = WString("&=");
|
||||
const WString ASResource::AS_XOR_ASSIGN = WString("^=");
|
||||
const WString ASResource::AS_GR_GR_ASSIGN = WString(">>=");
|
||||
const WString ASResource::AS_LS_LS_ASSIGN = WString("<<=");
|
||||
const WString ASResource::AS_GR_GR_GR_ASSIGN = WString(">>>=");
|
||||
const WString ASResource::AS_LS_LS_LS_ASSIGN = WString("<<<=");
|
||||
const WString ASResource::AS_RETURN = WString("return");
|
||||
|
||||
const WString ASResource::AS_EQUAL = WString("==");
|
||||
const WString ASResource::AS_PLUS_PLUS = WString("++");
|
||||
const WString ASResource::AS_MINUS_MINUS = WString("--");
|
||||
const WString ASResource::AS_NOT_EQUAL = WString("!=");
|
||||
const WString ASResource::AS_GR_EQUAL = WString(">=");
|
||||
const WString ASResource::AS_GR_GR = WString(">>");
|
||||
const WString ASResource::AS_GR_GR_GR = WString(">>>");
|
||||
const WString ASResource::AS_LS_EQUAL = WString("<=");
|
||||
const WString ASResource::AS_LS_LS = WString("<<");
|
||||
const WString ASResource::AS_LS_LS_LS = WString("<<<");
|
||||
const WString ASResource::AS_ARROW = WString("->");
|
||||
const WString ASResource::AS_AND = WString("&&");
|
||||
const WString ASResource::AS_OR = WString("||");
|
||||
const WString ASResource::AS_COLON_COLON = WString("::");
|
||||
const WString ASResource::AS_PAREN_PAREN = WString("()");
|
||||
const WString ASResource::AS_BLPAREN_BLPAREN = WString("[]");
|
||||
|
||||
const WString ASResource::AS_PLUS = WString("+");
|
||||
const WString ASResource::AS_MINUS = WString("-");
|
||||
const WString ASResource::AS_MULT = WString("*");
|
||||
const WString ASResource::AS_DIV = WString("/");
|
||||
const WString ASResource::AS_MOD = WString("%");
|
||||
const WString ASResource::AS_GR = WString(">");
|
||||
const WString ASResource::AS_LS = WString("<");
|
||||
const WString ASResource::AS_NOT = WString("!");
|
||||
const WString ASResource::AS_BIT_OR = WString("|");
|
||||
const WString ASResource::AS_BIT_AND = WString("&");
|
||||
const WString ASResource::AS_BIT_NOT = WString("~");
|
||||
const WString ASResource::AS_BIT_XOR = WString("^");
|
||||
const WString ASResource::AS_QUESTION = WString("?");
|
||||
const WString ASResource::AS_COLON = WString(":");
|
||||
const WString ASResource::AS_COMMA = WString(",");
|
||||
const WString ASResource::AS_SEMICOLON = WString(";");
|
||||
|
||||
const WString ASResource::AS_FOREACH = WString("foreach");
|
||||
const WString ASResource::AS_LOCK = WString("lock");
|
||||
const WString ASResource::AS_UNSAFE = WString("unsafe");
|
||||
const WString ASResource::AS_FIXED = WString("fixed");
|
||||
const WString ASResource::AS_GET = WString("get");
|
||||
const WString ASResource::AS_SET = WString("set");
|
||||
const WString ASResource::AS_ADD = WString("add");
|
||||
const WString ASResource::AS_REMOVE = WString("remove");
|
||||
|
||||
const WString ASResource::AS_CONST_CAST = WString("const_cast");
|
||||
const WString ASResource::AS_DYNAMIC_CAST = WString("dynamic_cast");
|
||||
const WString ASResource::AS_REINTERPRET_CAST = WString("reinterpret_cast");
|
||||
const WString ASResource::AS_STATIC_CAST = WString("static_cast");
|
||||
|
||||
|
||||
/**
|
||||
* Build the vector of assignment operators.
|
||||
* Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
|
||||
*
|
||||
* @param assignmentOperators a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildAssignmentOperators(Vector<const WString*> &assignmentOperators)
|
||||
{
|
||||
assignmentOperators.push_back(&AS_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_PLUS_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_MINUS_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_MULT_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_DIV_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_MOD_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_OR_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_AND_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_XOR_ASSIGN);
|
||||
|
||||
// Java
|
||||
assignmentOperators.push_back(&AS_GR_GR_GR_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_GR_GR_ASSIGN);
|
||||
assignmentOperators.push_back(&AS_LS_LS_ASSIGN);
|
||||
|
||||
// Unknown
|
||||
assignmentOperators.push_back(&AS_LS_LS_LS_ASSIGN);
|
||||
|
||||
assignmentOperators.push_back(&AS_RETURN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of C++ cast operators.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param castOperators a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildCastOperators(Vector<const WString*> &castOperators)
|
||||
{
|
||||
castOperators.push_back(&AS_CONST_CAST);
|
||||
castOperators.push_back(&AS_DYNAMIC_CAST);
|
||||
castOperators.push_back(&AS_REINTERPRET_CAST);
|
||||
castOperators.push_back(&AS_STATIC_CAST);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of header words.
|
||||
* Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
|
||||
*
|
||||
* @param headers a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildHeaders(Vector<const WString*> &headers, int fileType, bool beautifier)
|
||||
{
|
||||
headers.push_back(&AS_IF);
|
||||
headers.push_back(&AS_ELSE);
|
||||
headers.push_back(&AS_FOR);
|
||||
headers.push_back(&AS_WHILE);
|
||||
headers.push_back(&AS_DO);
|
||||
headers.push_back(&AS_SWITCH);
|
||||
headers.push_back(&AS_TRY);
|
||||
headers.push_back(&AS_CATCH);
|
||||
|
||||
if (beautifier)
|
||||
{
|
||||
headers.push_back(&AS_CASE);
|
||||
headers.push_back(&AS_DEFAULT);
|
||||
headers.push_back(&AS_CONST);
|
||||
headers.push_back(&AS_STATIC);
|
||||
headers.push_back(&AS_EXTERN);
|
||||
headers.push_back(&AS_TEMPLATE);
|
||||
}
|
||||
|
||||
if (fileType == JAVA_TYPE)
|
||||
{
|
||||
headers.push_back(&AS_FINALLY);
|
||||
headers.push_back(&AS_SYNCHRONIZED);
|
||||
}
|
||||
|
||||
if (fileType == SHARP_TYPE)
|
||||
{
|
||||
headers.push_back(&AS_FINALLY);
|
||||
headers.push_back(&AS_FOREACH);
|
||||
headers.push_back(&AS_LOCK);
|
||||
headers.push_back(&AS_UNSAFE);
|
||||
headers.push_back(&AS_FIXED);
|
||||
headers.push_back(&AS_GET);
|
||||
headers.push_back(&AS_SET);
|
||||
headers.push_back(&AS_ADD);
|
||||
headers.push_back(&AS_REMOVE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of non-assignment operators.
|
||||
* Used by ONLY ASBeautifier.cpp
|
||||
*
|
||||
* @param nonParenHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildNonAssignmentOperators(Vector<const WString*> &nonAssignmentOperators)
|
||||
{
|
||||
nonAssignmentOperators.push_back(&AS_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_PLUS_PLUS);
|
||||
nonAssignmentOperators.push_back(&AS_MINUS_MINUS);
|
||||
nonAssignmentOperators.push_back(&AS_NOT_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_GR_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_GR_GR_GR);
|
||||
nonAssignmentOperators.push_back(&AS_GR_GR);
|
||||
nonAssignmentOperators.push_back(&AS_LS_EQUAL);
|
||||
nonAssignmentOperators.push_back(&AS_LS_LS_LS);
|
||||
nonAssignmentOperators.push_back(&AS_LS_LS);
|
||||
nonAssignmentOperators.push_back(&AS_ARROW);
|
||||
nonAssignmentOperators.push_back(&AS_AND);
|
||||
nonAssignmentOperators.push_back(&AS_OR);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of header non-paren headers.
|
||||
* Used by BOTH ASFormatter.cpp and ASBeautifier.cpp
|
||||
*
|
||||
* @param nonParenHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildNonParenHeaders(Vector<const WString*> &nonParenHeaders, int fileType, bool beautifier)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_ELSE);
|
||||
nonParenHeaders.push_back(&AS_DO);
|
||||
nonParenHeaders.push_back(&AS_TRY);
|
||||
|
||||
if (beautifier)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_CASE);
|
||||
nonParenHeaders.push_back(&AS_DEFAULT);
|
||||
nonParenHeaders.push_back(&AS_CONST);
|
||||
nonParenHeaders.push_back(&AS_STATIC);
|
||||
nonParenHeaders.push_back(&AS_EXTERN);
|
||||
nonParenHeaders.push_back(&AS_TEMPLATE);
|
||||
}
|
||||
|
||||
if (fileType == JAVA_TYPE)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_FINALLY);
|
||||
}
|
||||
|
||||
if (fileType == SHARP_TYPE)
|
||||
{
|
||||
nonParenHeaders.push_back(&AS_FINALLY);
|
||||
nonParenHeaders.push_back(&AS_UNSAFE);
|
||||
nonParenHeaders.push_back(&AS_GET);
|
||||
nonParenHeaders.push_back(&AS_SET);
|
||||
nonParenHeaders.push_back(&AS_ADD);
|
||||
nonParenHeaders.push_back(&AS_REMOVE);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of operators.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param operators a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildOperators(Vector<const WString*> &operators)
|
||||
{
|
||||
operators.push_back(&AS_PLUS_ASSIGN);
|
||||
operators.push_back(&AS_MINUS_ASSIGN);
|
||||
operators.push_back(&AS_MULT_ASSIGN);
|
||||
operators.push_back(&AS_DIV_ASSIGN);
|
||||
operators.push_back(&AS_MOD_ASSIGN);
|
||||
operators.push_back(&AS_OR_ASSIGN);
|
||||
operators.push_back(&AS_AND_ASSIGN);
|
||||
operators.push_back(&AS_XOR_ASSIGN);
|
||||
operators.push_back(&AS_EQUAL);
|
||||
operators.push_back(&AS_PLUS_PLUS);
|
||||
operators.push_back(&AS_MINUS_MINUS);
|
||||
operators.push_back(&AS_NOT_EQUAL);
|
||||
operators.push_back(&AS_GR_EQUAL);
|
||||
operators.push_back(&AS_GR_GR_GR_ASSIGN);
|
||||
operators.push_back(&AS_GR_GR_ASSIGN);
|
||||
operators.push_back(&AS_GR_GR_GR);
|
||||
operators.push_back(&AS_GR_GR);
|
||||
operators.push_back(&AS_LS_EQUAL);
|
||||
operators.push_back(&AS_LS_LS_LS_ASSIGN);
|
||||
operators.push_back(&AS_LS_LS_ASSIGN);
|
||||
operators.push_back(&AS_LS_LS_LS);
|
||||
operators.push_back(&AS_LS_LS);
|
||||
operators.push_back(&AS_ARROW);
|
||||
operators.push_back(&AS_AND);
|
||||
operators.push_back(&AS_OR);
|
||||
operators.push_back(&AS_COLON_COLON);
|
||||
operators.push_back(&AS_PLUS);
|
||||
operators.push_back(&AS_MINUS);
|
||||
operators.push_back(&AS_MULT);
|
||||
operators.push_back(&AS_DIV);
|
||||
operators.push_back(&AS_MOD);
|
||||
operators.push_back(&AS_QUESTION);
|
||||
operators.push_back(&AS_COLON);
|
||||
operators.push_back(&AS_ASSIGN);
|
||||
operators.push_back(&AS_LS);
|
||||
operators.push_back(&AS_GR);
|
||||
operators.push_back(&AS_NOT);
|
||||
operators.push_back(&AS_BIT_OR);
|
||||
operators.push_back(&AS_BIT_AND);
|
||||
operators.push_back(&AS_BIT_NOT);
|
||||
operators.push_back(&AS_BIT_XOR);
|
||||
operators.push_back(&AS_OPERATOR);
|
||||
operators.push_back(&AS_COMMA);
|
||||
operators.push_back(&AS_RETURN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of pre-block statements.
|
||||
* Used by ONLY ASBeautifier.cpp
|
||||
*
|
||||
* @param preBlockStatements a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildPreBlockStatements(Vector<const WString*> &preBlockStatements)
|
||||
{
|
||||
preBlockStatements.push_back(&AS_CLASS);
|
||||
preBlockStatements.push_back(&AS_STRUCT);
|
||||
preBlockStatements.push_back(&AS_UNION);
|
||||
preBlockStatements.push_back(&AS_INTERFACE);
|
||||
preBlockStatements.push_back(&AS_NAMESPACE);
|
||||
preBlockStatements.push_back(&AS_THROWS);
|
||||
preBlockStatements.push_back(&AS_EXTERN);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of pre-command headers.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param preCommandHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildPreCommandHeaders(Vector<const WString*> &preCommandHeaders)
|
||||
{
|
||||
preCommandHeaders.push_back(&AS_EXTERN);
|
||||
preCommandHeaders.push_back(&AS_THROWS);
|
||||
preCommandHeaders.push_back(&AS_CONST);
|
||||
}
|
||||
|
||||
/**
|
||||
* Build the vector of pre-definition headers.
|
||||
* Used by ONLY ASFormatter.cpp
|
||||
*
|
||||
* @param preDefinitionHeaders a reference to the vector to be built.
|
||||
*/
|
||||
void ASResource::buildPreDefinitionHeaders(Vector<const WString*> &preDefinitionHeaders)
|
||||
{
|
||||
preDefinitionHeaders.push_back(&AS_CLASS);
|
||||
preDefinitionHeaders.push_back(&AS_INTERFACE);
|
||||
preDefinitionHeaders.push_back(&AS_NAMESPACE);
|
||||
preDefinitionHeaders.push_back(&AS_STRUCT);
|
||||
}
|
||||
|
||||
|
||||
} // end namespace astyle
|
||||
|
|
|
|||
|
|
@ -1,86 +1,86 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* astyle.h
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
#include "ASStringTools.hpp"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Replaces a chunk in a string with a new string
|
||||
void ASString_Replace(WString &s, int Pos, int Len, WString const &newString)
|
||||
{
|
||||
if(Pos < 0 || Pos >= s.GetCount())
|
||||
return;
|
||||
s.Remove(Pos, Len);
|
||||
s.Insert(Pos, newString);
|
||||
|
||||
} // END ASString_Replace()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find first character in a string *not* contained in another string
|
||||
int ASString_Find_First_Not_Of(WString const &s, WString const &Pattern, int pos)
|
||||
{
|
||||
if(pos < 0 || pos >= s.GetCount())
|
||||
return -1;
|
||||
int len = s.GetCount();
|
||||
while(pos < len && Pattern.Find(s[pos]) != -1)
|
||||
pos++;
|
||||
if(pos < len)
|
||||
return pos;
|
||||
else
|
||||
return -1;
|
||||
|
||||
} // END ASString_Find_First_Not_Of()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find last character in a string *not* contained in another string
|
||||
int ASString_Find_Last_Not_Of(WString const &s, WString const &Pattern, int pos)
|
||||
{
|
||||
if(pos < 0 || pos >= s.GetCount())
|
||||
pos = s.GetCount() -1;
|
||||
while(pos > 0 && Pattern.Find(s[pos]) != -1)
|
||||
pos--;
|
||||
return pos;
|
||||
|
||||
} // END ASString_Find_Last_Not_Of()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Finds a substring starting at the end of a given string
|
||||
int ASString_ReverseFind(WString const &s, WString const &Pattern)
|
||||
{
|
||||
int pos = -1;
|
||||
int k = 0;
|
||||
while( (k = s.Find(Pattern, k)) >= 0)
|
||||
pos = k++;
|
||||
return pos;
|
||||
|
||||
} // END ASString_ReverseFind()
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* astyle.h
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
#include "ASStringTools.hpp"
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Replaces a chunk in a string with a new string
|
||||
void ASString_Replace(WString &s, int Pos, int Len, WString const &newString)
|
||||
{
|
||||
if(Pos < 0 || Pos >= s.GetCount())
|
||||
return;
|
||||
s.Remove(Pos, Len);
|
||||
s.Insert(Pos, newString);
|
||||
|
||||
} // END ASString_Replace()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find first character in a string *not* contained in another string
|
||||
int ASString_Find_First_Not_Of(WString const &s, WString const &Pattern, int pos)
|
||||
{
|
||||
if(pos < 0 || pos >= s.GetCount())
|
||||
return -1;
|
||||
int len = s.GetCount();
|
||||
while(pos < len && Pattern.Find(s[pos]) != -1)
|
||||
pos++;
|
||||
if(pos < len)
|
||||
return pos;
|
||||
else
|
||||
return -1;
|
||||
|
||||
} // END ASString_Find_First_Not_Of()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find last character in a string *not* contained in another string
|
||||
int ASString_Find_Last_Not_Of(WString const &s, WString const &Pattern, int pos)
|
||||
{
|
||||
if(pos < 0 || pos >= s.GetCount())
|
||||
pos = s.GetCount() -1;
|
||||
while(pos > 0 && Pattern.Find(s[pos]) != -1)
|
||||
pos--;
|
||||
return pos;
|
||||
|
||||
} // END ASString_Find_Last_Not_Of()
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Finds a substring starting at the end of a given string
|
||||
int ASString_ReverseFind(WString const &s, WString const &Pattern)
|
||||
{
|
||||
int pos = -1;
|
||||
int k = 0;
|
||||
while( (k = s.Find(Pattern, k)) >= 0)
|
||||
pos = k++;
|
||||
return pos;
|
||||
|
||||
} // END ASString_ReverseFind()
|
||||
|
|
|
|||
|
|
@ -1,58 +1,58 @@
|
|||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* astyle.h
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
#ifndef __ASSTRINGTOOLS_HPP
|
||||
#define __ASSTRINGTOOLS_HPP
|
||||
|
||||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Replaces a chunk in a string with a new string
|
||||
void ASString_Replace(WString &s, int Pos, int Len, WString const &newString);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find first character in a string *not* contained in another string
|
||||
int ASString_Find_First_Not_Of(WString const &s, WString const &Pattern, int from = 0);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find last character in a string *not* contained in another string
|
||||
int ASString_Find_Last_Not_Of(WString const &s, WString const &Pattern, int from = -1);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Finds a substring starting at the end of a given string
|
||||
int ASString_ReverseFind(WString const &s, WString const &Pattern);
|
||||
|
||||
#endif
|
||||
/* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*
|
||||
* astyle.h
|
||||
*
|
||||
* This file is a part of "Artistic Style" - an indentation and
|
||||
* reformatting tool for C, C++, C# and Java source files.
|
||||
* http://astyle.sourceforge.net
|
||||
*
|
||||
* The "Artistic Style" project, including all files needed to
|
||||
* compile it, is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU Lesser General Public
|
||||
* License as published by the Free Software Foundation; either
|
||||
* version 2.1 of the License, or (at your option) any later
|
||||
* version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU Lesser General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU Lesser General Public
|
||||
* License along with this project; if not, write to the
|
||||
* Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
|
||||
* Boston, MA 02110-1301, USA.
|
||||
*
|
||||
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
*/
|
||||
|
||||
/*
|
||||
2008-01-26 Patches by Massimo Del Fedele :
|
||||
- modified sources to use Ultimate++ containers instead std:: ones
|
||||
- fixed memory leaks based on bug report 1804791 submitted by Eran Ifrah
|
||||
- modified to work with unicode
|
||||
*/
|
||||
#ifndef __ASSTRINGTOOLS_HPP
|
||||
#define __ASSTRINGTOOLS_HPP
|
||||
|
||||
#include <Core/Core.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Replaces a chunk in a string with a new string
|
||||
void ASString_Replace(WString &s, int Pos, int Len, WString const &newString);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find first character in a string *not* contained in another string
|
||||
int ASString_Find_First_Not_Of(WString const &s, WString const &Pattern, int from = 0);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Find last character in a string *not* contained in another string
|
||||
int ASString_Find_Last_Not_Of(WString const &s, WString const &Pattern, int from = -1);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////////////////
|
||||
// Finds a substring starting at the end of a given string
|
||||
int ASString_ReverseFind(WString const &s, WString const &Pattern);
|
||||
|
||||
#endif
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -1,12 +1,12 @@
|
|||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
ASStringTools.hpp,
|
||||
ASStringTools.cpp,
|
||||
astyle.h,
|
||||
ASBeautifier.cpp,
|
||||
ASEnhancer.cpp,
|
||||
ASFormatter.cpp,
|
||||
ASResource.cpp;
|
||||
|
||||
uses
|
||||
Core;
|
||||
|
||||
file
|
||||
ASStringTools.hpp,
|
||||
ASStringTools.cpp,
|
||||
astyle.h,
|
||||
ASBeautifier.cpp,
|
||||
ASEnhancer.cpp,
|
||||
ASFormatter.cpp,
|
||||
ASResource.cpp;
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
|
|
@ -4,3 +4,4 @@ uses
|
|||
file
|
||||
dbf.h,
|
||||
dbf.cpp;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
file
|
||||
pcx.h,
|
||||
pcxhdr.h,
|
||||
pcx.cpp,
|
||||
pcxreg.icpp;
|
||||
|
||||
file
|
||||
pcx.h,
|
||||
pcxhdr.h,
|
||||
pcx.cpp,
|
||||
pcxreg.icpp;
|
||||
|
||||
|
|
|
|||
|
|
@ -1,7 +1,7 @@
|
|||
Copyright (c) 1988-1997 Sam Leffler
|
||||
Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and
|
||||
Permission to use, copy, modify, distribute, and sell this software and
|
||||
its documentation for any purpose is hereby granted without fee, provided
|
||||
that (i) the above copyright notices and this permission notice appear in
|
||||
all copies of the software and related documentation, and (ii) the names of
|
||||
|
|
@ -9,13 +9,13 @@ Sam Leffler and Silicon Graphics may not be used in any advertising or
|
|||
publicity relating to the software without the specific, prior written
|
||||
permission of Sam Leffler and Silicon Graphics.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
OF THIS SOFTWARE.
|
||||
|
|
|
|||
|
|
@ -1,57 +1,57 @@
|
|||
HOWTO-RELEASE:
|
||||
|
||||
Notes on releasing. You will need appropriate autoconf, automake and libtool
|
||||
utilities to release a package.
|
||||
|
||||
1. Commit any unsaved changes.
|
||||
|
||||
2. "make clean"
|
||||
|
||||
3. Create html/vX.X.html. Take ChangeLog entries and html-ify in there.
|
||||
Easist thing to do is take html/vX.(X-1).html and use it as a template.
|
||||
Add that file to the list of EXTRA_DIST files in the html/Makefile.am.
|
||||
|
||||
3.5. Update html/index.html to refer to this new page as the current release.
|
||||
|
||||
4. Increment version in configure.ac. Put 'alpha' or 'beta' after
|
||||
the version, if applicable.
|
||||
|
||||
eg.
|
||||
3.5.7
|
||||
or
|
||||
3.5.8beta
|
||||
|
||||
Version should be updated in two places: in the second argument of the
|
||||
AC_INIT macro and in LIBTIFF_xxx_VERSION variables.
|
||||
|
||||
5. autoconf
|
||||
|
||||
6. sh configure
|
||||
|
||||
7. make release -- this will update "RELEASE-DATE" and "VERSION" in the top
|
||||
level dir, and libtiff/tiffvers.h.
|
||||
|
||||
8. Please verify that the version info in RELEASE-DATE, VERSION and
|
||||
libtiff/tiffvers.h is right.
|
||||
|
||||
9. make; make distcheck (to test).
|
||||
|
||||
10. make distclean
|
||||
|
||||
11. cvs commit
|
||||
|
||||
12. cvs tag Release-v3-5-7 (or the appropriate name for the release)
|
||||
|
||||
13. configure; make dist
|
||||
Two files with names tiff-version.tar.gz and tiff-version.zip will
|
||||
be created in the top level package directory.
|
||||
|
||||
14. Copy to ftp.remotesensing.org ftp site.
|
||||
scp tiff-*.tar.gz ftp.remotesensing.org:/var/ftp/libtiff/
|
||||
scp tiff-*.zip ftp.remotesensing.org:/var/ftp/libtiff/
|
||||
|
||||
15. Announce to list, tiff@lists.maptools.org
|
||||
|
||||
16. Update libtiff page on freshmeat with new version announcement.
|
||||
|
||||
|
||||
HOWTO-RELEASE:
|
||||
|
||||
Notes on releasing. You will need appropriate autoconf, automake and libtool
|
||||
utilities to release a package.
|
||||
|
||||
1. Commit any unsaved changes.
|
||||
|
||||
2. "make clean"
|
||||
|
||||
3. Create html/vX.X.html. Take ChangeLog entries and html-ify in there.
|
||||
Easist thing to do is take html/vX.(X-1).html and use it as a template.
|
||||
Add that file to the list of EXTRA_DIST files in the html/Makefile.am.
|
||||
|
||||
3.5. Update html/index.html to refer to this new page as the current release.
|
||||
|
||||
4. Increment version in configure.ac. Put 'alpha' or 'beta' after
|
||||
the version, if applicable.
|
||||
|
||||
eg.
|
||||
3.5.7
|
||||
or
|
||||
3.5.8beta
|
||||
|
||||
Version should be updated in two places: in the second argument of the
|
||||
AC_INIT macro and in LIBTIFF_xxx_VERSION variables.
|
||||
|
||||
5. autoconf
|
||||
|
||||
6. sh configure
|
||||
|
||||
7. make release -- this will update "RELEASE-DATE" and "VERSION" in the top
|
||||
level dir, and libtiff/tiffvers.h.
|
||||
|
||||
8. Please verify that the version info in RELEASE-DATE, VERSION and
|
||||
libtiff/tiffvers.h is right.
|
||||
|
||||
9. make; make distcheck (to test).
|
||||
|
||||
10. make distclean
|
||||
|
||||
11. cvs commit
|
||||
|
||||
12. cvs tag Release-v3-5-7 (or the appropriate name for the release)
|
||||
|
||||
13. configure; make dist
|
||||
Two files with names tiff-version.tar.gz and tiff-version.zip will
|
||||
be created in the top level package directory.
|
||||
|
||||
14. Copy to ftp.remotesensing.org ftp site.
|
||||
scp tiff-*.tar.gz ftp.remotesensing.org:/var/ftp/libtiff/
|
||||
scp tiff-*.zip ftp.remotesensing.org:/var/ftp/libtiff/
|
||||
|
||||
15. Announce to list, tiff@lists.maptools.org
|
||||
|
||||
16. Update libtiff page on freshmeat with new version announcement.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ want to do is:
|
|||
% su
|
||||
# make install
|
||||
|
||||
More information, email contacts, and mailing list information can be
|
||||
More information, email contacts, and mailing list information can be
|
||||
found online at http://www.remotesensing.org/libtiff/.
|
||||
|
||||
|
||||
|
|
@ -39,7 +39,7 @@ The legal way of saying that is:
|
|||
Copyright (c) 1988-1997 Sam Leffler
|
||||
Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
|
||||
Permission to use, copy, modify, distribute, and sell this software and
|
||||
Permission to use, copy, modify, distribute, and sell this software and
|
||||
its documentation for any purpose is hereby granted without fee, provided
|
||||
that (i) the above copyright notices and this permission notice appear in
|
||||
all copies of the software and related documentation, and (ii) the names of
|
||||
|
|
@ -47,13 +47,13 @@ Sam Leffler and Silicon Graphics may not be used in any advertising or
|
|||
publicity relating to the software without the specific, prior written
|
||||
permission of Sam Leffler and Silicon Graphics.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
|
||||
IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
OF THIS SOFTWARE.
|
||||
|
|
|
|||
|
|
@ -1,169 +1,169 @@
|
|||
# $Id: SConstruct,v 1.2 2006/03/23 14:54:00 dron Exp $
|
||||
|
||||
# Tag Image File Format (TIFF) Software
|
||||
#
|
||||
# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and
|
||||
# its documentation for any purpose is hereby granted without fee, provided
|
||||
# that (i) the above copyright notices and this permission notice appear in
|
||||
# all copies of the software and related documentation, and (ii) the names of
|
||||
# Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
# publicity relating to the software without the specific, prior written
|
||||
# permission of Sam Leffler and Silicon Graphics.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
# OF THIS SOFTWARE.
|
||||
|
||||
# This file contains rules to build software with the SCons tool
|
||||
# (see the http://www.scons.org/ for details on SCons).
|
||||
|
||||
import os
|
||||
|
||||
env = Environment()
|
||||
|
||||
# Read the user supplied options
|
||||
opts = Options('libtiff.conf')
|
||||
opts.Add(PathOption('PREFIX', \
|
||||
'install architecture-independent files in this directory', \
|
||||
'/usr/local', PathOption.PathIsDirCreate))
|
||||
opts.Add(BoolOption('ccitt', \
|
||||
'enable support for CCITT Group 3 & 4 algorithms', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('packbits', \
|
||||
'enable support for Macintosh PackBits algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('lzw', \
|
||||
'enable support for LZW algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('thunder', \
|
||||
'enable support for ThunderScan 4-bit RLE algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('next', \
|
||||
'enable support for NeXT 2-bit RLE algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('logluv', \
|
||||
'enable support for LogLuv high dynamic range encoding', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('strip_chopping', \
|
||||
'support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of ~8Kb to reduce memory usage)', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('extrasample_as_alpha', \
|
||||
'the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don\'t mark the alpha properly', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('check_ycbcr_subsampling', \
|
||||
'disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag', \
|
||||
'yes'))
|
||||
opts.Update(env)
|
||||
opts.Save('libtiff.conf', env)
|
||||
Help(opts.GenerateHelpText(env))
|
||||
|
||||
# Here are our installation paths:
|
||||
idir_prefix = '$PREFIX'
|
||||
idir_lib = '$PREFIX/lib'
|
||||
idir_bin = '$PREFIX/bin'
|
||||
idir_inc = '$PREFIX/include'
|
||||
idir_doc = '$PREFIX/doc'
|
||||
Export([ 'env', 'idir_prefix', 'idir_lib', 'idir_bin', 'idir_inc', 'idir_doc' ])
|
||||
|
||||
# Now proceed to system feature checks
|
||||
target_cpu, target_vendor, target_kernel, target_os = \
|
||||
os.popen("./config.guess").readlines()[0].split("-")
|
||||
|
||||
def Define(context, key, have):
|
||||
import SCons.Conftest
|
||||
SCons.Conftest._Have(context, key, have)
|
||||
|
||||
def CheckCustomOption(context, name):
|
||||
context.Message('Checking is the ' + name + ' option set... ')
|
||||
ret = env[name]
|
||||
Define(context, name + '_SUPPORT', ret)
|
||||
context.Result(ret)
|
||||
return ret
|
||||
|
||||
def CheckFillorderOption(context):
|
||||
context.Message('Checking for the native cpu bit order... ')
|
||||
if target_cpu[0] == 'i' and target_cpu[2:] == '86':
|
||||
Define(context, 'HOST_FILLORDER', 'FILLORDER_LSB2MSB')
|
||||
context.Result('lsb2msb')
|
||||
else:
|
||||
Define(context, 'HOST_FILLORDER', 'FILLORDER_MSB2LSB')
|
||||
context.Result('msb2lsb')
|
||||
return 1
|
||||
|
||||
def CheckIEEEFPOption(context):
|
||||
context.Message('Checking for the IEEE floating point format... ')
|
||||
Define(context, 'HAVE_IEEEFP', 1)
|
||||
context.Result(1)
|
||||
return 1
|
||||
|
||||
def CheckOtherOption(context, name):
|
||||
context.Message('Checking is the ' + name + ' option set... ')
|
||||
ret = env[name]
|
||||
Define(context, 'HAVE_' + name, ret)
|
||||
context.Result(ret)
|
||||
return ret
|
||||
|
||||
custom_tests = { \
|
||||
'CheckCustomOption' : CheckCustomOption, \
|
||||
'CheckFillorderOption' : CheckFillorderOption, \
|
||||
'CheckIEEEFPOption' : CheckIEEEFPOption, \
|
||||
'CheckOtherOption' : CheckOtherOption \
|
||||
}
|
||||
conf = Configure(env, custom_tests = custom_tests, \
|
||||
config_h = 'libtiff/tif_config.h')
|
||||
|
||||
# Check for standard library
|
||||
conf.CheckLib('c')
|
||||
if target_os != 'cygwin' \
|
||||
and target_os != 'mingw32' \
|
||||
and target_os != 'beos' \
|
||||
and target_os != 'darwin':
|
||||
conf.CheckLib('m')
|
||||
|
||||
# Check for system headers
|
||||
conf.CheckCHeader('assert.h')
|
||||
conf.CheckCHeader('fcntl.h')
|
||||
conf.CheckCHeader('limits.h')
|
||||
conf.CheckCHeader('malloc.h')
|
||||
conf.CheckCHeader('search.h')
|
||||
conf.CheckCHeader('sys/time.h')
|
||||
conf.CheckCHeader('unistd.h')
|
||||
|
||||
# Check for standard library functions
|
||||
conf.CheckFunc('floor')
|
||||
conf.CheckFunc('isascii')
|
||||
conf.CheckFunc('memmove')
|
||||
conf.CheckFunc('memset')
|
||||
conf.CheckFunc('mmap')
|
||||
conf.CheckFunc('pow')
|
||||
conf.CheckFunc('sqrt')
|
||||
conf.CheckFunc('strchr')
|
||||
conf.CheckFunc('strrchr')
|
||||
conf.CheckFunc('strstr')
|
||||
conf.CheckFunc('strtol')
|
||||
|
||||
conf.CheckFillorderOption()
|
||||
conf.CheckIEEEFPOption()
|
||||
conf.CheckCustomOption('ccitt')
|
||||
conf.CheckCustomOption('packbits')
|
||||
conf.CheckCustomOption('lzw')
|
||||
conf.CheckCustomOption('thunder')
|
||||
conf.CheckCustomOption('next')
|
||||
conf.CheckCustomOption('logluv')
|
||||
conf.CheckOtherOption('strip_chopping')
|
||||
conf.CheckOtherOption('extrasample_as_alpha')
|
||||
conf.CheckOtherOption('check_ycbcr_subsampling')
|
||||
|
||||
env = conf.Finish()
|
||||
|
||||
# Ok, now go to build files in the subdirectories
|
||||
SConscript(dirs = [ 'libtiff' ], name = 'SConstruct')
|
||||
# $Id: SConstruct,v 1.2 2006/03/23 14:54:00 dron Exp $
|
||||
|
||||
# Tag Image File Format (TIFF) Software
|
||||
#
|
||||
# Copyright (C) 2005, Andrey Kiselev <dron@ak4719.spb.edu>
|
||||
#
|
||||
# Permission to use, copy, modify, distribute, and sell this software and
|
||||
# its documentation for any purpose is hereby granted without fee, provided
|
||||
# that (i) the above copyright notices and this permission notice appear in
|
||||
# all copies of the software and related documentation, and (ii) the names of
|
||||
# Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
# publicity relating to the software without the specific, prior written
|
||||
# permission of Sam Leffler and Silicon Graphics.
|
||||
#
|
||||
# THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
# EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
# WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
#
|
||||
# IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
# ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
# OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
# WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
# LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
# OF THIS SOFTWARE.
|
||||
|
||||
# This file contains rules to build software with the SCons tool
|
||||
# (see the http://www.scons.org/ for details on SCons).
|
||||
|
||||
import os
|
||||
|
||||
env = Environment()
|
||||
|
||||
# Read the user supplied options
|
||||
opts = Options('libtiff.conf')
|
||||
opts.Add(PathOption('PREFIX', \
|
||||
'install architecture-independent files in this directory', \
|
||||
'/usr/local', PathOption.PathIsDirCreate))
|
||||
opts.Add(BoolOption('ccitt', \
|
||||
'enable support for CCITT Group 3 & 4 algorithms', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('packbits', \
|
||||
'enable support for Macintosh PackBits algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('lzw', \
|
||||
'enable support for LZW algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('thunder', \
|
||||
'enable support for ThunderScan 4-bit RLE algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('next', \
|
||||
'enable support for NeXT 2-bit RLE algorithm', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('logluv', \
|
||||
'enable support for LogLuv high dynamic range encoding', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('strip_chopping', \
|
||||
'support for strip chopping (whether or not to convert single-strip uncompressed images to mutiple strips of ~8Kb to reduce memory usage)', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('extrasample_as_alpha', \
|
||||
'the RGBA interface will treat a fourth sample with no EXTRASAMPLE_ value as being ASSOCALPHA. Many packages produce RGBA files but don\'t mark the alpha properly', \
|
||||
'yes'))
|
||||
opts.Add(BoolOption('check_ycbcr_subsampling', \
|
||||
'disable picking up YCbCr subsampling info from the JPEG data stream to support files lacking the tag', \
|
||||
'yes'))
|
||||
opts.Update(env)
|
||||
opts.Save('libtiff.conf', env)
|
||||
Help(opts.GenerateHelpText(env))
|
||||
|
||||
# Here are our installation paths:
|
||||
idir_prefix = '$PREFIX'
|
||||
idir_lib = '$PREFIX/lib'
|
||||
idir_bin = '$PREFIX/bin'
|
||||
idir_inc = '$PREFIX/include'
|
||||
idir_doc = '$PREFIX/doc'
|
||||
Export([ 'env', 'idir_prefix', 'idir_lib', 'idir_bin', 'idir_inc', 'idir_doc' ])
|
||||
|
||||
# Now proceed to system feature checks
|
||||
target_cpu, target_vendor, target_kernel, target_os = \
|
||||
os.popen("./config.guess").readlines()[0].split("-")
|
||||
|
||||
def Define(context, key, have):
|
||||
import SCons.Conftest
|
||||
SCons.Conftest._Have(context, key, have)
|
||||
|
||||
def CheckCustomOption(context, name):
|
||||
context.Message('Checking is the ' + name + ' option set... ')
|
||||
ret = env[name]
|
||||
Define(context, name + '_SUPPORT', ret)
|
||||
context.Result(ret)
|
||||
return ret
|
||||
|
||||
def CheckFillorderOption(context):
|
||||
context.Message('Checking for the native cpu bit order... ')
|
||||
if target_cpu[0] == 'i' and target_cpu[2:] == '86':
|
||||
Define(context, 'HOST_FILLORDER', 'FILLORDER_LSB2MSB')
|
||||
context.Result('lsb2msb')
|
||||
else:
|
||||
Define(context, 'HOST_FILLORDER', 'FILLORDER_MSB2LSB')
|
||||
context.Result('msb2lsb')
|
||||
return 1
|
||||
|
||||
def CheckIEEEFPOption(context):
|
||||
context.Message('Checking for the IEEE floating point format... ')
|
||||
Define(context, 'HAVE_IEEEFP', 1)
|
||||
context.Result(1)
|
||||
return 1
|
||||
|
||||
def CheckOtherOption(context, name):
|
||||
context.Message('Checking is the ' + name + ' option set... ')
|
||||
ret = env[name]
|
||||
Define(context, 'HAVE_' + name, ret)
|
||||
context.Result(ret)
|
||||
return ret
|
||||
|
||||
custom_tests = { \
|
||||
'CheckCustomOption' : CheckCustomOption, \
|
||||
'CheckFillorderOption' : CheckFillorderOption, \
|
||||
'CheckIEEEFPOption' : CheckIEEEFPOption, \
|
||||
'CheckOtherOption' : CheckOtherOption \
|
||||
}
|
||||
conf = Configure(env, custom_tests = custom_tests, \
|
||||
config_h = 'libtiff/tif_config.h')
|
||||
|
||||
# Check for standard library
|
||||
conf.CheckLib('c')
|
||||
if target_os != 'cygwin' \
|
||||
and target_os != 'mingw32' \
|
||||
and target_os != 'beos' \
|
||||
and target_os != 'darwin':
|
||||
conf.CheckLib('m')
|
||||
|
||||
# Check for system headers
|
||||
conf.CheckCHeader('assert.h')
|
||||
conf.CheckCHeader('fcntl.h')
|
||||
conf.CheckCHeader('limits.h')
|
||||
conf.CheckCHeader('malloc.h')
|
||||
conf.CheckCHeader('search.h')
|
||||
conf.CheckCHeader('sys/time.h')
|
||||
conf.CheckCHeader('unistd.h')
|
||||
|
||||
# Check for standard library functions
|
||||
conf.CheckFunc('floor')
|
||||
conf.CheckFunc('isascii')
|
||||
conf.CheckFunc('memmove')
|
||||
conf.CheckFunc('memset')
|
||||
conf.CheckFunc('mmap')
|
||||
conf.CheckFunc('pow')
|
||||
conf.CheckFunc('sqrt')
|
||||
conf.CheckFunc('strchr')
|
||||
conf.CheckFunc('strrchr')
|
||||
conf.CheckFunc('strstr')
|
||||
conf.CheckFunc('strtol')
|
||||
|
||||
conf.CheckFillorderOption()
|
||||
conf.CheckIEEEFPOption()
|
||||
conf.CheckCustomOption('ccitt')
|
||||
conf.CheckCustomOption('packbits')
|
||||
conf.CheckCustomOption('lzw')
|
||||
conf.CheckCustomOption('thunder')
|
||||
conf.CheckCustomOption('next')
|
||||
conf.CheckCustomOption('logluv')
|
||||
conf.CheckOtherOption('strip_chopping')
|
||||
conf.CheckOtherOption('extrasample_as_alpha')
|
||||
conf.CheckOtherOption('check_ycbcr_subsampling')
|
||||
|
||||
env = conf.Finish()
|
||||
|
||||
# Ok, now go to build files in the subdirectories
|
||||
SConscript(dirs = [ 'libtiff' ], name = 'SConstruct')
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@
|
|||
* Copyright (c) 1991-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@
|
|||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@
|
|||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
|
@ -28,7 +28,7 @@
|
|||
* TIFF Library.
|
||||
*
|
||||
* Various routines support external extension of the tag set, and other
|
||||
* application extension capabilities.
|
||||
* application extension capabilities.
|
||||
*/
|
||||
|
||||
#include "tiffiop.h"
|
||||
|
|
@ -37,7 +37,7 @@ int TIFFGetTagListCount( TIFF *tif )
|
|||
|
||||
{
|
||||
TIFFDirectory* td = &tif->tif_dir;
|
||||
|
||||
|
||||
return td->td_customValueCount;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@
|
|||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
|
@ -50,7 +50,7 @@ TIFFFlush(TIFF* tif)
|
|||
* is not set, so that TIFFFlush() will proceed to write out the directory.
|
||||
* The documentation says returning 1 is an error indicator, but not having
|
||||
* been writing isn't exactly a an error. Hopefully this doesn't cause
|
||||
* problems for other people.
|
||||
* problems for other people.
|
||||
*/
|
||||
int
|
||||
TIFFFlushData(TIFF* tif)
|
||||
|
|
@ -64,3 +64,4 @@ TIFFFlushData(TIFF* tif)
|
|||
}
|
||||
return (TIFFFlushData1(tif));
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -3,23 +3,23 @@
|
|||
* Copyright (c) 1992-1997 Sam Leffler
|
||||
* Copyright (c) 1992-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
#include "tiffiop.h"
|
||||
|
|
|
|||
|
|
@ -4,23 +4,23 @@
|
|||
* Copyright (c) 1988-1997 Sam Leffler
|
||||
* Copyright (c) 1991-1997 Silicon Graphics, Inc.
|
||||
*
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* Permission to use, copy, modify, distribute, and sell this software and
|
||||
* its documentation for any purpose is hereby granted without fee, provided
|
||||
* that (i) the above copyright notices and this permission notice appear in
|
||||
* all copies of the software and related documentation, and (ii) the names of
|
||||
* Sam Leffler and Silicon Graphics may not be used in any advertising or
|
||||
* publicity relating to the software without the specific, prior written
|
||||
* permission of Sam Leffler and Silicon Graphics.
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
*
|
||||
* THE SOFTWARE IS PROVIDED "AS-IS" AND WITHOUT WARRANTY OF ANY KIND,
|
||||
* EXPRESS, IMPLIED OR OTHERWISE, INCLUDING WITHOUT LIMITATION, ANY
|
||||
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
|
||||
*
|
||||
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
|
||||
* ANY SPECIAL, INCIDENTAL, INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND,
|
||||
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE, AND ON ANY THEORY OF
|
||||
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
|
||||
* OF THIS SOFTWARE.
|
||||
*/
|
||||
|
||||
|
|
|
|||
|
|
@ -6,12 +6,12 @@ SysConsole::SysConsole()
|
|||
list.NoHeader().NoGrid().NoCursor().AddColumn();
|
||||
font = Courier(Ctrl::VertLayoutZoom(12));
|
||||
list.SetLineCy(font.Info().GetHeight());
|
||||
exit.Hide();
|
||||
}
|
||||
|
||||
void SysConsole::AddResult(const String& out)
|
||||
{
|
||||
DUMP(out);
|
||||
Vector<String> h = Split(out, '\n');
|
||||
Vector<String> h = Split(out, CharFilterCrLf);
|
||||
for(int i = 0; i < h.GetCount(); i++) {
|
||||
String s = " " + h[i];
|
||||
list.Add(AttrText(s).SetFont(font), s);
|
||||
|
|
@ -21,8 +21,6 @@ void SysConsole::AddResult(const String& out)
|
|||
|
||||
int SysConsole::System(const char *cmd)
|
||||
{
|
||||
DLOG("=== System =======================================");
|
||||
DDUMP(cmd);
|
||||
if(!IsOpen())
|
||||
Open();
|
||||
list.Add(AttrText(cmd).SetFont(font().Bold()).Ink(LtBlue));
|
||||
|
|
@ -32,17 +30,16 @@ int SysConsole::System(const char *cmd)
|
|||
return -1;
|
||||
String out;
|
||||
while(p.IsRunning()) {
|
||||
DLOG("Get1");
|
||||
out.Cat(p.Get());
|
||||
String h = p.Get();
|
||||
out.Cat(h);
|
||||
int lf = out.ReverseFind('\n');
|
||||
if(lf >= 0) {
|
||||
AddResult(out.Mid(0, lf + 1));
|
||||
out = out.Mid(lf + 1);
|
||||
}
|
||||
ProcessEvents();
|
||||
Sleep(1); // p.Wait would be much better here!
|
||||
Sleep(h.GetCount() == 0); // p.Wait would be much better here!
|
||||
}
|
||||
DLOG("Get2");
|
||||
out.Cat(p.Get());
|
||||
AddResult(out);
|
||||
ProcessEvents();
|
||||
|
|
|
|||
|
|
@ -1,73 +1,73 @@
|
|||
#ifndef _usvn_SlaveProcess_h_
|
||||
#define _usvn_SlaveProcess_h_
|
||||
|
||||
#include <Core/Core.h>
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
class SlaveProcess {
|
||||
SlaveProcess(const SlaveProcess& sp);
|
||||
void operator = (const SlaveProcess& sp);
|
||||
|
||||
public:
|
||||
virtual void Kill() = 0;
|
||||
virtual bool IsRunning() = 0;
|
||||
virtual void Write(String s) = 0;
|
||||
virtual bool Read(String& s) = 0;
|
||||
virtual int GetExitCode() = 0;
|
||||
virtual void Detach() {};
|
||||
|
||||
String Get() { String x; if(Read(x)) return x; return String::GetVoid(); }
|
||||
|
||||
SlaveProcess() {}
|
||||
virtual ~SlaveProcess() {}
|
||||
};
|
||||
|
||||
class LocalProcess : public SlaveProcess {
|
||||
public:
|
||||
virtual void Kill();
|
||||
virtual bool IsRunning();
|
||||
virtual void Write(String s);
|
||||
virtual bool Read(String& s);
|
||||
virtual int GetExitCode();
|
||||
virtual void Detach();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void Free();
|
||||
#ifdef PLATFORM_POSIX
|
||||
bool DecodeExitCode(int code);
|
||||
#endif
|
||||
|
||||
private:
|
||||
#ifdef PLATFORM_WIN32
|
||||
HANDLE hProcess;
|
||||
HANDLE hOutputRead;
|
||||
HANDLE hInputWrite;
|
||||
#endif
|
||||
#ifdef PLATFORM_POSIX
|
||||
Buffer<char> cmd_buf;
|
||||
Vector<char *> args;
|
||||
pid_t pid;
|
||||
int rpipe[2], wpipe[2];
|
||||
String exit_string;
|
||||
bool output_read;
|
||||
#endif
|
||||
int exit_code;
|
||||
|
||||
public:
|
||||
typedef LocalProcess CLASSNAME;
|
||||
|
||||
bool Start(const char *cmdline, const char *envptr = NULL);
|
||||
|
||||
LocalProcess() { Init(); }
|
||||
LocalProcess(const char *cmdline, const char *envptr = NULL) { Init(); Start(cmdline, envptr); }
|
||||
virtual ~LocalProcess() { Kill(); }
|
||||
};
|
||||
|
||||
int Sys(const char *cmd, String& output);
|
||||
String Sys(const char *cmd);
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
#ifndef _usvn_CProcess_h_
|
||||
#define _usvn_CProcess_h_
|
||||
|
||||
#include <Core/Core.h>
|
||||
|
||||
NAMESPACE_UPP
|
||||
|
||||
class CProcess {
|
||||
CProcess(const CProcess& sp);
|
||||
void operator = (const CProcess& sp);
|
||||
|
||||
public:
|
||||
virtual void Kill() = 0;
|
||||
virtual bool IsRunning() = 0;
|
||||
virtual void Write(String s) = 0;
|
||||
virtual bool Read(String& s) = 0;
|
||||
virtual int GetExitCode() = 0;
|
||||
virtual void Detach() {};
|
||||
|
||||
String Get() { String x; if(Read(x)) return x; return String::GetVoid(); }
|
||||
|
||||
CProcess() {}
|
||||
virtual ~CProcess() {}
|
||||
};
|
||||
|
||||
class LocalProcess : public CProcess {
|
||||
public:
|
||||
virtual void Kill();
|
||||
virtual bool IsRunning();
|
||||
virtual void Write(String s);
|
||||
virtual bool Read(String& s);
|
||||
virtual int GetExitCode();
|
||||
virtual void Detach();
|
||||
|
||||
private:
|
||||
void Init();
|
||||
void Free();
|
||||
#ifdef PLATFORM_POSIX
|
||||
bool DecodeExitCode(int code);
|
||||
#endif
|
||||
|
||||
private:
|
||||
#ifdef PLATFORM_WIN32
|
||||
HANDLE hProcess;
|
||||
HANDLE hOutputRead;
|
||||
HANDLE hInputWrite;
|
||||
#endif
|
||||
#ifdef PLATFORM_POSIX
|
||||
Buffer<char> cmd_buf;
|
||||
Vector<char *> args;
|
||||
pid_t pid;
|
||||
int rpipe[2], wpipe[2];
|
||||
String exit_string;
|
||||
bool output_read;
|
||||
#endif
|
||||
int exit_code;
|
||||
|
||||
public:
|
||||
typedef LocalProcess CLASSNAME;
|
||||
|
||||
bool Start(const char *cmdline, const char *envptr = NULL);
|
||||
|
||||
LocalProcess() { Init(); }
|
||||
LocalProcess(const char *cmdline, const char *envptr = NULL) { Init(); Start(cmdline, envptr); }
|
||||
virtual ~LocalProcess() { Kill(); }
|
||||
};
|
||||
|
||||
int Sys(const char *cmd, String& output);
|
||||
String Sys(const char *cmd);
|
||||
|
||||
END_UPP_NAMESPACE
|
||||
|
||||
#endif
|
||||
|
|
|
|||
54
uppsrc/usvn/SvnFs.cpp
Normal file
54
uppsrc/usvn/SvnFs.cpp
Normal file
|
|
@ -0,0 +1,54 @@
|
|||
#include "usvn.h"
|
||||
|
||||
SvnSel::SvnSel()
|
||||
{
|
||||
CtrlLayoutOKCancel(*this, "Select SVN folder");
|
||||
list.WhenLeftDouble = THISBACK(Go);
|
||||
}
|
||||
|
||||
void SvnSel::Load()
|
||||
{
|
||||
list.Clear();
|
||||
String path = url;
|
||||
if(folder.GetCount()) {
|
||||
list.Add("..", CtrlImg::DirUp(), StdFont().Bold(), SColorText(), true);
|
||||
path << '/' << folder;
|
||||
}
|
||||
Vector<String> l = Split(Sys(SvnCmd("list", usr, pwd) + ' ' + path), CharFilterCrLf);
|
||||
for(int i = 0; i < l.GetCount(); i++) {
|
||||
String fn = l[i];
|
||||
if(fn.GetLength()) {
|
||||
bool isdir = false;
|
||||
if(*fn.Last() == '/' || *fn.Last() == '\\') {
|
||||
fn.Trim(fn.GetLength() - 1);
|
||||
list.Add(fn, CtrlImg::Dir(), StdFont().Bold(), SColorText(), true);
|
||||
}
|
||||
else
|
||||
list.Add(fn, CtrlImg::File());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void SvnSel::Go()
|
||||
{
|
||||
if(list.IsCursor()) {
|
||||
const FileList::File& f = list.Get(list.GetCursor());
|
||||
if(f.isdir) {
|
||||
if(f.name == "..")
|
||||
folder.Trim(max(0, folder.Find(f.name)));
|
||||
else
|
||||
folder << '/' << f.name;
|
||||
Load();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
String SvnSel::Select(const char *_url, const char *_usr, const char *_pwd)
|
||||
{
|
||||
url = _url;
|
||||
usr = _usr;
|
||||
pwd = _pwd;
|
||||
Load();
|
||||
Execute();
|
||||
return url + '/' + folder;
|
||||
}
|
||||
|
|
@ -9,6 +9,8 @@ SvnSync::SvnSync()
|
|||
list.AddColumn("Path");
|
||||
list.ColumnWidths("153 619");
|
||||
list.NoCursor().EvenRowColor();
|
||||
usr.NullText("use cached");
|
||||
pwd.NullText("use cached");
|
||||
Sizeable().Zoomable();
|
||||
setup <<= THISBACK(Setup);
|
||||
}
|
||||
|
|
@ -29,45 +31,48 @@ void SvnSync::SyncList()
|
|||
AttrText("Working directory").SetFont(StdFont().Bold()).Ink(White).Paper(Blue),
|
||||
AttrText(path).SetFont(Arial(20).Bold()).Paper(Blue).Ink(White));
|
||||
list.SetLineCy(list.GetCount() - 1, 26);
|
||||
Vector<String> ln = Split(Sys("svn status " + path), '\n');
|
||||
Vector<String> ln = Split(Sys("svn status " + path), CharFilterCrLf);
|
||||
bool actions = false;
|
||||
for(int i = 0; i < ln.GetCount(); i++) {
|
||||
String h = ln[i];
|
||||
if(h.GetCount() > 7) {
|
||||
String file = h.Mid(7);
|
||||
if(IsFullPath(file)) {
|
||||
actions = true;
|
||||
h.Trim(7);
|
||||
bool simple = h.Mid(1, 6) == " ";
|
||||
int action = simple ? String("MC?!").Find(h[0]) : -1;
|
||||
String an;
|
||||
Color color;
|
||||
if(action < 0) {
|
||||
color = Black;
|
||||
if(simple && h[0] == 'A')
|
||||
an = "add";
|
||||
else
|
||||
if(simple && h[0] == 'D')
|
||||
an = "delete";
|
||||
for(int pass = 0; pass < 2; pass++)
|
||||
for(int i = 0; i < ln.GetCount(); i++) {
|
||||
String h = ln[i];
|
||||
if(h.GetCount() > 7) {
|
||||
String file = h.Mid(7);
|
||||
if(IsFullPath(file)) {
|
||||
actions = true;
|
||||
h.Trim(7);
|
||||
bool simple = h.Mid(1, 6) == " ";
|
||||
int action = simple ? String("MC?!").Find(h[0]) : -1;
|
||||
String an;
|
||||
Color color;
|
||||
if(action < 0) {
|
||||
color = Black;
|
||||
if(simple && h[0] == 'A')
|
||||
an = "svn add";
|
||||
else
|
||||
if(simple && h[0] == 'D')
|
||||
an = "svn delete";
|
||||
else {
|
||||
an = h.Mid(0, 7);
|
||||
color = Gray;
|
||||
}
|
||||
}
|
||||
else {
|
||||
an = h.Mid(0, 7);
|
||||
color = Gray;
|
||||
static const char *as[] = { "Modify", "Conflict resolved", "Add", "Remove" };
|
||||
static Color c[] = { LtBlue, Magenta, Green, LtRed };
|
||||
an = as[action];
|
||||
color = c[action];
|
||||
}
|
||||
if(pass == action < 0) {
|
||||
int ii = list.GetCount();
|
||||
list.Add(action, file,
|
||||
action <= 0 ? Value(AttrText(an).Ink(color)) : Value(true),
|
||||
AttrText(" " + file.Mid(path.GetCount() + 1)).Ink(color));
|
||||
if(action > 0)
|
||||
list.SetCtrl(ii, 0, confirm.Add().SetLabel(an).NoWantFocus());
|
||||
}
|
||||
}
|
||||
else {
|
||||
static const char *as[] = { "Modify", "Conflict resolved", "Add", "Remove" };
|
||||
static Color c[] = { LtBlue, Magenta, Green, LtRed };
|
||||
an = as[action];
|
||||
color = c[action];
|
||||
}
|
||||
int ii = list.GetCount();
|
||||
list.Add(action, file,
|
||||
action <= 0 ? Value(AttrText(an).Ink(color)) : Value(true),
|
||||
AttrText(" " + file.Mid(path.GetCount() + 1)).Ink(color));
|
||||
if(action > 0)
|
||||
list.SetCtrl(ii, 0, confirm.Add().SetLabel(an).NoWantFocus());
|
||||
}
|
||||
}
|
||||
}
|
||||
if(actions) {
|
||||
list.Add(MESSAGE, Null, AttrText("Commit message:").SetFont(StdFont().Bold()));
|
||||
|
|
@ -111,12 +116,16 @@ void SvnSync::Perform()
|
|||
SetExitCode(1);
|
||||
return;
|
||||
}
|
||||
works.Add(d, Null, Null);
|
||||
works.Add(d, ~usr, ~pwd);
|
||||
}
|
||||
setup.Hide();
|
||||
DoSync();
|
||||
}
|
||||
else {
|
||||
usr_lbl.Hide();
|
||||
usr.Hide();
|
||||
pwd_lbl.Hide();
|
||||
pwd.Hide();
|
||||
works.Load(LoadFile(ConfigFile("svnworks")));
|
||||
DoSync();
|
||||
SaveFile(ConfigFile("svnworks"), works.Save());
|
||||
|
|
@ -167,9 +176,9 @@ void SvnSync::DoSync()
|
|||
#ifdef flagMAIN
|
||||
GUI_APP_MAIN
|
||||
{
|
||||
// SvnSel svn;
|
||||
// svn.Select("https://upp.svn.sourceforge.net/svnroot/upp", "", "");
|
||||
// return;
|
||||
SvnSel svn;
|
||||
svn.Select("svn://10.0.0.19/upp", "", "");
|
||||
return;
|
||||
SvnSync().Perform();
|
||||
}
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,6 +1,6 @@
|
|||
#include "usvn.h"
|
||||
|
||||
FileSel& sSD() {
|
||||
static FileSel& ssSD() {
|
||||
static FileSel fs;
|
||||
ONCELOCK {
|
||||
fs.AllFilesType();
|
||||
|
|
@ -8,15 +8,11 @@ FileSel& sSD() {
|
|||
return fs;
|
||||
}
|
||||
|
||||
String NormalizePathNN(const String& path)
|
||||
{
|
||||
return IsNull(path) ? path : NormalizePath(path);
|
||||
}
|
||||
|
||||
static void sSetFolder(EditField *f)
|
||||
{
|
||||
if(!sSD().ExecuteSelectDir()) return;
|
||||
*f <<= NormalizePathNN(~sSD());
|
||||
if(!ssSD().ExecuteSelectDir()) return;
|
||||
String path = ~ssSD();
|
||||
*f <<= IsNull(path) ? path : NormalizePath(path);
|
||||
}
|
||||
|
||||
void SvnWorks::DirSel(EditField& f)
|
||||
|
|
@ -61,6 +57,24 @@ void SvnWorks::Edit()
|
|||
Sync();
|
||||
}
|
||||
|
||||
String SvnCmd(const char *cmd, const String& user, const String& pwd)
|
||||
{
|
||||
String r = "svn ";
|
||||
r << cmd;
|
||||
r << " --non-interactive";
|
||||
if(!IsNull(user))
|
||||
r << " --username \"" << user << "\"";
|
||||
if(!IsNull(pwd))
|
||||
r << " --password \"" << pwd << "\"";
|
||||
r << ' ';
|
||||
return r;
|
||||
}
|
||||
|
||||
String SvnCmd(const char *cmd, const SvnWork& w)
|
||||
{
|
||||
return SvnCmd(cmd, w.user, w.password);
|
||||
}
|
||||
|
||||
void SvnWorks::Checkout()
|
||||
{
|
||||
WithSvnCheckoutLayout<TopWindow> dlg;
|
||||
|
|
@ -76,15 +90,8 @@ void SvnWorks::Checkout()
|
|||
}
|
||||
RealizeDirectory(working);
|
||||
Add(~dlg.working, ~dlg.user, ~dlg.password);
|
||||
String cmd;
|
||||
cmd << "svn checkout --non-interactive";
|
||||
if(!IsNull(dlg.user))
|
||||
cmd << " --user \"" << ~dlg.user << "\"";
|
||||
if(!IsNull(dlg.password))
|
||||
cmd << " --user \"" << ~dlg.password << "\"";
|
||||
cmd << ' ' << ~dlg.repository << ' ' << ~dlg.working;
|
||||
SysConsole con;
|
||||
con.System(cmd);
|
||||
con.System(SvnCmd("checkout", ~dlg.user, ~dlg.password).Cat() << ~dlg.repository << ' ' << ~dlg.working);
|
||||
con.Execute();
|
||||
}
|
||||
|
||||
|
|
@ -124,7 +131,7 @@ void SvnWorks::Clear()
|
|||
void SvnWorks::Load(const String& text)
|
||||
{
|
||||
list.Clear();
|
||||
Vector<String> ln = Split(text, '\n');
|
||||
Vector<String> ln = Split(text, CharFilterCrLf);
|
||||
for(int i = 0; i < ln.GetCount(); i++) {
|
||||
Vector<String> q = Split(ln[i], ';');
|
||||
if(q.GetCount() >= 1)
|
||||
|
|
@ -149,9 +156,11 @@ SvnWorks::SvnWorks()
|
|||
list.AddColumn("Password");
|
||||
list.Moving();
|
||||
list.ColumnWidths("364 100 100");
|
||||
list.WhenCursor = THISBACK(Sync);
|
||||
add <<= THISBACK(New);
|
||||
remove <<= THISBACK(Remove);
|
||||
checkout <<= THISBACK(Checkout);
|
||||
edit <<= THISBACK(Edit);
|
||||
Sync();
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -1,48 +1,48 @@
|
|||
* /home/cxl/uppout/GCC.Debug.Debug_full.Gui.Shared/usvn 31.07.2008 15:53:12, user: cxl
|
||||
|
||||
Sys("ls") =
|
||||
Sys("svn status /home/cxl/centrum/SocNet") = M /home/cxl/centrum/SocNet/BACKEND/UPP/pb/pb.cpp
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asv/asv.txt
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asw/asw.h
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asw/Worker.cpp
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asw/Request.cpp
|
||||
|
||||
Sys("svn update /home/cxl/centrum/SocNet") = U /home/cxl/centrum/SocNet/frontend/trunk/ajax/views.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/views.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/search-field.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/gallery-r-bg.png
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/js/jquery/jquery.iMenu.0.1.js
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/js/wall.js
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/js/boxes.js
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/img/user-empty.png
|
||||
D /home/cxl/centrum/SocNet/frontend/trunk/static/img/friend-empty.png
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/select-l.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/badge-select.gif
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/css/blueprint/screen.css
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/css/layout.css
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/css/profile.css
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/search-btn.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/arrow-bull.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/login-icon.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/imenu-bg.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/gallery-l-bg.png
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/groups/index.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/profile/panel.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/profile/index.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/profile/friends.html
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/templates/registr.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/activate.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/events/index.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/search.html
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/templates/maintainance.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/login.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/logout.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/base.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/locale/cs/LC_MESSAGES/django.po
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/profile/admin.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/profile/views.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/profile/models.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/urls.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/forms.py
|
||||
U /home/cxl/centrum/SocNet/redmine/report/assets/stylesheets/default.css
|
||||
Updated to revision 631.
|
||||
* /home/cxl/uppout/GCC.Debug.Debug_full.Gui.Shared/usvn 31.07.2008 15:53:12, user: cxl
|
||||
|
||||
Sys("ls") =
|
||||
Sys("svn status /home/cxl/centrum/SocNet") = M /home/cxl/centrum/SocNet/BACKEND/UPP/pb/pb.cpp
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asv/asv.txt
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asw/asw.h
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asw/Worker.cpp
|
||||
M /home/cxl/centrum/SocNet/BACKEND/UPP/asw/Request.cpp
|
||||
|
||||
Sys("svn update /home/cxl/centrum/SocNet") = U /home/cxl/centrum/SocNet/frontend/trunk/ajax/views.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/views.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/search-field.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/gallery-r-bg.png
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/js/jquery/jquery.iMenu.0.1.js
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/js/wall.js
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/js/boxes.js
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/img/user-empty.png
|
||||
D /home/cxl/centrum/SocNet/frontend/trunk/static/img/friend-empty.png
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/select-l.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/badge-select.gif
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/css/blueprint/screen.css
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/css/layout.css
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/css/profile.css
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/static/search-btn.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/arrow-bull.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/login-icon.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/imenu-bg.gif
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/static/gallery-l-bg.png
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/groups/index.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/profile/panel.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/profile/index.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/profile/friends.html
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/templates/registr.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/activate.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/events/index.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/search.html
|
||||
A /home/cxl/centrum/SocNet/frontend/trunk/templates/maintainance.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/login.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/logout.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/templates/base.html
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/locale/cs/LC_MESSAGES/django.po
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/profile/admin.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/profile/views.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/profile/models.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/urls.py
|
||||
U /home/cxl/centrum/SocNet/frontend/trunk/forms.py
|
||||
U /home/cxl/centrum/SocNet/redmine/report/assets/stylesheets/default.css
|
||||
Updated to revision 631.
|
||||
|
|
|
|||
|
|
@ -1,89 +1,113 @@
|
|||
#ifndef _usvn_usvn_h_
|
||||
#define _usvn_usvn_h_
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#include "SlaveProcess.h"
|
||||
|
||||
#define LAYOUTFILE <usvn/usvn.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
struct Repo {
|
||||
String repo;
|
||||
String work;
|
||||
String user;
|
||||
String pswd;
|
||||
|
||||
void Save(String& s);
|
||||
void Load(CParser& p);
|
||||
};
|
||||
|
||||
struct SvnWork {
|
||||
String working;
|
||||
String user;
|
||||
String password;
|
||||
};
|
||||
|
||||
class SvnWorks : public WithSvnWorksLayout<TopWindow> {
|
||||
void New();
|
||||
void Edit();
|
||||
void Remove();
|
||||
void Checkout();
|
||||
void Sync();
|
||||
|
||||
FrameRight<Button> dirsel;
|
||||
void DirSel(EditField& f);
|
||||
|
||||
public:
|
||||
void Clear();
|
||||
void Add(const String& working, const String& user, const String& data);
|
||||
void Load(const String& text);
|
||||
String Save() const;
|
||||
|
||||
int GetCount() const;
|
||||
SvnWork operator[](int i) const;
|
||||
|
||||
typedef SvnWorks CLASSNAME;
|
||||
|
||||
SvnWorks();
|
||||
};
|
||||
|
||||
struct SvnSync : WithSvnSyncLayout<TopWindow> {
|
||||
enum {
|
||||
MODIFY,
|
||||
CONFLICT,
|
||||
ADD,
|
||||
REMOVE,
|
||||
|
||||
REPOSITORY,
|
||||
MESSAGE,
|
||||
};
|
||||
|
||||
Array<Option> confirm;
|
||||
Array<EditString> message;
|
||||
|
||||
void Add(const char *working);
|
||||
|
||||
SvnSync();
|
||||
};
|
||||
|
||||
class SysConsole : public WithConsoleLayout<TopWindow> {
|
||||
typedef SysConsole CLASSNAME;
|
||||
|
||||
Font font;
|
||||
bool canceled;
|
||||
void AddResult(const String& out);
|
||||
|
||||
public:
|
||||
int System(const char *s);
|
||||
|
||||
void Cancel();
|
||||
void IsCanceled();
|
||||
void ClearCanceled();
|
||||
|
||||
SysConsole();
|
||||
};
|
||||
|
||||
#endif
|
||||
#ifndef _usvn_usvn_h_
|
||||
#define _usvn_usvn_h_
|
||||
|
||||
#include <CtrlLib/CtrlLib.h>
|
||||
|
||||
using namespace Upp;
|
||||
|
||||
#include "SlaveProcess.h"
|
||||
|
||||
#define LAYOUTFILE <usvn/usvn.lay>
|
||||
#include <CtrlCore/lay.h>
|
||||
|
||||
class SysConsole : public WithConsoleLayout<TopWindow> {
|
||||
typedef SysConsole CLASSNAME;
|
||||
|
||||
Font font;
|
||||
void AddResult(const String& out);
|
||||
|
||||
public:
|
||||
int System(const char *s);
|
||||
void Perform() { exit.Show(); Execute(); }
|
||||
|
||||
SysConsole();
|
||||
};
|
||||
|
||||
class SvnSel : public WithSvnSelLayout<TopWindow> {
|
||||
String url, usr, pwd;
|
||||
String folder;
|
||||
|
||||
void Load();
|
||||
void Go();
|
||||
|
||||
typedef SvnSel CLASSNAME;
|
||||
|
||||
public:
|
||||
String Select(const char *url, const char *user, const char *pwd);
|
||||
|
||||
SvnSel();
|
||||
};
|
||||
|
||||
struct Repo {
|
||||
String repo;
|
||||
String work;
|
||||
String user;
|
||||
String pswd;
|
||||
|
||||
void Save(String& s);
|
||||
void Load(CParser& p);
|
||||
};
|
||||
|
||||
struct SvnWork {
|
||||
String working;
|
||||
String user;
|
||||
String password;
|
||||
};
|
||||
|
||||
class SvnWorks : public WithSvnWorksLayout<TopWindow> {
|
||||
void New();
|
||||
void Edit();
|
||||
void Remove();
|
||||
void Checkout();
|
||||
void Sync();
|
||||
|
||||
FrameRight<Button> dirsel;
|
||||
void DirSel(EditField& f);
|
||||
|
||||
public:
|
||||
void Clear();
|
||||
void Add(const String& working, const String& user, const String& data);
|
||||
void Load(const String& text);
|
||||
String Save() const;
|
||||
|
||||
int GetCount() const;
|
||||
SvnWork operator[](int i) const;
|
||||
|
||||
typedef SvnWorks CLASSNAME;
|
||||
|
||||
SvnWorks();
|
||||
};
|
||||
|
||||
String SvnCmd(const char *cmd, const String& user, const String& pwd);
|
||||
String SvnCmd(const char *cmd, const SvnWork& w);
|
||||
|
||||
struct SvnSync : WithSvnSyncLayout<TopWindow> {
|
||||
enum {
|
||||
MODIFY,
|
||||
CONFLICT,
|
||||
ADD,
|
||||
REMOVE,
|
||||
|
||||
REPOSITORY,
|
||||
MESSAGE,
|
||||
};
|
||||
|
||||
Array<Option> confirm;
|
||||
Array<EditString> message;
|
||||
|
||||
SvnWorks works;
|
||||
|
||||
void SyncList();
|
||||
void Setup();
|
||||
|
||||
typedef SvnSync CLASSNAME;
|
||||
|
||||
public:
|
||||
void Dir(const char *dir);
|
||||
void Perform();
|
||||
void DoSync();
|
||||
|
||||
SvnSync();
|
||||
};
|
||||
|
||||
#endif
|
||||
|
|
|
|||
|
|
@ -1,7 +1,12 @@
|
|||
LAYOUT(SvnSyncLayout, 672, 592)
|
||||
ITEM(ArrayCtrl, list, HSizePosZ(4, 4).VSizePosZ(4, 36))
|
||||
ITEM(Button, ok, SetLabel(t_("Synchronize!")).RightPosZ(4, 84).BottomPosZ(4, 24))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(4, 64).BottomPosZ(4, 24))
|
||||
ITEM(Button, setup, SetLabel(t_("Setup working directories")).LeftPosZ(88, 144).TopPosZ(564, 24))
|
||||
ITEM(Label, usr_lbl, SetLabel(t_("username")).LeftPosZ(264, 52).TopPosZ(566, 20))
|
||||
ITEM(EditString, usr, LeftPosZ(316, 88).TopPosZ(566, 19))
|
||||
ITEM(Label, pwd_lbl, SetLabel(t_("password")).LeftPosZ(416, 52).TopPosZ(566, 20))
|
||||
ITEM(EditString, pwd, LeftPosZ(468, 88).TopPosZ(566, 19))
|
||||
ITEM(Button, ok, SetLabel(t_("Synchronize!")).RightPosZ(4, 84).BottomPosZ(4, 24))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(SvnWorksLayout, 456, 212)
|
||||
|
|
@ -42,3 +47,9 @@ LAYOUT(ConsoleLayout, 740, 544)
|
|||
ITEM(Button, exit, SetLabel(t_("Close")).RightPosZ(4, 64).BottomPosZ(4, 24))
|
||||
END_LAYOUT
|
||||
|
||||
LAYOUT(SvnSelLayout, 400, 308)
|
||||
ITEM(FileList, list, LeftPosZ(4, 392).TopPosZ(4, 264))
|
||||
ITEM(Button, ok, SetLabel(t_("OK")).LeftPosZ(264, 64).TopPosZ(276, 24))
|
||||
ITEM(Button, cancel, SetLabel(t_("Cancel")).LeftPosZ(332, 64).TopPosZ(276, 24))
|
||||
END_LAYOUT
|
||||
|
||||
|
|
|
|||
|
|
@ -1,17 +1,19 @@
|
|||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
usvn.h,
|
||||
SlaveProcess.h,
|
||||
SlaveProcess.cpp,
|
||||
Console.cpp,
|
||||
SvnWorks.cpp,
|
||||
SvnSync.cpp,
|
||||
main.cpp,
|
||||
notes.txt,
|
||||
usvn.lay;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
description "Simple svn GUI frontend, also a module that can be used in other applications";
|
||||
|
||||
uses
|
||||
CtrlLib;
|
||||
|
||||
file
|
||||
usvn.h,
|
||||
SlaveProcess.h,
|
||||
SlaveProcess.cpp,
|
||||
Console.cpp,
|
||||
SvnFs.cpp,
|
||||
SvnWorks.cpp,
|
||||
SvnSync.cpp,
|
||||
notes.txt,
|
||||
usvn.lay;
|
||||
|
||||
mainconfig
|
||||
"" = "GUI";
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue