updated clip (1.1.8-2) + doc + big cleanup of it's .conf git-svn-id: http://www.rocklinux.org/svn/rock-linux/trunk@2343 c5f82cb5-29bc-0310-9cd0-bff59a50e3bcrocklinux
@ -0,0 +1,254 @@ |
|||||
|
diff -uNdr clip-prg-1.1.8-1/clip/classes/tb_obj.prg clip-prg-1.1.8-1.new/clip/classes/tb_obj.prg
|
||||
|
--- clip-prg-1.1.8-1/clip/classes/tb_obj.prg 2004-02-04 18:40:25.000000000 -0300
|
||||
|
+++ clip-prg-1.1.8-1.new/clip/classes/tb_obj.prg 2004-02-05 17:40:37.000000000 -0300
|
||||
|
@@ -293,49 +293,75 @@
|
||||
|
static func __sayTable |
||||
|
local visLen,col,colSep,lensep,lenhsep |
||||
|
local strsep1,strsep2,strseph,scol,len,strings |
||||
|
- local i,j,k,s,ccc,headsep,strhsep1, x,y
|
||||
|
+ local i,j,k,s,ccc,ccs,headsep,strhsep1, x,y
|
||||
|
local heading:=.t., footing:=.t. |
||||
|
#ifdef DEBUG_CALL |
||||
|
outlog(__FILE__,__LINE__,"sayTable") |
||||
|
#endif |
||||
|
if ::winbuffer==nil; dispBegin(); endif |
||||
|
|
||||
|
+ // separators: NIL don't separate
|
||||
|
+ // "" empty separation (for cols "" act as NIL)
|
||||
|
+ // * use those chars
|
||||
|
+
|
||||
|
+ // heading/footing if at least one has separator defined
|
||||
|
visLen= len(::__colVisible) |
||||
|
j=0;k=0 |
||||
|
for i=1 to visLen |
||||
|
col=::__colVisible[i] |
||||
|
headSep:=::__columns[col]:headSep |
||||
|
- if headSep!=NIL .and. headSep==""
|
||||
|
+ //INFO: cleaner to honor the semantic descripted above
|
||||
|
+ //if headSep!=NIL .and. headSep==""
|
||||
|
+ if headSep==NIL
|
||||
|
j++ |
||||
|
endif |
||||
|
headSep:=::__columns[col]:footSep |
||||
|
- if headSep!=NIL .and. headSep==""
|
||||
|
+ //if headSep!=NIL .and. headSep==""
|
||||
|
+ if headSep==NIL
|
||||
|
k++ |
||||
|
endif |
||||
|
next |
||||
|
- heading := !(j==visLen)
|
||||
|
- footing := !(k==vislen)
|
||||
|
+ heading := iif( (j==visLen),::headSep!=NIL, .t. )
|
||||
|
+ footing := iif( (k==vislen),::footSep!=NIL, .t. )
|
||||
|
for i=1 to visLen |
||||
|
col=::__colVisible[i] |
||||
|
len=::__columnsLen[col] |
||||
|
colSep:=::__columns[col]:colSep |
||||
|
colsep:=iif(colSep==NIL,::colSep,colSep) |
||||
|
lenSep:=len(colSep) |
||||
|
- strsep1:=iif(lenSep>2,substr(colsep,3,1),"")
|
||||
|
- lenSep:=iif(lenSep==3,3,1)
|
||||
|
- strsep1:=space(len(strsep1))
|
||||
|
- strsep2:=substr(colsep,1,2)
|
||||
|
- strsep2:=space(len(strsep2))
|
||||
|
+ if lenSep>2
|
||||
|
+ strsep1:=" "
|
||||
|
+ strsep2:=" "
|
||||
|
+ lenSep:=3
|
||||
|
+ else
|
||||
|
+ strsep1:=""
|
||||
|
+ if lenSep==0
|
||||
|
+ strsep2:=""
|
||||
|
+ else
|
||||
|
+ strsep2:=" "
|
||||
|
+ lenSep:=1
|
||||
|
+ endif
|
||||
|
+ endif
|
||||
|
scol=::__whereVisible[i] |
||||
|
len=min(len,::nright-scol-lenSep+len(strSep2)) |
||||
|
strings:=::__HeadStrings[col] |
||||
|
- ccc:=::__colors[1]
|
||||
|
- if ::__columns[col]:defColor!=NIL
|
||||
|
- ccc:=::__colors[::__columns[col]:defColor[1]]
|
||||
|
- endif
|
||||
|
+ // choose heading color
|
||||
|
+ //INFO: the whole header must use defColor[3], including sep.
|
||||
|
+ // but we can trick this using colorHeading
|
||||
|
if ::__columns[col]:colorHeading!=NIL |
||||
|
ccc:=::__colors[::__columns[col]:colorHeading] |
||||
|
+ elseif ::__columns[col]:defColor!=NIL
|
||||
|
+ ccc:=::__colors[::__columns[col]:defColor[3]]
|
||||
|
+ else
|
||||
|
+ ccc:=::__colors[1]
|
||||
|
+ endif
|
||||
|
+ // and heading separator color ;-)
|
||||
|
+ if ::__columns[col]:defColor!=NIL
|
||||
|
+ ccs:=::__colors[::__columns[col]:defColor[3]]
|
||||
|
+ else
|
||||
|
+ ccs:=::__colors[1]
|
||||
|
endif |
||||
|
+ // display strings
|
||||
|
for j=1 to len(strings ) |
||||
|
s=padr(strings[j],len) |
||||
|
y := ::nTop+j-1 |
||||
|
@@ -343,42 +369,44 @@
|
||||
|
if ::__columns[col]:colSepH != nil |
||||
|
strseph:=substr(::__columns[col]:colSepH,j,1) |
||||
|
if ::winbuffer == nil |
||||
|
- dispOutAt(::nTop+j-1, scol-1,strseph,::__colors[1])
|
||||
|
+ dispOutAt(::nTop+j-1, scol-1,strseph,ccs)
|
||||
|
else |
||||
|
- winbuf_out_at(::winbuffer,::nTop+j-1, scol-1,strseph,::__colors[1])
|
||||
|
+ winbuf_out_at(::winbuffer,::nTop+j-1, scol-1,strseph,ccs)
|
||||
|
endif |
||||
|
x := scol-1 + len(strseph) |
||||
|
else |
||||
|
if ::winbuffer == nil |
||||
|
- dispOutAt(::nTop+j-1, scol,strsep1,::__colors[1])
|
||||
|
+ dispOutAt(::nTop+j-1, scol,strsep1,ccs)
|
||||
|
else |
||||
|
- winbuf_out_at(::winbuffer,::nTop+j-1, scol,strsep1,::__colors[1])
|
||||
|
+ winbuf_out_at(::winbuffer,::nTop+j-1, scol,strsep1,ccs)
|
||||
|
endif |
||||
|
x := scol + len(strsep1) |
||||
|
endif |
||||
|
if ::winbuffer == nil |
||||
|
dispOut(s,ccc) |
||||
|
- dispOut(iif(i<visLen,strSep2,""),::__colors[1])
|
||||
|
+ dispOut(iif(i<visLen,strSep2,""),ccs)
|
||||
|
else |
||||
|
winbuf_out_at(::winbuffer,y,x,s,ccc) |
||||
|
x += len(s) |
||||
|
- winbuf_out_at(::winbuffer,y,x,iif(i<visLen,strSep2,""),::__colors[1])
|
||||
|
+ winbuf_out_at(::winbuffer,y,x,iif(i<visLen,strSep2,""),ccs)
|
||||
|
x += len(iif(i<visLen,strSep2,"")) |
||||
|
endif |
||||
|
if i==visLen |
||||
|
if ::winbuffer == nil |
||||
|
- dispout(space(::nRight-col()+1),::__colors[1])
|
||||
|
+ dispout(space(::nRight-col()+1),ccs)
|
||||
|
else |
||||
|
- winbuf_out_at(::winbuffer,y,x,space(::nRight-col()+1),::__colors[1])
|
||||
|
+ winbuf_out_at(::winbuffer,y,x,space(::nRight-col()+1),ccs)
|
||||
|
endif |
||||
|
endif |
||||
|
next |
||||
|
+ // heading separator
|
||||
|
headSep:=::__columns[col]:headSep |
||||
|
headSep:=iif(headSep==NIL,::headSep,headSep) |
||||
|
lenHSep=len(headSep) |
||||
|
- strhsep1=right(headsep,1)
|
||||
|
j:=len(strings) |
||||
|
- if heading .and. ((j>0 .and. lenHSep>0 ) .or. !empty(::headSep))
|
||||
|
+ if heading
|
||||
|
+ if headSep != ""
|
||||
|
+ strhsep1=right(headsep,1)
|
||||
|
if ::__columns[col]:colSepH != nil .and. len(::__columns[col]:colSepH)>j |
||||
|
strseph:=substr(::__columns[col]:colSepH,j+1,1) |
||||
|
if ::winbuffer == nil |
||||
|
@@ -401,36 +429,45 @@
|
||||
|
winbuf_out_at(::winbuffer,y,x, replicate(strHsep1,::nright-col()+1),::__colors[1]) |
||||
|
endif |
||||
|
endif |
||||
|
+ endif
|
||||
|
j++ |
||||
|
endif |
||||
|
::__rect[1]=::nTop+j |
||||
|
strings:=::__footStrings[col] |
||||
|
- ccc:=::__colors[1]
|
||||
|
- if ::__columns[col]:defColor!=NIL
|
||||
|
- ccc:=::__colors[::__columns[col]:defColor[1]]
|
||||
|
- endif
|
||||
|
+ // choose footing color
|
||||
|
if ::__columns[col]:colorFooting!=NIL |
||||
|
ccc:=::__colors[::__columns[col]:colorFooting] |
||||
|
+ elseif ::__columns[col]:defColor!=NIL
|
||||
|
+ ccc:=::__colors[::__columns[col]:defColor[4]]
|
||||
|
+ else
|
||||
|
+ ccc:=::__colors[1]
|
||||
|
+ endif
|
||||
|
+ // and footing separator color
|
||||
|
+ if ::__columns[col]:defColor!=NIL
|
||||
|
+ ccc:=::__colors[::__columns[col]:defColor[4]]
|
||||
|
+ else
|
||||
|
+ ccc:=::__colors[1]
|
||||
|
endif |
||||
|
+ // display strings
|
||||
|
for j=1 to len(strings) |
||||
|
s=padr(strings[j],len) |
||||
|
if ::winbuffer == nil |
||||
|
- dispOutAt(::nBottom-j+1, scol, strsep1, ::__colors[1])
|
||||
|
+ dispOutAt(::nBottom-j+1, scol, strsep1, ccs)
|
||||
|
dispOut(s, ccc) |
||||
|
- dispOut(iif(i<visLen,strSep2,"") , ::__colors[1])
|
||||
|
+ dispOut(iif(i<visLen,strSep2,"") , ccs)
|
||||
|
if i==visLen |
||||
|
- dispout(space(::nRight-col()+1),::__colors[1])
|
||||
|
+ dispout(space(::nRight-col()+1),ccs)
|
||||
|
endif |
||||
|
else |
||||
|
- winbuf_out_at(::winbuffer,::nBottom-j+1, scol, strsep1, ::__colors[1])
|
||||
|
+ winbuf_out_at(::winbuffer,::nBottom-j+1, scol, strsep1, ccs)
|
||||
|
y := ::nBottom-j+1 |
||||
|
x := scol + len(strsep1) |
||||
|
winbuf_out_at(::winbuffer,y,x,s,ccc) |
||||
|
x += len(s) |
||||
|
- winbuf_out_at(::winbuffer,y,x,iif(i<visLen,strSep2,"") , ::__colors[1])
|
||||
|
+ winbuf_out_at(::winbuffer,y,x,iif(i<visLen,strSep2,"") , ccs)
|
||||
|
x += len(iif(i<visLen,strSep2,"")) |
||||
|
if i==visLen |
||||
|
- winbuf_out_at(::winbuffer,y,x,space(::nRight-col()+1),::__colors[1])
|
||||
|
+ winbuf_out_at(::winbuffer,y,x,space(::nRight-col()+1),ccs)
|
||||
|
endif |
||||
|
endif |
||||
|
next |
||||
|
@@ -442,7 +479,8 @@
|
||||
|
//endif |
||||
|
j:=len(strings) |
||||
|
//if ( j>0 .and. lenHSep>0 ) .or. !empty(::footSep) |
||||
|
- if footing .and. lenHSep>0 .and. !empty(headSep)
|
||||
|
+ if footing .and. j>0
|
||||
|
+ if headSep != ""
|
||||
|
if ::winbuffer == nil |
||||
|
dispOutAt(::nBottom-j, scol, replicate(strHsep1,len)+iif(i<visLen,headsep,"") , ::__colors[1]) |
||||
|
if i==vislen |
||||
|
@@ -457,6 +495,7 @@
|
||||
|
winbuf_out_at(::winbuffer,y,x,replicate(strHsep1,::nright-col()+1),::__colors[1]) |
||||
|
endif |
||||
|
endif |
||||
|
+ endif
|
||||
|
j++ |
||||
|
endif |
||||
|
::__rect[3]=::nBottom-j |
||||
|
@@ -483,6 +522,19 @@
|
||||
|
::__footStrings:={} |
||||
|
max_hr:=0; max_hf:=0 |
||||
|
for i=1 to len(::__columns) |
||||
|
+ // acording to clipper 5.3 documentation defColor has 4 elements.
|
||||
|
+ // hack to ensure those 4 elements.
|
||||
|
+ if ::__columns[i]:defColor!=NIL
|
||||
|
+ a := {,,,}
|
||||
|
+ for j=1 to len(::__columns[i]:defColor)
|
||||
|
+ a[j] := ::__columns[i]:defColor[j]
|
||||
|
+ next
|
||||
|
+ do while j<=4
|
||||
|
+ a[j++] := ::__columns[i]:defColor[1]
|
||||
|
+ enddo
|
||||
|
+ ::__columns[i]:defColor := a
|
||||
|
+ endif
|
||||
|
+
|
||||
|
h:=::__columns[i]:heading |
||||
|
//hr:=iif(empty(h),0,occurs(";",h)+1) |
||||
|
hr:=iif(h==NIL .or. h=="",0,occurs(";",h)+1) |
||||
|
diff -uNdr clip-prg-1.1.8-1/clip/classes/tcol_obj.prg clip-prg-1.1.8-1.new/clip/classes/tcol_obj.prg
|
||||
|
--- clip-prg-1.1.8-1/clip/classes/tcol_obj.prg 2004-02-04 18:40:25.000000000 -0300
|
||||
|
+++ clip-prg-1.1.8-1.new/clip/classes/tcol_obj.prg 2004-02-04 19:27:06.000000000 -0300
|
||||
|
@@ -15,7 +15,7 @@
|
||||
|
obj:colorBlock:=NIL |
||||
|
obj:colSep:=NIL |
||||
|
obj:colSepH:=NIL |
||||
|
- obj:defColor:={1,2}
|
||||
|
+ obj:defColor:={1,2,1,1}
|
||||
|
obj:footing:=NIL |
||||
|
obj:colorFooting:=NIL |
||||
|
obj:footSep:=NIL |
@ -1,78 +0,0 @@ |
|||||
# --- ROCK-COPYRIGHT-NOTE-BEGIN --- |
|
||||
# |
|
||||
# This copyright note is auto-generated by ./scripts/Create-CopyPatch. |
|
||||
# Please add additional copyright information _after_ the line containing |
|
||||
# the ROCK-COPYRIGHT-NOTE-END tag. Otherwise it might get removed by |
|
||||
# the ./scripts/Create-CopyPatch script. Do not edit this copyright text! |
|
||||
# |
|
||||
# ROCK Linux: rock-src/package/mnemoc/clip/postgresql.patch |
|
||||
# ROCK Linux is Copyright (C) 1998 - 2004 Clifford Wolf |
|
||||
# |
|
||||
# This patch file is dual-licensed. It is available under the license the |
|
||||
# patched project is licensed under, as long as it is an OpenSource license |
|
||||
# as defined at http://www.opensource.org/ (e.g. BSD, X11) or under the terms |
|
||||
# of the GNU General Public License as published by the Free Software |
|
||||
# Foundation; either version 2 of the License, or (at your option) any later |
|
||||
# version. |
|
||||
# |
|
||||
# --- ROCK-COPYRIGHT-NOTE-END --- |
|
||||
|
|
||||
--- ./cliplibs/clip-postgres/Makefile 2004-01-19 11:36:31.000000000 -0300
|
|
||||
+++ ./cliplibs/clip-postgres/Makefile.in 2004-01-19 12:22:53.000000000 -0300
|
|
||||
@@ -13,19 +13,20 @@
|
|
||||
TARGET=libclip-postgres$(DLLSUFF) |
|
||||
ATARGET=libclip-postgres.a |
|
||||
RTARGET=libclip-postgres$(DLLREALSUFF) |
|
||||
-PGINC = -I/usr/include/pgsql -I/usr/include/postgresql -I/usr/include/pgsql/server -I/usr/include -I/usr/local/include
|
|
||||
+PGINC = -I@PGINCDIR@
|
|
||||
+PGLIB = -L@PGLIBDIR@
|
|
||||
OBJS=pg_clip.o pg.o |
|
||||
|
|
||||
all: have_lib $(TARGET) $(ATARGET) |
|
||||
|
|
||||
have_lib: |
|
||||
- test -f /usr/include/pgsql/libpq-fe.h -o -f /usr/include/postgresql/libpq-fe.h -o -f /usr/include/pgsql/server/libpq-fe.h -o -f /usr/include/libpq-fe.h -o -f /usr/local/include/libpq-fe.h
|
|
||||
+ test -f @PGINCDIR@/libpq-fe.h
|
|
||||
|
|
||||
$(TARGET): $(OBJS) |
|
||||
- $(CLIPROOT)/bin/clip_makeslib $(TARGET) $(OBJS) -lpq -L/usr/local/lib -L/usr/local/pgsql/lib
|
|
||||
+ $(CLIPROOT)/bin/clip_makeslib $(TARGET) $(OBJS) -lpq $(PGLIB)
|
|
||||
|
|
||||
$(ATARGET): $(OBJS) |
|
||||
- $(CLIPROOT)/bin/clip_makelib $(ATARGET) $(OBJS) -lpq -L/usr/local/lib/ -L/usr/local/pgsql/lib
|
|
||||
+ $(CLIPROOT)/bin/clip_makelib $(ATARGET) $(OBJS) -lpq $(PGLIB)
|
|
||||
|
|
||||
pg_clip.o: pg_clip.c |
|
||||
$(CC) $(C_FLAGS) $(CLIPINCLUDE) $(PGINC) -c pg_clip.c |
|
||||
--- /dev/null 1969-12-31 21:00:00.000000000 -0300
|
|
||||
+++ ./cliplibs/clip-postgres/configure 2004-01-19 12:37:45.000000000 -0300
|
|
||||
@@ -0,0 +1,29 @@
|
|
||||
+#!/bin/sh
|
|
||||
+
|
|
||||
+if [ -z "$PGINCDIR" ]; then
|
|
||||
+ for x in /usr/include/pgsql \
|
|
||||
+ /usr/include/pgsql/server \
|
|
||||
+ /usr/include/postgresql \
|
|
||||
+ /opt/postgresql/include
|
|
||||
+ do
|
|
||||
+ if [ -f "$x/libpq-fe.h" ]; then
|
|
||||
+ PGINCDIR=$x
|
|
||||
+ break
|
|
||||
+ fi
|
|
||||
+ done
|
|
||||
+fi
|
|
||||
+if [ -z "$PGLIBDIR" ]; then
|
|
||||
+ for x in /usr/local/lib \
|
|
||||
+ /usr/local/pgsql/lib \
|
|
||||
+ /opt/postgresql/lib
|
|
||||
+ do
|
|
||||
+ if [ -f "$x/libpq.so" ]; then
|
|
||||
+ PGLIBDIR=$x
|
|
||||
+ break
|
|
||||
+ fi
|
|
||||
+ done
|
|
||||
+fi
|
|
||||
+
|
|
||||
+sed -e "s,@PGINCDIR@,${PGINCDIR:-/usr/include},g" \
|
|
||||
+ -e "s,@PGLIBDIR@,${PGLIBDIR:-/usr/lib},g" \
|
|
||||
+ Makefile.in > Makefile
|
|