diff -Naur --exclude=CVS abi/src/text/fmt/xp/fb_Alignment.cpp abi-tab/src/text/fmt/xp/fb_Alignment.cpp --- abi/src/text/fmt/xp/fb_Alignment.cpp Fri Aug 18 10:17:44 2000 +++ abi-tab/src/text/fmt/xp/fb_Alignment.cpp Wed Aug 16 12:35:55 2000 @@ -30,7 +30,7 @@ // Alignment left ///////////////////////////////////////////////////////////// -void fb_Alignment_left::initialize(fp_Line *pLine) +void fb_Alignment_left::initialize(fp_Line * /*pLine*/ ) { } diff -Naur --exclude=CVS abi/src/text/fmt/xp/fb_LineBreaker.cpp abi-tab/src/text/fmt/xp/fb_LineBreaker.cpp --- abi/src/text/fmt/xp/fb_LineBreaker.cpp Fri Aug 18 10:17:44 2000 +++ abi-tab/src/text/fmt/xp/fb_LineBreaker.cpp Wed Aug 16 12:35:55 2000 @@ -139,21 +139,22 @@ if it's a left tab, then add its width to the m_iWorkingLineWidth */ - UT_sint32 iPos; - unsigned char iType; + UT_sint32 iPos; + eTabType iType; + eTabLeader iLeader; // Subtract the width already added then work out new // tab position. m_iWorkingLineWidth -= pCurrentRun->getWidthInLayoutUnits(); - UT_Bool bRes = pLine->findNextTabStopInLayoutUnits(m_iWorkingLineWidth, iPos, iType); + UT_Bool bRes = pLine->findNextTabStop(m_iWorkingLineWidth, iPos, iType, iLeader); if (bRes) { - - UT_DEBUGMSG(("%s(%d) tab run: type=%d height=%d width=%d offset=%d length=%d\n", + UT_DEBUGMSG(("%s:%d tab run: p=%p type=%d leader=%d height=%d width=%d offset=%d length=%d\n", __FILE__, __LINE__, - iType, + (int)iType, + (int)iLeader, pCurrentRun->getHeight(), pCurrentRun->getWidth(), pCurrentRun->getBlockOffset(), diff -Naur --exclude=CVS abi/src/text/fmt/xp/fl_BlockLayout.cpp abi-tab/src/text/fmt/xp/fl_BlockLayout.cpp --- abi/src/text/fmt/xp/fl_BlockLayout.cpp Fri Aug 18 12:24:56 2000 +++ abi-tab/src/text/fmt/xp/fl_BlockLayout.cpp Sun Aug 20 07:57:42 2000 @@ -148,7 +148,8 @@ { iPosition = 0; iPositionLayoutUnits = 0; - iType = 0; + iType = FL_TAB_NONE; + iLeader = FL_LEADER_NONE; } static int compare_tabs(const void* p1, const void* p2) @@ -284,8 +285,9 @@ const char* pszTabStops = getProperty((XML_Char*)"tabstops"); if (pszTabStops && pszTabStops[0]) { - unsigned char iType = 0; - UT_sint32 iPosition = 0; + eTabType iType = FL_TAB_NONE; + eTabLeader iLeader = FL_LEADER_NONE; + UT_sint32 iPosition = 0; const char* pStart = pszTabStops; while (*pStart) @@ -328,8 +330,13 @@ case 'L': // fall through default: iType = FL_TAB_LEFT; + UT_DEBUGMSG(("tabstop: unknown tab stop type [%c]\n", p1[1])); break; } + + // tab leaders + if ( p1 +2 != pEnd && p1[2] >= '0' && p1[2] <= (((UT_sint32)__FL_LEADER_MAX)+'0') ) + iLeader = (eTabLeader)(p1[2]-'0'); } char pszPosition[32]; @@ -353,6 +360,7 @@ pTabStop->iPosition = iPosition; pTabStop->iPositionLayoutUnits = UT_convertToLayoutUnits(pszPosition); pTabStop->iType = iType; + pTabStop->iLeader = iLeader; pTabStop->iOffset = pStart - pszTabStops; m_vecTabs.addItem(pTabStop); @@ -3669,12 +3677,16 @@ return bResult; } -UT_Bool fl_BlockLayout::findNextTabStop(UT_sint32 iStartX, UT_sint32 iMaxX, UT_sint32& iPosition, unsigned char& iType) +UT_Bool fl_BlockLayout::findNextTabStop( UT_sint32 iStartX, UT_sint32 iMaxX, UT_sint32& iPosition, + eTabType & iType, eTabLeader &iLeader ) { UT_ASSERT(iStartX >= 0); UT_uint32 iCountTabs = m_vecTabs.getItemCount(); UT_uint32 i; + + iLeader = FL_LEADER_NONE; + for (i=0; i= 0); UT_uint32 iCountTabs = m_vecTabs.getItemCount(); UT_uint32 i; + + UT_UNUSED(iLeader); // TODO FIXME + for (i=0; iiPosition; iType = pTab->iType; + iLeader = pTab->iLeader; iOffset = pTab->iOffset; return UT_TRUE; } @@ -4020,9 +4038,6 @@ void fl_BlockLayout::recheckIgnoredWords() { - fp_Run *pRun = m_pFirstRun; - UT_ASSERT(pRun); - fl_PartOfBlock* pPOB; // for scanning a word @@ -4124,6 +4139,7 @@ XML_Char* fl_BlockLayout::getListStyleString( List_Type iListType) { + XML_Char* style; // These strings match piece table styles and should not be diff -Naur --exclude=CVS abi/src/text/fmt/xp/fl_BlockLayout.h abi-tab/src/text/fmt/xp/fl_BlockLayout.h --- abi/src/text/fmt/xp/fl_BlockLayout.h Fri Aug 18 10:30:38 2000 +++ abi-tab/src/text/fmt/xp/fl_BlockLayout.h Sun Aug 20 07:50:56 2000 @@ -62,6 +62,28 @@ class fl_PartOfBlock; class fl_AutoNum; +// Tab types and leaders +typedef enum { + FL_TAB_NONE = 0, + FL_TAB_LEFT, + FL_TAB_CENTER, + FL_TAB_RIGHT, + FL_TAB_DECIMAL, + FL_TAB_BAR, + __FL_TAB_MAX +} eTabType; + +typedef enum { + FL_LEADER_NONE = 0, + FL_LEADER_DOT, + FL_LEADER_HYPHEN, + FL_LEADER_UNDERLINE, + FL_LEADER_THICKLINE, + FL_LEADER_EQUALSIGN, + __FL_LEADER_MAX +} eTabLeader; + + class fl_CharWidths { public: @@ -239,8 +261,14 @@ void checkSpelling(void); void debugFlashing(void); - UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32 iMaxX, UT_sint32& iPosition, unsigned char& iType); - UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32 iMaxX, UT_sint32& iPosition, unsigned char& iType); + UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32 iMaxX, + UT_sint32& iPosition, eTabType& iType, + eTabLeader &iLeader ); + UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32 iMaxX, + UT_sint32& iPosition, + eTabType& iType, + eTabLeader &iLeader); + inline UT_sint32 getDefaultTabInterval(void) const { return m_iDefaultTabInterval; } inline UT_sint32 getTabsCount(void) const { return (UT_sint32) m_vecTabs.getItemCount(); } @@ -292,7 +320,8 @@ fl_PartOfBlock* getSquiggle(UT_uint32 iOffset) const; void recheckIgnoredWords(); - static UT_Bool s_EnumTabStops(void * myThis, UT_uint32 k, UT_sint32 & iPosition, unsigned char & iType, UT_uint32 & iOffset); + static UT_Bool s_EnumTabStops(void * myThis, UT_uint32 k, UT_sint32 & iPosition, + eTabType & iType, eTabLeader &iLeader, UT_uint32 & iOffset ); inline void addBackgroundCheckReason(UT_uint32 reason) {m_uBackgroundCheckReasons |= reason;} inline void removeBackgroundCheckReason(UT_uint32 reason) {m_uBackgroundCheckReasons &= ~reason;} @@ -442,21 +471,14 @@ protected: }; -// TODO make a typedef to type type rather than just using 'unsigned char' - -#define FL_TAB_LEFT 1 -#define FL_TAB_CENTER 2 -#define FL_TAB_RIGHT 3 -#define FL_TAB_DECIMAL 4 -#define FL_TAB_BAR 5 - struct fl_TabStop { fl_TabStop(); UT_sint32 iPosition; UT_sint32 iPositionLayoutUnits; - unsigned char iType; + eTabType iType; + eTabLeader iLeader; UT_uint32 iOffset; }; diff -Naur --exclude=CVS abi/src/text/fmt/xp/fp_Line.cpp abi-tab/src/text/fmt/xp/fp_Line.cpp --- abi/src/text/fmt/xp/fp_Line.cpp Fri Aug 18 10:17:44 2000 +++ abi-tab/src/text/fmt/xp/fp_Line.cpp Wed Aug 16 12:35:55 2000 @@ -566,9 +566,10 @@ if (pRun->getType() == FPRUN_TAB) { UT_sint32 iPos; - unsigned char iTabType; + eTabType iTabType; + eTabLeader iTabLeader; - UT_Bool bRes = findNextTabStop(iX - iStartX, iPos, iTabType); + UT_Bool bRes = findNextTabStop(iX - iStartX, iPos, iTabType, iTabLeader); UT_ASSERT(bRes); fp_TabRun* pTabRun = static_cast(pRun); @@ -815,12 +816,13 @@ return bResult; } -UT_Bool fp_Line::findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition, unsigned char& iType) +UT_Bool fp_Line::findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition, eTabType & iType, eTabLeader & iLeader ) { - UT_sint32 iTabStopPosition = 0; - unsigned char iTabStopType; + UT_sint32 iTabStopPosition = 0; + eTabType iTabStopType = FL_TAB_NONE; + eTabLeader iTabStopLeader = FL_LEADER_NONE; - UT_Bool bRes = m_pBlock->findNextTabStop(iStartX + getX(), getX() + getMaxWidth(), iTabStopPosition, iTabStopType); + UT_Bool bRes = m_pBlock->findNextTabStop(iStartX + getX(), getX() + getMaxWidth(), iTabStopPosition, iTabStopType, iTabStopLeader); UT_ASSERT(bRes); iTabStopPosition -= getX(); @@ -829,6 +831,7 @@ { iPosition = iTabStopPosition; iType = iTabStopType; + iLeader = iTabStopLeader; return UT_TRUE; } @@ -838,12 +841,15 @@ } } -UT_Bool fp_Line::findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32& iPosition, unsigned char& iType) +UT_Bool fp_Line::findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32& iPosition, eTabType& iType, eTabLeader& iLeader ) { - UT_sint32 iTabStopPosition = 0; - unsigned char iTabStopType; - - UT_Bool bRes = m_pBlock->findNextTabStopInLayoutUnits(iStartX + getXInLayoutUnits(), getXInLayoutUnits() + getMaxWidthInLayoutUnits(), iTabStopPosition, iTabStopType); + UT_sint32 iTabStopPosition = 0; + eTabType iTabStopType = FL_TAB_NONE; + eTabLeader iTabStopLeader = FL_LEADER_NONE; + + UT_Bool bRes = m_pBlock->findNextTabStopInLayoutUnits( iStartX + getXInLayoutUnits(), + getXInLayoutUnits() + getMaxWidthInLayoutUnits(), + iTabStopPosition, iTabStopType, iTabStopLeader); UT_ASSERT(bRes); iTabStopPosition -= getXInLayoutUnits(); @@ -852,6 +858,7 @@ { iPosition = iTabStopPosition; iType = iTabStopType; + iLeader = iTabStopLeader; return UT_TRUE; } @@ -961,7 +968,6 @@ return UT_TRUE; } } - return UT_FALSE; } @@ -996,13 +1002,16 @@ if (pRun->getType() == FPRUN_TAB) { - UT_sint32 iPos; - unsigned char iTabType; + UT_sint32 iPos; + eTabType iTabType; + eTabLeader iTabLeader; - UT_Bool bRes = findNextTabStop(iX, iPos, iTabType); + UT_Bool bRes = findNextTabStop(iX, iPos, iTabType, iTabLeader); UT_ASSERT(bRes); UT_ASSERT(iTabType == FL_TAB_LEFT); + // TODO -- support all the tabs shack@uiuc.edu + fp_TabRun* pTabRun = static_cast(pRun); pTabRun->setWidth(iPos - iX); @@ -1035,9 +1044,10 @@ if (pRun->getType() == FPRUN_TAB) { UT_sint32 iPos; - unsigned char iTabType; + eTabType iTabType; + eTabLeader iTabLeader; - UT_Bool bRes = findNextTabStopInLayoutUnits(iX, iPos, iTabType); + UT_Bool bRes = findNextTabStopInLayoutUnits(iX, iPos, iTabType, iTabLeader); UT_ASSERT(bRes); UT_ASSERT(iTabType == FL_TAB_LEFT); diff -Naur --exclude=CVS abi/src/text/fmt/xp/fp_Line.h abi-tab/src/text/fmt/xp/fp_Line.h --- abi/src/text/fmt/xp/fp_Line.h Sun Jan 30 15:45:32 2000 +++ abi-tab/src/text/fmt/xp/fp_Line.h Wed Aug 16 12:35:56 2000 @@ -127,9 +127,9 @@ UT_Bool isLastCharacter(UT_UCSChar Character) const; - UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition, unsigned char& iType); - UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32& iPosition, unsigned char& iType); - + UT_Bool findNextTabStop(UT_sint32 iStartX, UT_sint32& iPosition, eTabType& iType, eTabLeader& iLeader ); + UT_Bool findNextTabStopInLayoutUnits(UT_sint32 iStartX, UT_sint32& iPosition, eTabType& iType, eTabLeader& iLeader); + void setNeedsRedraw(void) { m_bNeedsRedraw = UT_TRUE; m_pBlock->setNeedsRedraw();} UT_Bool needsRedraw(void) { return m_bNeedsRedraw; } void redrawUpdate(void); diff -Naur --exclude=CVS abi/src/text/fmt/xp/fp_Run.h abi-tab/src/text/fmt/xp/fp_Run.h --- abi/src/text/fmt/xp/fp_Run.h Fri Aug 18 10:17:44 2000 +++ abi-tab/src/text/fmt/xp/fp_Run.h Wed Aug 16 12:35:56 2000 @@ -160,7 +160,7 @@ virtual UT_Bool findMaxLeftFitSplitPointInLayoutUnits(UT_sint32 iMaxLeftWidth, fp_RunSplitInfo& si, UT_Bool bForce=UT_FALSE) = 0; virtual UT_sint32 findTrailingSpaceDistance(void) const { return 0; } virtual UT_sint32 findTrailingSpaceDistanceInLayoutUnits(void) const { return 0; } - virtual UT_Bool findFirstNonBlankSplitPoint(fp_RunSplitInfo& si) { return UT_FALSE; } + virtual UT_Bool findFirstNonBlankSplitPoint(fp_RunSplitInfo& /*si*/) { return UT_FALSE; } virtual void mapXYToPosition(UT_sint32 xPos, UT_sint32 yPos, PT_DocPosition& pos, UT_Bool& bBOL, UT_Bool& bEOL) = 0; virtual void findPointCoords(UT_uint32 iOffset, UT_sint32& x, UT_sint32& y, UT_sint32& height) = 0; virtual void lookupProperties(void) = 0; diff -Naur --exclude=CVS abi/src/wp/ap/Makefile abi-tab/src/wp/ap/Makefile --- abi/src/wp/ap/Makefile Fri Aug 18 10:17:45 2000 +++ abi-tab/src/wp/ap/Makefile Wed Aug 16 16:50:06 2000 @@ -40,6 +40,7 @@ $(OBJDIR)/ap_$(ABI_FE)Dialog_Replace.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_$(ABI_FE)Dialog_Spell.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_$(ABI_FE)Dialog_Columns.$(OBJ_SUFFIX) \ + $(OBJDIR)/ap_$(ABI_FE)Dialog_Tab.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_$(ABI_FE)Frame.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_$(ABI_FE)LeftRuler.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_$(ABI_FE)Prefs.$(OBJ_SUFFIX) \ @@ -82,6 +83,7 @@ $(OBJDIR)/ap_Dialog_Replace.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_Dialog_Spell.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_Dialog_Columns.$(OBJ_SUFFIX) \ + $(OBJDIR)/ap_Dialog_Tab.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_EditMethods.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_FrameData.$(OBJ_SUFFIX) \ $(OBJDIR)/ap_LeftRuler.$(OBJ_SUFFIX) \ diff -Naur --exclude=CVS abi/src/wp/ap/unix/Makefile abi-tab/src/wp/ap/unix/Makefile --- abi/src/wp/ap/unix/Makefile Thu Jul 27 23:34:31 2000 +++ abi-tab/src/wp/ap/unix/Makefile Wed Aug 16 12:35:56 2000 @@ -40,6 +40,7 @@ ap_$(ABI_FE)Dialog_Paragraph.cpp \ ap_$(ABI_FE)Dialog_Replace.cpp \ ap_$(ABI_FE)Dialog_Spell.cpp \ + ap_$(ABI_FE)Dialog_Tab.cpp \ ap_$(ABI_FE)Dialog_Stub.cpp \ ap_$(ABI_FE)Dialog_WordCount.cpp \ ap_$(ABI_FE)Dialog_Columns.cpp \ diff -Naur --exclude=CVS abi/src/wp/ap/unix/ap_UnixDialog_All.h abi-tab/src/wp/ap/unix/ap_UnixDialog_All.h --- abi/src/wp/ap/unix/ap_UnixDialog_All.h Fri Aug 18 10:17:46 2000 +++ abi-tab/src/wp/ap/unix/ap_UnixDialog_All.h Wed Aug 16 12:35:56 2000 @@ -49,6 +49,7 @@ # include "ap_UnixDialog_Paragraph.h" # include "ap_UnixDialog_Options.h" # include "ap_UnixDialog_Spell.h" +# include "ap_UnixDialog_Tab.h" # include "ap_UnixDialog_Insert_DateTime.h" # include "ap_UnixDialog_WordCount.h" # include "ap_UnixDialog_Field.h" @@ -97,9 +98,10 @@ DeclareDialog(AP_DIALOG_ID_GOTO, AP_UnixGnomeDialog_Goto) DeclareDialog(AP_DIALOG_ID_BREAK, AP_UnixGnomeDialog_Break) DeclareDialog(AP_DIALOG_ID_SPELL, AP_UnixDialog_Spell) - DeclareDialog(AP_DIALOG_ID_PARAGRAPH, AP_UnixGnomeDialog_Paragraph) + DeclareDialog(AP_DIALOG_ID_TAB, AP_UnixDialog_Tab) + DeclareDialog(AP_DIALOG_ID_PARAGRAPH, AP_UnixGnomeDialog_Paragraph) DeclareDialog(AP_DIALOG_ID_OPTIONS, AP_UnixGnomeDialog_Options) - DeclareDialog(AP_DIALOG_ID_INSERT_DATETIME, AP_UnixDialog_Insert_DateTime) + DeclareDialog(AP_DIALOG_ID_INSERT_DATETIME, AP_UnixDialog_Insert_DateTime) DeclareDialog(AP_DIALOG_ID_WORDCOUNT, AP_UnixGnomeDialog_WordCount) DeclareDialog(AP_DIALOG_ID_FIELD, AP_UnixGnomeDialog_Field) DeclareDialog(AP_DIALOG_ID_LISTS, AP_UnixGnomeDialog_Lists) @@ -126,7 +128,8 @@ DeclareDialog(AP_DIALOG_ID_BREAK, AP_UnixDialog_Break) DeclareDialog(AP_DIALOG_ID_SPELL, AP_UnixDialog_Spell) DeclareDialog(AP_DIALOG_ID_PARAGRAPH, AP_UnixDialog_Paragraph) - DeclareDialog(AP_DIALOG_ID_OPTIONS, AP_UnixDialog_Options) + DeclareDialog(AP_DIALOG_ID_OPTIONS, AP_UnixDialog_Options) + DeclareDialog(AP_DIALOG_ID_TAB, AP_UnixDialog_Tab) DeclareDialog(AP_DIALOG_ID_INSERT_DATETIME, AP_UnixDialog_Insert_DateTime) DeclareDialog(AP_DIALOG_ID_WORDCOUNT, AP_UnixDialog_WordCount) DeclareDialog(AP_DIALOG_ID_FIELD, AP_UnixDialog_Field) diff -Naur --exclude=CVS abi/src/wp/ap/unix/ap_UnixDialog_Tab.cpp abi-tab/src/wp/ap/unix/ap_UnixDialog_Tab.cpp --- abi/src/wp/ap/unix/ap_UnixDialog_Tab.cpp Thu May 11 14:16:59 2000 +++ abi-tab/src/wp/ap/unix/ap_UnixDialog_Tab.cpp Wed Aug 16 17:03:37 2000 @@ -19,6 +19,7 @@ #include "ut_types.h" #include "ut_string.h" +#include "ut_units.h" #include "ut_assert.h" #include "ut_debugmsg.h" @@ -27,6 +28,7 @@ #include "ut_dialogHelper.h" #include "gr_UnixGraphics.h" +#include "fl_BlockLayout.h" #include "xap_App.h" #include "xap_UnixApp.h" @@ -58,8 +60,8 @@ XAP_Dialog_Id id) : AP_Dialog_Tab(pDlgFactory,id) { - m_current_alignment = align_LEFT; - m_current_leader = leader_NONE; + m_current_alignment = FL_TAB_LEFT; + m_current_leader = FL_LEADER_NONE; m_bInSetCall = UT_FALSE; } @@ -794,10 +796,10 @@ UT_ASSERT(dlg); UT_ASSERT(widget && GTK_IS_LIST_ITEM(widget)); - tTabInfo *pTabInfo = (tTabInfo *) gtk_object_get_user_data(GTK_OBJECT(widget)); + fl_TabStop *pTabInfo = (fl_TabStop *) gtk_object_get_user_data(GTK_OBJECT(widget)); UT_ASSERT(pTabInfo); - UT_DEBUGMSG(("AP_UnixDialog_Tab::s_list_select [%s]\n", pTabInfo->pszTab )); + //UT_DEBUGMSG(("AP_UnixDialog_Tab::s_list_select [%s]\n", pTabInfo->pszTab )); // get the -1, 0.. (n-1) index dlg->m_iGtkListIndex = gtk_list_child_position(GTK_LIST(dlg->_lookupWidget(id_LIST_TAB)), widget); @@ -834,7 +836,7 @@ if ( dlg->m_bInSetCall || gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget)) == FALSE ) return; - dlg->m_current_alignment = (tAlignment)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget))); + dlg->m_current_alignment = (eTabType)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget))); UT_DEBUGMSG(("AP_UnixDialog_Tab::s_alignment_change [%c]\n", AlignmentToChar(dlg->m_current_alignment))); dlg->_event_somethingChanged(); @@ -849,7 +851,7 @@ if ( dlg->m_bInSetCall || gtk_toggle_button_get_active( GTK_TOGGLE_BUTTON(widget)) == FALSE ) return; - dlg->m_current_leader = (tLeader)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget))); + dlg->m_current_leader = (eTabLeader)((UT_uint32)gtk_object_get_user_data(GTK_OBJECT(widget))); UT_DEBUGMSG(("AP_UnixDialog_Tab::s_leader_change\n")); dlg->_event_somethingChanged(); @@ -868,7 +870,7 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AP_UnixDialog_Tab::tAlignment AP_UnixDialog_Tab::_gatherAlignment() +eTabType AP_UnixDialog_Tab::_gatherAlignment() { // for ( UT_uint32 i = (UT_uint32)id_ALIGN_LEFT; // i <= (UT_uint32)id_ALIGN_BAR; @@ -877,7 +879,7 @@ return m_current_alignment; } -void AP_UnixDialog_Tab::_setAlignment( AP_UnixDialog_Tab::tAlignment a ) +void AP_UnixDialog_Tab::_setAlignment( eTabType a ) { // NOTE - tControl id_ALIGN_LEFT .. id_ALIGN_BAR must be in the same order // as the tAlignment enums. @@ -898,12 +900,12 @@ } // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -AP_UnixDialog_Tab::tLeader AP_UnixDialog_Tab::_gatherLeader() +eTabLeader AP_UnixDialog_Tab::_gatherLeader() { - return leader_NONE; + return FL_LEADER_NONE; } -void AP_UnixDialog_Tab::_setLeader( AP_UnixDialog_Tab::tLeader a ) +void AP_UnixDialog_Tab::_setLeader( eTabLeader a ) { // NOTE - tControl id_LEADER_NONE .. id_ALIGN_BAR must be in the same order // as the tAlignment enums. @@ -945,17 +947,23 @@ GList *gList = NULL; GtkList *wList = GTK_LIST(_lookupWidget( id_LIST_TAB )); UT_uint32 i; - tTabInfo *pTabInfo; + fl_TabStop *pTabInfo; // clear all the items from the list gtk_list_clear_items( wList, 0, -1 ); for ( i = 0; i < v.getItemCount(); i++ ) { - pTabInfo = (tTabInfo *)v.getNthItem(i); + pTabInfo = (fl_TabStop *)v.getNthItem(i); // this will do for the time being, but if we want - GtkWidget *li = gtk_list_item_new_with_label( pTabInfo->pszTab ); + //GtkWidget *li = gtk_list_item_new_with_label( pTabInfo->pszTab ); + UT_DEBUGMSG(("%s:%d need to fix\n", __FILE__,__LINE__)); + + GtkWidget *li = gtk_list_item_new_with_label( + UT_convertToDimensionlessString( pTabInfo->iPositionLayoutUnits, + pTabInfo->iPosition )); + gtk_object_set_user_data( GTK_OBJECT(li), (gpointer) pTabInfo ); // we want to DO stuff diff -Naur --exclude=CVS abi/src/wp/ap/unix/ap_UnixDialog_Tab.h abi-tab/src/wp/ap/unix/ap_UnixDialog_Tab.h --- abi/src/wp/ap/unix/ap_UnixDialog_Tab.h Thu Jan 13 03:33:25 2000 +++ abi-tab/src/wp/ap/unix/ap_UnixDialog_Tab.h Wed Aug 16 12:35:56 2000 @@ -44,8 +44,8 @@ // we implement these so the XP dialog can set/grab our data #define SET_GATHER(a,t) virtual t _gather##a(void); \ virtual void _set##a( t ) - SET_GATHER (Alignment, tAlignment); - SET_GATHER (Leader, tLeader); + SET_GATHER (Alignment, eTabType); + SET_GATHER (Leader, eTabLeader); SET_GATHER (DefaultTabStop, UT_sint32); @@ -76,8 +76,8 @@ // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - // unix specific - tAlignment m_current_alignment; - tLeader m_current_leader; + eTabType m_current_alignment; + eTabLeader m_current_leader; UT_Bool m_bInSetCall; // a flag set to tell the change routines to ignore this message UT_sint32 m_iGtkListIndex; // the -1, 0.. (N-1) index for the N tabs diff -Naur --exclude=CVS abi/src/wp/ap/xp/Makefile abi-tab/src/wp/ap/xp/Makefile --- abi/src/wp/ap/xp/Makefile Thu Jul 27 23:34:33 2000 +++ abi-tab/src/wp/ap/xp/Makefile Wed Aug 16 16:49:00 2000 @@ -36,6 +36,7 @@ ap_Dialog_Replace.cpp \ ap_Dialog_Spell.cpp \ ap_Dialog_Columns.cpp \ + ap_Dialog_Tab.cpp \ ap_EditMethods.cpp \ ap_FrameData.cpp \ ap_LeftRuler.cpp \ diff -Naur --exclude=CVS abi/src/wp/ap/xp/ap_Dialog_Id.h abi-tab/src/wp/ap/xp/ap_Dialog_Id.h --- abi/src/wp/ap/xp/ap_Dialog_Id.h Thu Jul 27 23:34:33 2000 +++ abi-tab/src/wp/ap/xp/ap_Dialog_Id.h Wed Aug 16 12:35:56 2000 @@ -37,6 +37,7 @@ AP_DIALOG_ID_SPELL, /* spell check */ AP_DIALOG_ID_PARAGRAPH, /* paragraph settings dialog */ AP_DIALOG_ID_OPTIONS, /* edit|options settings dialog */ + AP_DIALOG_ID_TAB, /* tabs */ AP_DIALOG_ID_INSERT_DATETIME, /* insert date and time dialog */ AP_DIALOG_ID_FIELD, /* insert field dialog */ AP_DIALOG_ID_WORDCOUNT, /* word count dialog */ diff -Naur --exclude=CVS abi/src/wp/ap/xp/ap_Dialog_Tab.cpp abi-tab/src/wp/ap/xp/ap_Dialog_Tab.cpp --- abi/src/wp/ap/xp/ap_Dialog_Tab.cpp Thu May 11 14:07:45 2000 +++ abi-tab/src/wp/ap/xp/ap_Dialog_Tab.cpp Wed Aug 16 12:35:56 2000 @@ -47,7 +47,7 @@ AP_Dialog_Tab::~AP_Dialog_Tab(void) { - UT_VECTOR_PURGEALL(tTabInfo *, m_tabInfo); + UT_VECTOR_PURGEALL(fl_TabStop *, m_tabInfo); } AP_Dialog_Tab::tAnswer AP_Dialog_Tab::getAnswer(void) const @@ -74,51 +74,49 @@ rulerInfo.m_iDefaultTabInterval, rulerInfo.m_pszTabStops )); - + + // save the tab string location + m_pszTabStops = rulerInfo.m_pszTabStops; + int iTab; - tTabInfo *pTabInfo; + fl_TabStop *pTabInfo; for ( iTab = 0; iTab < rulerInfo.m_iTabStops; iTab++ ) { // create new tab info - pTabInfo = new tTabInfo(); + pTabInfo = new fl_TabStop(); UT_ASSERT(pTabInfo); -#if 0 - // get tab information - (*rulerInfo.m_pfnEnumTabStops)( - rulerInfo.m_pVoidEnumTabStopsData, // void* pData - iTab, // UT_uint32 k - pTabInfo->iPosition, // UT_sint32& iPosition - pTabInfo->iType, // unsigned char& iType - pTabInfo->iOffset, // UT_uint32& iOffset - pTabInfo->iLeader ); -#else -// TMN: Pathched to get it to compile. Either 'iLeader' has been added here, -// and the corresponding header has not been updated, or the the header -// have dropped this last parameter. Let's hope it's the last assumption. - (*rulerInfo.m_pfnEnumTabStops)( - rulerInfo.m_pVoidEnumTabStopsData, - iTab, - pTabInfo->iPosition, - pTabInfo->iType, - pTabInfo->iOffset); -#endif + + (*rulerInfo.m_pfnEnumTabStops)( rulerInfo.m_pVoidEnumTabStopsData, + iTab, pTabInfo->iPosition, pTabInfo->iType, pTabInfo->iLeader, + pTabInfo->iOffset ); + + // if we're NOT the last tab + //if ( iTab + 1 != rulerInfo.mTabStops ) + //{ +// +// } + // else + //{ +// + // } + // parse string stuff out - int i = 0; - while ( rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] && - rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != '/' && // remove /... - rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != ',' ) - i++; + //int i = 0; + //while ( rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] && + // rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != '/' && // remove /... + // rulerInfo.m_pszTabStops[pTabInfo->iOffset + i] != ',' ) + // i++; // allocate a copy of the buffer (NOTE - we don't use all the space) - pTabInfo->pszTab = new char[i+1]; - memcpy( pTabInfo->pszTab, &rulerInfo.m_pszTabStops[pTabInfo->iOffset], i ); - pTabInfo->pszTab[i] = '\0'; + //pTabInfo->pszTab = new char[i+1]; + //memcpy( pTabInfo->pszTab, &rulerInfo.m_pszTabStops[pTabInfo->iOffset], i ); + //pTabInfo->pszTab[i] = '\0'; // debug msgs - UT_DEBUGMSG(("position=%d str=%s\n", pTabInfo->iPosition, pTabInfo->pszTab )); + //UT_DEBUGMSG(("position=%d str=%s\n", pTabInfo->iPosition, pTabInfo->pszTab )); m_tabInfo.addItem(pTabInfo); } @@ -175,7 +173,7 @@ UT_DEBUGMSG(("AP_Dialog_Tab::_event_TabChange\n")); } -void AP_Dialog_Tab::_event_TabSelected( tTabInfo *pTabInfo ) +void AP_Dialog_Tab::_event_TabSelected( fl_TabStop *pTabInfo ) { UT_DEBUGMSG(("AP_Dialog_Tab::_event_TabSelected\n")); @@ -186,10 +184,12 @@ // common set of constants. ap_TopRuler.cpp defines all the constants // again. Here, since enum is rel 0, i'm subtracting one and doing an // ugly type cast - _setAlignment( (tAlignment)(pTabInfo->iType - 1) ); + _setAlignment( pTabInfo->iType ); // set the edit box's text - _setTabEdit( pTabInfo->pszTab ); + //_setTabEdit( pTabInfo->pszTab ); + + UT_DEBUGMSG(("%s:%d need to setTabEdit\n",__FILE__,__LINE__)); // something changed... _event_somethingChanged(); @@ -210,29 +210,29 @@ UT_DEBUGMSG(("AP_Dialog_Tab::_event_ClearAll\n")); } -/*static*/ unsigned char AP_Dialog_Tab::AlignmentToChar( AP_Dialog_Tab::tAlignment a ) +/*static*/ unsigned char AP_Dialog_Tab::AlignmentToChar( eTabType a ) { char ch; switch ( a ) { - case AP_Dialog_Tab::align_LEFT: + case FL_TAB_LEFT: ch = 'L'; break; - case AP_Dialog_Tab::align_RIGHT: + case FL_TAB_RIGHT: ch = 'R'; break; - case AP_Dialog_Tab::align_CENTER: + case FL_TAB_CENTER: ch = 'C'; break; - case AP_Dialog_Tab::align_DECIMAL: + case FL_TAB_DECIMAL: ch = 'D'; break; - case AP_Dialog_Tab::align_BAR: + case FL_TAB_BAR: // fall through default: @@ -244,35 +244,34 @@ return ch; } -/*static*/ AP_Dialog_Tab::tAlignment AP_Dialog_Tab::CharToAlignment( unsigned char ch ) +/*static*/ eTabType AP_Dialog_Tab::CharToAlignment( unsigned char ch ) { - tAlignment a; + eTabType a; switch ( ch ) { case 'L': - a = align_LEFT; + a = FL_TAB_LEFT; break; case 'R': - a = align_RIGHT; + a = FL_TAB_RIGHT; break; case 'C': - a = align_CENTER; + a = FL_TAB_CENTER; break; case 'D': - a = align_DECIMAL; + a = FL_TAB_DECIMAL; break; case 'B': // not implemented, fall though - // a = align_BAR; - // break; + //a = FL_TAB_BAR; + //break; default: UT_ASSERT(UT_NOT_IMPLEMENTED); - a = align_LEFT; - + a = FL_TAB_LEFT; } return a; } @@ -281,11 +280,11 @@ { _clearList(); - UT_VECTOR_PURGEALL(tTabInfo *, m_tabInfo); + UT_VECTOR_PURGEALL(fl_TabStop *, m_tabInfo); } -void AP_Dialog_Tab::buildTab( char *buffer, int bufflen ) +void AP_Dialog_Tab::buildTab( char *buffer, UT_uint32 /*bufflen*/ ) { // TODO - use snprintf sprintf( buffer, "%s/%c", _gatherTabEdit(), AlignmentToChar(_gatherAlignment())); @@ -306,9 +305,10 @@ for ( UT_uint32 i = 0; i < m_tabInfo.getItemCount(); i++ ) { - tTabInfo *pTabInfo = (tTabInfo *)m_tabInfo.getNthItem(i); + fl_TabStop *pTabInfo = (fl_TabStop *)m_tabInfo.getNthItem(i); UT_ASSERT(pTabInfo); +#if 0 // if we have a tab at that unit if ( !strcmp(buffer, pTabInfo->pszTab) ) { @@ -320,6 +320,7 @@ bEnableSet = UT_FALSE; } +#endif } _controlEnable( id_BUTTON_SET, bEnableSet ); diff -Naur --exclude=CVS abi/src/wp/ap/xp/ap_Dialog_Tab.h abi-tab/src/wp/ap/xp/ap_Dialog_Tab.h --- abi/src/wp/ap/xp/ap_Dialog_Tab.h Thu Jan 13 03:33:25 2000 +++ abi-tab/src/wp/ap/xp/ap_Dialog_Tab.h Wed Aug 16 12:35:56 2000 @@ -24,6 +24,7 @@ #include "xap_Dialog.h" #include "xav_View.h" #include "ut_units.h" +#include "fl_BlockLayout.h" class XAP_Frame; @@ -43,8 +44,10 @@ typedef enum { id_EDIT_TAB = 0, id_LIST_TAB, id_SPIN_DEFAULT_TAB_STOP, + // should be in same order as eTabType (fl_BlockLayout.h) id_ALIGN_LEFT, id_ALIGN_CENTER, id_ALIGN_RIGHT, id_ALIGN_DECIMAL, id_ALIGN_BAR, + // should be in same order as eTabLeader (fl_BlockLayout.h) id_LEADER_NONE, id_LEADER_DOT, id_LEADER_DASH, id_LEADER_UNDERLINE, id_BUTTON_SET, id_BUTTON_CLEAR, id_BUTTON_CLEAR_ALL, @@ -52,22 +55,13 @@ id_last } tControl; - typedef enum { align_LEFT = 0, align_CENTER, align_RIGHT, - align_DECIMAL, align_BAR } tAlignment; - - typedef enum { leader_NONE = 0, leader_DOT, leader_DASH, - leader_UNDERLINE } tLeader; - AP_Dialog_Tab::tAnswer getAnswer(void) const; - - static unsigned char AlignmentToChar( tAlignment ); - static tAlignment CharToAlignment( unsigned char ); - - // clear the tab list void clearList(); + static unsigned char AlignmentToChar( eTabType a ); + static eTabType CharToAlignment( unsigned char ch ); protected: @@ -85,15 +79,14 @@ void _storeWindowData(void); // grab tab from the current text/align/leader controls - void buildTab( char *buffer, int bufferlen ); + void buildTab( char *buffer, UT_uint32 bufferlen ); // the actual access functions #define SET_GATHER(a,u) virtual u _gather##a(void) = 0; \ virtual void _set##a( u ) = 0 - SET_GATHER (Alignment, tAlignment); - SET_GATHER (Leader, tLeader); - SET_GATHER (DefaultTabStop, UT_sint32); - + SET_GATHER (Alignment, eTabType); + SET_GATHER (Leader, eTabLeader); + SET_GATHER (DefaultTabStop, UT_sint32); // at this point, in current default units // to populate the whole list SET_GATHER (TabList, const UT_Vector &); @@ -114,21 +107,14 @@ tAnswer m_answer; XAP_Frame * m_pFrame; - typedef struct { - char * pszTab; - UT_sint32 iPosition; - unsigned char iType; - XML_Char iLeader; - UT_uint32 iOffset; - } tTabInfo; - - UT_Vector m_tabInfo; // list of tTabInfo * + const char * m_pszTabStops; // from rulerInfo + UT_Vector m_tabInfo; // list of fl_TabStop * - tTabInfo *m_CurrentTab; // the tab item selected + fl_TabStop *m_CurrentTab; // the tab item selected // AP level handlers void _event_TabChange(void); // when the edit box changes - void _event_TabSelected( tTabInfo *tabSelect); // when a list item is selected + void _event_TabSelected( fl_TabStop *tabSelect); // when a list item is selected void _event_Set(void); // buttons void _event_Clear(void); diff -Naur --exclude=CVS abi/src/wp/ap/xp/ap_EditMethods.cpp abi-tab/src/wp/ap/xp/ap_EditMethods.cpp --- abi/src/wp/ap/xp/ap_EditMethods.cpp Fri Aug 18 10:17:46 2000 +++ abi-tab/src/wp/ap/xp/ap_EditMethods.cpp Sun Aug 20 07:51:01 2000 @@ -51,6 +51,7 @@ #include "ap_Dialog_Lists.h" #include "ap_Dialog_Options.h" #include "ap_Dialog_Spell.h" +#include "ap_Dialog_Tab.h" #include "ap_Dialog_Insert_DateTime.h" #include "ap_Dialog_Field.h" #include "ap_Dialog_WordCount.h" @@ -866,11 +867,11 @@ static UT_Bool s_AskCloseAllAndExit(XAP_Frame * pFrame) { // return UT_TRUE if we should quit. - return (pFrame->showMessageBox(AP_STRING_ID_MSG_QueryExit, XAP_Dialog_MessageBox::b_YN, XAP_Dialog_MessageBox::a_NO) == XAP_Dialog_MessageBox::a_YES); + } static XAP_Dialog_MessageBox::tAnswer s_AskSaveFile(XAP_Frame * pFrame) @@ -3041,14 +3042,22 @@ = (AP_Dialog_Goto *)(pDialogFactory->requestDialog(id)); UT_ASSERT(pDialog); - if(pDialog->isRunning() == UT_TRUE) + pDialog->runModeless(pFrame); + + UT_Bool bOK = UT_TRUE; + + // get result? + + pDialogFactory->releaseDialog(pDialog); + + if(pDialog->isRunning() == UT_TRUE) { - pDialog->activate(); - } + pDialog->activate(); + } else - { - pDialog->setView(pView); - pDialog->runModeless(pFrame); + { + pDialog->setView(pView); + pDialog->runModeless(pFrame); } return UT_TRUE; } @@ -3435,6 +3444,44 @@ return UT_TRUE; } +static UT_Bool s_doTabDlg(FV_View * pView) +{ + XAP_Frame * pFrame = (XAP_Frame *) pView->getParentData(); + UT_ASSERT(pFrame); + + pFrame->raise(); + + XAP_DialogFactory * pDialogFactory + = (XAP_DialogFactory *)(pFrame->getDialogFactory()); + + AP_Dialog_Tab * pDialog + = (AP_Dialog_Tab *)(pDialogFactory->requestDialog(AP_DIALOG_ID_TAB)); + UT_ASSERT(pDialog); + + // run the dialog + pDialog->runModal(pFrame); + + // get the dialog answer + AP_Dialog_Tab::tAnswer answer = pDialog->getAnswer(); + + switch (answer) + { + case AP_Dialog_Tab::a_OK: + + break; + + case AP_Dialog_Tab::a_CANCEL: + // do nothing + break; + default: + UT_ASSERT(UT_SHOULD_NOT_HAPPEN); + } + + pDialogFactory->releaseDialog(pDialog); + + return UT_TRUE; +} + /*****************************************************************/ Defun1(dlgFont) @@ -4358,11 +4405,9 @@ Defun1(dlgTabs) { - XAP_Frame * pFrame = static_cast ( pAV_View->getParentData()); - UT_ASSERT(pFrame); - - s_TellNotImplemented(pFrame, "Tabs dialog", __LINE__); - return UT_TRUE; + ABIWORD_VIEW; + + return s_doTabDlg(pView); } Defun0(noop) diff -Naur --exclude=CVS abi/src/wp/ap/xp/ap_String_Id.h abi-tab/src/wp/ap/xp/ap_String_Id.h --- abi/src/wp/ap/xp/ap_String_Id.h Fri Aug 18 10:17:46 2000 +++ abi-tab/src/wp/ap/xp/ap_String_Id.h Wed Aug 16 12:35:56 2000 @@ -216,6 +216,28 @@ dcl(DLG_Options_Prompt_IgnoreResetCurrent, "Do you want to reset ignored words in the current document?" ) dcl(DLG_Options_Prompt_IgnoreResetAll, "Do you want to reset ignored words in all the documents?" ) +dcl(DLG_Tab_TabTitle, "Tabs") +dcl(DLG_Tab_Label_TabPosition, "Tab stop position:") +dcl(DLG_Tab_Label_TabToClear, "Tab stops to be cleared:") +dcl(DLG_Tab_Label_DefaultTS, "Default tab stops:") + +dcl(DLG_Tab_Label_Alignment, "Alignment") +dcl(DLG_Tab_Radio_Left, "Left") +dcl(DLG_Tab_Radio_Center, "Center") +dcl(DLG_Tab_Radio_Right, "Right") +dcl(DLG_Tab_Radio_Decimal, "Decimal") +dcl(DLG_Tab_Radio_Bar, "Bar") + +dcl(DLG_Tab_Label_Leader, "Leader") +dcl(DLG_Tab_Radio_None, "&1 None") +dcl(DLG_Tab_Radio_Dot, "&2 ..........") +dcl(DLG_Tab_Radio_Dash, "&3 ----------") +dcl(DLG_Tab_Radio_Underline, "&4 __________") + +dcl(DLG_Tab_Button_Set, "Set") +dcl(DLG_Tab_Button_Clear, "Clear") +dcl(DLG_Tab_Button_ClearAll, "Clear &All") + dcl(DLG_DateTime_DateTimeTitle, "Date and Time") dcl(DLG_DateTime_AvailableFormats, "&Available formats:") diff -Naur --exclude=CVS abi/src/wp/ap/xp/ap_TopRuler.cpp abi-tab/src/wp/ap/xp/ap_TopRuler.cpp --- abi/src/wp/ap/xp/ap_TopRuler.cpp Fri Aug 18 10:17:46 2000 +++ abi-tab/src/wp/ap/xp/ap_TopRuler.cpp Wed Aug 16 12:55:06 2000 @@ -35,16 +35,6 @@ #include "ap_StatusBar.h" #include "ap_Strings.h" -// HACK: private copy of constants from fl_BlockLayout.h -// TODO: find a better way of passing iType for tabs? -// NOTE: this ordering is convenient for cycling m_iDefaultTabType - -#define FL_TAB_LEFT 1 -#define FL_TAB_CENTER 2 -#define FL_TAB_RIGHT 3 -#define FL_TAB_DECIMAL 4 -#define FL_TAB_BAR 5 - #define tr_TABINDEX_NEW -1 #define tr_TABINDEX_NONE -2 @@ -592,12 +582,13 @@ void AP_TopRuler::_getTabStopXAnchor(AP_TopRulerInfo * pInfo, UT_sint32 k, UT_sint32 * pTab, - unsigned char & iType) + eTabType & iType) { UT_sint32 xAbsLeft = _getFirstPixelInColumn(pInfo,pInfo->m_iCurrentColumn); UT_sint32 iPosition; UT_uint32 iOffset; + eTabLeader iLeader; if (k == tr_TABINDEX_NEW) { @@ -611,7 +602,7 @@ UT_ASSERT(km_iTabStops); UT_Bool bRes = pInfo->m_pfnEnumTabStops(pInfo->m_pVoidEnumTabStopsData, - k, iPosition, iType, iOffset); + k, iPosition, iType, iLeader, iOffset ); UT_ASSERT(bRes); } @@ -641,7 +632,7 @@ { UT_sint32 anchor; UT_Rect rect; - unsigned char iType; + eTabType iType; if (m_draggingWhat == DW_TABSTOP) { @@ -711,7 +702,7 @@ } UT_sint32 AP_TopRuler::_findTabStop(AP_TopRulerInfo * pInfo, - UT_uint32 x, UT_uint32 y, unsigned char & iType) + UT_uint32 x, UT_uint32 y, eTabType & iType) { // hit-test all the existing tabs // return the index of the one found @@ -749,10 +740,11 @@ UT_sint32 iPosition; UT_uint32 iOffset; - unsigned char iType; + eTabType iType; + eTabLeader iLeader; UT_Bool bRes = pInfo->m_pfnEnumTabStops(pInfo->m_pVoidEnumTabStopsData, - k, iPosition, iType, iOffset); + k, iPosition, iType, iLeader, iOffset ); UT_ASSERT(bRes); const char* pStart = &pInfo->m_pszTabStops[iOffset]; @@ -1092,6 +1084,7 @@ case FL_TAB_CENTER: m_iDefaultTabType = FL_TAB_RIGHT; break; case FL_TAB_RIGHT: m_iDefaultTabType = FL_TAB_DECIMAL; break; case FL_TAB_DECIMAL: m_iDefaultTabType = FL_TAB_LEFT; break; + default: UT_DEBUGMSG(("Should not happen, tab type %d\n", m_iDefaultTabType)); } _drawTabToggle(NULL, UT_TRUE); return; @@ -1099,7 +1092,7 @@ // next hit-test against the tabs - unsigned char iType; + eTabType iType; UT_sint32 iTab = _findTabStop(&m_infoCache, x, s_iFixedHeight/2 + s_iFixedHeight/4 - 3, iType); if (iTab >= 0) { @@ -1415,7 +1408,8 @@ case DW_TABSTOP: { - unsigned char iType; + eTabType iType; + UT_sint32 iTab = _findTabStop(&m_infoCache, xgrid+xAbsLeft, s_iFixedHeight/2 + s_iFixedHeight/4 - 3, iType); UT_DEBUGMSG (("iTab: %i, m_draggingTab: %i\n", iTab, m_draggingTab)); @@ -2261,7 +2255,7 @@ } } -void AP_TopRuler::_drawTabStop(UT_Rect & rect, unsigned char iType, UT_Bool bFilled) +void AP_TopRuler::_drawTabStop(UT_Rect & rect, eTabType iType, UT_Bool bFilled) { GR_Graphics::GR_Color3D clr3d; if (bFilled) diff -Naur --exclude=CVS abi/src/wp/ap/xp/ap_TopRuler.h abi-tab/src/wp/ap/xp/ap_TopRuler.h --- abi/src/wp/ap/xp/ap_TopRuler.h Thu Jul 20 18:17:10 2000 +++ abi-tab/src/wp/ap/xp/ap_TopRuler.h Wed Aug 16 12:35:56 2000 @@ -30,6 +30,7 @@ #include "ap_Ruler.h" #include "ev_EditBits.h" #include "gr_Graphics.h" +#include "fl_BlockLayout.h" #include "xap_Strings.h" class XAP_App; @@ -61,7 +62,9 @@ // tab stop information - UT_Bool (*m_pfnEnumTabStops)(void * pData, UT_uint32 k, UT_sint32 & iPosition, unsigned char & iType, UT_uint32 & iOffset); + UT_Bool (*m_pfnEnumTabStops)(void * pData, UT_uint32 k, + UT_sint32 & iPosition, eTabType & iType, eTabLeader & iLeader, + UT_uint32 & iOffset ); void * m_pVoidEnumTabStopsData; UT_sint32 m_iTabStops; UT_sint32 m_iDefaultTabInterval; @@ -156,13 +159,13 @@ void _getTabToggleRect(UT_Rect * prToggle); void _drawTabToggle(const UT_Rect * pClipRect, UT_Bool bErase); - void _getTabStopXAnchor(AP_TopRulerInfo * pInfo, UT_sint32 k, UT_sint32 * pTab, unsigned char & iType); + void _getTabStopXAnchor(AP_TopRulerInfo * pInfo, UT_sint32 k, UT_sint32 * pTab, eTabType & iType); void _getTabStopRect(AP_TopRulerInfo * pInfo, UT_sint32 anchor, UT_Rect * pRect); void _drawTabProperties(const UT_Rect * pClipRect, AP_TopRulerInfo * pInfo, UT_Bool bDrawAll = UT_TRUE); - UT_sint32 _findTabStop(AP_TopRulerInfo * pInfo, UT_uint32 x, UT_uint32 y, unsigned char & iType); + UT_sint32 _findTabStop(AP_TopRulerInfo * pInfo, UT_uint32 x, UT_uint32 y, eTabType & iType); const char * _getTabStopString(AP_TopRulerInfo * pInfo, UT_sint32 k); void _getTabZoneRect(AP_TopRulerInfo * pInfo, UT_Rect &rZone); void _setTabStops(ap_RulerTicks tick, UT_sint32 iTab, UT_Bool bDelete); @@ -187,7 +190,7 @@ void _drawLeftIndentMarker(UT_Rect & r, UT_Bool bFilled); void _drawRightIndentMarker(UT_Rect & r, UT_Bool bFilled); void _drawFirstLineIndentMarker(UT_Rect & r, UT_Bool bFilled); - void _drawTabStop(UT_Rect & r, unsigned char iType, UT_Bool bFilled); + void _drawTabStop(UT_Rect & r, eTabType iType, UT_Bool bFilled); void _drawColumnGapMarker(UT_Rect & r); UT_Bool _isInBottomBoxOfLeftIndent(UT_uint32 y); void _displayStatusMessage(XAP_String_Id messageID, const ap_RulerTicks &tick, double dValue); @@ -236,11 +239,11 @@ UT_sint32 m_dragging2Center; /* center of drag-along */ UT_Rect m_dragging2Rect; /* rect of drag-along */ UT_sint32 m_draggingTab; /* index of tab being dragged */ - unsigned char m_draggingTabType; + eTabType m_draggingTabType; UT_sint32 m_dragStart; UT_Bool m_bBeforeFirstMotion; - unsigned char m_iDefaultTabType; + eTabType m_iDefaultTabType; UT_Bool m_bGuide; /* UT_TRUE ==> guide line XORed onscreen */ UT_sint32 m_xGuide; /* valid iff m_bGuide */