[SCM] Render HTML and CSS content with tk branch, master, updated. 7f7e7bc3cdfa6ec14fcca4971f80fb328601ab22
Ole Streicher
debian at liska.ath.cx
Fri Mar 2 14:06:00 UTC 2012
The following commit has been merged in the master branch:
commit 7f7e7bc3cdfa6ec14fcca4971f80fb328601ab22
Author: Ole Streicher <debian at liska.ath.cx>
Date: Fri Mar 2 15:05:10 2012 +0100
Move the ds9 diffs that we actually apply to ds9.patch
diff --git a/debian/patches/ds9.patch b/debian/patches/ds9.patch
new file mode 100644
index 0000000..6b3269b
--- /dev/null
+++ b/debian/patches/ds9.patch
@@ -0,0 +1,92 @@
+Origin: http://hea-www.harvard.edu/saord/download/ds9/source/ds9.6.2.tar.gz
+Description: Fixes that were applied to the package included in the
+ saods9 source.
+--- a/src/htmlcmd.c
++++ b/src/htmlcmd.c
+@@ -453,6 +453,28 @@ HtmlYviewCmd(clientData, interp, argc, argv)
+ if (p)
+ HtmlVerticalScroll(htmlPtr, p->anchor.y);
+ }
++ else if( argc==4 && !strncmp(argv[2],"text",4)) {
++ HtmlElement *p;
++ int i;
++
++ HtmlLock(htmlPtr);
++ if( HtmlGetIndex(htmlPtr, argv[3], &p, &i)!=0 ){
++ if( !HtmlUnlock(htmlPtr) ){
++ Tcl_AppendResult(interp,"malformed index: \"", argv[3], "\"", 0);
++ }
++
++ return TCL_ERROR;
++ }
++ if( !HtmlUnlock(htmlPtr) && p ){
++ if( p->base.type==Html_Text ) {
++ int offset = p->text.y-20;
++ if (offset<0)
++ offset = 0;
++ HtmlVerticalScroll(htmlPtr, offset);
++ }
++
++ }
++ }
+ else {
+ int count;
+ double fraction;
+--- a/src/htmlurl.c
++++ b/src/htmlurl.c
+@@ -389,6 +389,9 @@ HtmlCallResolver(htmlPtr, azSeries)
+ continue;
+ }
+ }
++ /* look for /../ at begining */
++ if (!strncmp(zBuf,"/../",4))
++ strcpy(zBuf,zBuf+3);
+ HtmlFree(base->zPath);
+ base->zPath = zBuf;
+ }
+--- a/src/htmlwidget.c
++++ b/src/htmlwidget.c
+@@ -1638,6 +1638,13 @@ HtmlGetColorByName(htmlPtr, zColor, def)
+ * compatibility.
+ */
+ n = strlen(zColor);
++
++ /* trucate any spaces on the end */
++ while (n>0 && zColor[n-1]==' ') {
++ zColor[n-1] = '\0';
++ n--;
++ }
++
+ if (n == 6 || n == 3 || n == 9 || n == 12) {
+ for (i = 0; i < n; i++) {
+ if (!isxdigit(zColor[i]))
+@@ -1809,22 +1816,23 @@ GetColorByValue(htmlPtr, pRef)
+ float dist;
+ float closestDist;
+ int closest;
+- int r, g, b;
++ XColor* q;
++ q = Tk_GetColorByValue(htmlPtr->clipwin, pRef);
+
+ /*
+ * Search for an exact match
+ */
+- r = pRef->red &= COLOR_MASK;
+- g = pRef->green &= COLOR_MASK;
+- b = pRef->blue &= COLOR_MASK;
+ for (i = 0; i < N_COLOR; i++) {
+ XColor *p = htmlPtr->apColor[i];
+- if (p && (p->red & COLOR_MASK) == r && (p->green & COLOR_MASK) == g
+- && (p->blue & COLOR_MASK) == b) {
++ if (p && (q->red == p->red)
++ && (q->green == p->green)
++ && (q->blue == p->blue)) {
+ htmlPtr->colorUsed |= (1LL << i);
++ Tk_FreeColor(q);
+ return i;
+ }
+ }
++ Tk_FreeColor(q);
+
+ /*
+ * No exact matches. Look for a completely unused slot
diff --git a/debian/patches/ds9_patches.diff b/debian/patches/ds9_patches.diff
index e3d3b71..45be4fc 100644
--- a/debian/patches/ds9_patches.diff
+++ b/debian/patches/ds9_patches.diff
@@ -1,40 +1,6 @@
Origin: http://hea-www.harvard.edu/saord/download/ds9/source/ds9.6.2.tar.gz
Description: These are source code patches on an old version of TkHtml (around the year 2000)-
Some of them may be still useful...
-diff -urw tkHTML/src/htmlcmd.c tkHTML_ds9//src/htmlcmd.c
---- tkHTML/src/htmlcmd.c 2000-11-26 15:13:18.000000000 +0100
-+++ tkHTML_ds9//src/htmlcmd.c 2012-03-02 10:48:54.000000000 +0100
-@@ -268,15 +287,40 @@
- break;
- }
-- }else{
-+ } else if( argc==4 && !strncmp(argv[2],"text",4)) {
-+ HtmlElement *p;
-+ int i;
-+
-+ HtmlLock(htmlPtr);
-+ if( HtmlGetIndex(htmlPtr, argv[3], &p, &i)!=0 ){
-+ if( !HtmlUnlock(htmlPtr) ){
-+ Tcl_AppendResult(interp,"malformed index: \"", argv[3], "\"", 0);
-+ }
-+
-+ return TCL_ERROR;
-+ }
-+ if( !HtmlUnlock(htmlPtr) && p ){
-+ if( p->base.type==Html_Text ) {
-+ int offset = p->text.y-20;
-+ if (offset<0)
-+ offset = 0;
-+ HtmlVerticalScroll(htmlPtr, offset);
-+ }
-+
-+ }
-+ }
-+ else{
- int count;
- double fraction;
- int maxY = htmlPtr->maxY;
-Only in tkHTML_ds9//src: htmlexts.c
diff -urw tkHTML/src/htmllayout.c tkHTML_ds9//src/htmllayout.c
--- tkHTML/src/htmllayout.c 2000-11-26 15:13:18.000000000 +0100
+++ tkHTML_ds9//src/htmllayout.c 2012-03-02 10:48:54.000000000 +0100
@@ -258,89 +224,9 @@ diff -urw tkHTML/src/htmltable.c tkHTML_ds9//src/htmltable.c
int align = pTable->base.style.align;
if( align==ALIGN_Right || stricmp(zAlign,"right")==0 ){
x[1] += lineWidth - width;
-diff -urw tkHTML/src/htmlurl.c tkHTML_ds9//src/htmlurl.c
---- tkHTML/src/htmlurl.c 2000-11-26 15:13:18.000000000 +0100
-+++ tkHTML_ds9//src/htmlurl.c 2012-03-02 10:48:54.000000000 +0100
-@@ -332,13 +335,15 @@
- continue;
- }
- }
-+ /* look for /../ at begining */
-+ if (!strncmp(zBuf,"/../",4))
-+ strcpy(zBuf,zBuf+3);
-+
- HtmlFree(base->zPath);
- base->zPath = zBuf;
- }
- ReplaceStr(&base->zQuery, term->zQuery);
- ReplaceStr(&base->zFragment, term->zFragment);
-- }else if( term->zQuery ){
-- ReplaceStr(&base->zQuery, term->zQuery);
- }
- FreeUri(term);
- }
diff -urw tkHTML/src/htmlwidget.c tkHTML_ds9//src/htmlwidget.c
--- tkHTML/src/htmlwidget.c 2000-11-26 15:13:18.000000000 +0100
+++ tkHTML_ds9//src/htmlwidget.c 2012-03-02 10:48:54.000000000 +0100
-@@ -518,7 +538,7 @@
- htmlPtr->yOffset = 0;
- }
- w = htmlPtr->realWidth - 2*insetX;
-- if( htmlPtr->xOffset + w > htmlPtr->maxX ){
-+ if( htmlPtr->xOffset + h > htmlPtr->maxX ){
- htmlPtr->xOffset = htmlPtr->maxX - w;
- }
- if( htmlPtr->xOffset < 0 ){
-@@ -1370,6 +1427,13 @@
- ** compatibility.
- */
- n = strlen(zColor);
-+
-+ /* trucate any spaces on the end */
-+ while (n>0 && zColor[n-1]==' ') {
-+ zColor[n-1] = '\0';
-+ n--;
-+ }
-+
- if( n==6 || n==3 || n==9 || n==12 ){
- for(i=0; i<n; i++){
- if( !isxdigit(zColor[i]) ) break;
-@@ -1488,21 +1552,35 @@
- float dist;
- float closestDist;
- int closest;
-+ /*
- int r, g, b;
- # define COLOR_MASK 0xf800
-+ */
-+
-+ XColor* q;
-+ q = Tk_GetColorByValue(htmlPtr->clipwin, pRef);
-
- /* Search for an exact match */
-+ /*
- r = pRef->red &= COLOR_MASK;
- g = pRef->green &= COLOR_MASK;
- b = pRef->blue &= COLOR_MASK;
-+ */
- for(i=0; i<N_COLOR; i++){
- XColor *p = htmlPtr->apColor[i];
-+ /*
- if( p && (p->red & COLOR_MASK)==r && (p->green & COLOR_MASK)==g
- && (p->blue & COLOR_MASK)==b ){
-+ */
-+ if (p && (q->red == p->red)
-+ && (q->green == p->green)
-+ && (q->blue == p->blue)) {
- htmlPtr->colorUsed |= (1<<i);
-+ Tk_FreeColor(q);
- return i;
- }
- }
-+ Tk_FreeColor(q);
-
- /* No exact matches. Look for a completely unused slot */
- for(i=N_PREDEFINED_COLOR; i<N_COLOR; i++){
@@ -1659,7 +1743,7 @@
{ "resolve", 0, 2, 0, "?URI ...?", HtmlResolveCmd },
{ "selection", "clear", 3, 3, 0, HtmlSelectionClearCmd},
diff --git a/debian/patches/series b/debian/patches/series
index 16aa64b..738ea73 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -6,3 +6,4 @@ dont_resize_fixed_table_columns.patch
dont_ignore_bgcolor.patch
disable_bugreport.patch
updated_bookmarks.patch
+ds9.patch
--
Render HTML and CSS content with tk
More information about the debian-science-commits
mailing list