CChannels Class Reference

#include <channels.h>

List of all members.

Public Member Functions

 CChannels ()
 ~CChannels ()
void busy_blink ()
void busy_on ()
void busy_off ()
void pagebar_set_count (const int count)
void pagebar_set_current_page (const int number)
GBool onReceiveToolbarMsg (const int iconID, const int state)
void setPanState (const int state)
GBool isPanEnable () const
int getPanState () const
void setZoomIn (const int state)
GBool isZoomInEnable () const
int getZoomInState () const
void setZoomOut (const int state)
GBool isZoomOutEnable () const
int getZoomOutState () const
void setRotateState (const int state)
int getRotateState () const
void setContinousState (const int state)
int getContinousState () const
void setZoombackState (const int state)
int getZoombackState () const
int getBackwardState () const
void setBackwardState (const int state)
int getForwardState () const
void setForwardState (const int state)
GBool isToolbarDirty () const
eDmQuality getToolbarUpdateType () const
void setToolbarDirty (GBool b=gTrue)
void setToolbarUpdateType (const eDmQuality t=dmQTyping)
void redrawToolbar (GBool bSync=gTrue)
void popupKeyboard (GBool bPopup=gTrue)
void updateScribbleIcons (ScbDocPtr pDoc)
void initScribbleState (ScbDocPtr pDoc)
void onScribbleIconsClicked (const int iconID, const int state)
void setScribbleNone (ScbDocPtr pDoc)
GBool isScribbleEnable () const
GBool isEraseEnable () const
GBool isScribbleIcon (const int id)

Public Attributes

erClientChannel_t erbusyChannel
erClientChannel_t erpagebarChannel
erClientChannel_t ertoolbarChannel
erServerChannel_t erIpcChannel

Private Member Functions

void initialize ()

Private Attributes

int nPanState
int nZoominState
int nZoomoutState
int nRotateState
int nContinousState
int nZoombackState
int nBackwardState
int nForwardState
ScbDocPtr doc
GBool tbDirty
eDmQuality tbUpdateType


Detailed Description

Definition at line 38 of file channels.h.


Constructor & Destructor Documentation

CChannels::CChannels (  ) 

Definition at line 23 of file channels.cpp.

00024 : doc(NULL)
00025 , tbUpdateType(dmQUndefined)
00026 {
00027     initialize();
00028 }

Here is the call graph for this function:

CChannels::~CChannels (  ) 

Definition at line 30 of file channels.cpp.

00031 {
00032 }


Member Function Documentation

void CChannels::initialize (  )  [private]

Definition at line 34 of file channels.cpp.

00035 {
00036     // busy indicator
00037     erIpcStartClient(ER_BUSYD_CHANNEL, &erbusyChannel);
00038 
00039     // pagebar
00040     erIpcStartClient(ER_PAGEBAR_CHANNEL, &erpagebarChannel);
00041     
00042     // toolbar 
00043     erIpcStartClient(ER_TOOLBAR_CHANNEL, &ertoolbarChannel);
00044     tbSelectIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
00045     
00046     // disable redraw
00047     tbDisableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID); 
00048     tbClearIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
00049     
00050     // trashcan
00051     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, -1);
00052     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_trashcan, iconState_grey );
00053     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, -1);
00054     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_normal );
00055     
00056     // rotation
00057     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_portrait_landscape, ccVwrToolbar);
00058     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_portrait_landscape, iconState_normal );
00059 
00060     // page mode <--> continous mode
00061     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_page_mode, ccVwrToolbar);
00062     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_page_mode, iconState_normal );
00063 
00064     // zoom fit
00065     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomfit, ccVwrToolbar);
00066     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomfit, iconState_normal );
00067     
00068     // zoom in
00069     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomin, ccVwrToolbar);
00070     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomin, iconState_normal);
00071 
00072     // zoom back
00073     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomback, ccVwrToolbar);
00074     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomback, iconState_grey);
00075 
00076     // remove zoomout 
00077     // tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomout, ccVwrToolbar);
00078     // tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomout, iconState_normal );
00079     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pan, ccVwrToolbar);
00080     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pan, iconState_normal );
00081     
00082     // backward 
00083     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_back, ccVwrToolbar);
00084     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_back, iconState_grey );
00085 
00086     // forward
00087     tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_forward, ccVwrToolbar);
00088     tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_forward, iconState_grey);
00089 
00090     // draw
00091     tbEnableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID); 
00092     
00093     nPanState = nZoominState = nZoomoutState = iconState_normal;
00094     nZoombackState = iconState_grey;
00095     nContinousState = iconState_normal;
00096     nRotateState = PortraitToLandscape;
00097     nBackwardState = nForwardState = iconState_grey;
00098 
00099     // scribble icons are initialized by other function.
00100 }

Here is the call graph for this function:

void CChannels::busy_blink (  ) 

Definition at line 275 of file channels.cpp.

00276 {
00277     busySetBusy(erbusyChannel, ccBusyState_Blink);
00278 }

Here is the call graph for this function:

void CChannels::busy_on (  ) 

Definition at line 280 of file channels.cpp.

00281 {
00282     busySetBusy(erbusyChannel, ccBusyState_On);
00283 }

Here is the call graph for this function:

void CChannels::busy_off (  ) 

Definition at line 285 of file channels.cpp.

00286 {
00287     busySetBusy(erbusyChannel, ccBusyState_Off);
00288 }

Here is the call graph for this function:

void CChannels::pagebar_set_count ( const int  count  ) 

Definition at line 292 of file channels.cpp.

00293 {
00294     pbReset(erpagebarChannel, ER_PDF_VIEWER_UA_ID);
00295     pbSetPageCount(erpagebarChannel, ER_PDF_VIEWER_UA_ID, count);
00296     pbRedraw(erpagebarChannel, ER_PDF_VIEWER_UA_ID);
00297 
00298 }

Here is the call graph for this function:

void CChannels::pagebar_set_current_page ( const int  number  ) 

Definition at line 300 of file channels.cpp.

00301 {
00302     pbSetCurrentPage(erpagebarChannel, ER_PDF_VIEWER_UA_ID, number);
00303     pbRedraw(erpagebarChannel, ER_PDF_VIEWER_UA_ID);
00304     pbSynchronise(erpagebarChannel, ER_PDF_VIEWER_UA_ID);   
00305 }

Here is the call graph for this function:

GBool CChannels::onReceiveToolbarMsg ( const int  iconID,
const int  state 
)

Definition at line 308 of file channels.cpp.

00309 {
00310     if (iconID == iconID_zoomin)
00311     {
00312         if (iconState_selected == nZoominState)
00313         {
00314             setToolbarDirty();
00315             setZoomIn(iconState_normal);
00316         }
00317         else if (iconState_normal == nZoominState)
00318         {
00319             setToolbarDirty();
00320             setZoomIn(iconState_selected);
00321             if (isZoomOutEnable())
00322             {
00323                 setZoomOut(iconState_normal);
00324             }
00325             if (isPanEnable())
00326             {
00327                 setPanState(iconState_normal);
00328             }  
00329             setScribbleNone(doc);
00330         }            
00331         PV_TBPRINTF("Zoomin %d\n", nZoominState);
00332     }
00333     else if (iconID == iconID_zoomout)
00334     {
00335         if (iconState_selected == nZoomoutState)
00336         {
00337             setToolbarDirty();
00338             setZoomOut(iconState_normal);
00339         }
00340         else if (iconState_normal == nZoomoutState)
00341         {
00342             setToolbarDirty();
00343             setZoomOut(iconState_selected); 
00344             if (isZoomInEnable())
00345             {
00346                 setZoomIn(iconState_normal);   
00347             }  
00348             if (isPanEnable())
00349             {
00350                 setPanState(iconState_normal);
00351             }   
00352             setScribbleNone(doc);                                   
00353         }
00354     }
00355     else if (iconID == iconID_pan)
00356     {
00357         if (iconState_normal == nPanState)
00358         {
00359             setToolbarDirty();
00360             setPanState(iconState_selected);
00361             if (isZoomInEnable())
00362             {
00363                 setZoomIn(iconState_normal);   
00364             }  
00365             if (isZoomOutEnable())
00366             {
00367                 setZoomOut(iconState_normal);   
00368             }  
00369             setScribbleNone(doc);
00370         }
00371         else if (iconState_selected == nPanState)
00372         {
00373             setToolbarDirty();
00374             setPanState(iconState_normal);
00375         }  
00376         PV_TBPRINTF("Pan %d\n", nPanState);          
00377     }
00378     else if ((iconID == iconID_pen) || 
00379              (iconID >= iconID_pen1pixel && iconID <= iconID_pen7pixel) ||
00380              (iconID >= iconID_pen1pixelLow && iconID <= iconID_pen7pixelLow) ||
00381              (iconID >= iconID_penblackLow && iconID <= iconID_penwhiteLow) ||
00382              (iconID >= iconID_penblack && iconID <= iconID_penwhite) ||
00383              (iconID == iconID_eraseline))
00384     {
00385         onScribbleIconsClicked(iconID, state);
00386     }
00387     return isToolbarDirty();
00388 }

Here is the call graph for this function:

void CChannels::setPanState ( const int  state  )  [inline]

Definition at line 77 of file channels.h.

00077 { nPanState = state; }

GBool CChannels::isPanEnable (  )  const [inline]

Definition at line 78 of file channels.h.

00078 { return iconState_selected == nPanState; }

int CChannels::getPanState (  )  const [inline]

Definition at line 79 of file channels.h.

00079 { return nPanState; }

void CChannels::setZoomIn ( const int  state  )  [inline]

Definition at line 80 of file channels.h.

00080 { nZoominState = state; }

GBool CChannels::isZoomInEnable (  )  const [inline]

Definition at line 81 of file channels.h.

00081 { return iconState_selected == nZoominState; }

int CChannels::getZoomInState (  )  const [inline]

Definition at line 82 of file channels.h.

00082 { return nZoominState; }

void CChannels::setZoomOut ( const int  state  )  [inline]

Definition at line 83 of file channels.h.

00083 { nZoomoutState = state; }

GBool CChannels::isZoomOutEnable (  )  const [inline]

Definition at line 84 of file channels.h.

00084 { return iconState_selected == nZoomoutState; }

int CChannels::getZoomOutState (  )  const [inline]

Definition at line 85 of file channels.h.

00085 { return nZoomoutState; }

void CChannels::setRotateState ( const int  state  )  [inline]

Definition at line 86 of file channels.h.

00086 { nRotateState = state; }

int CChannels::getRotateState (  )  const [inline]

Definition at line 87 of file channels.h.

00087 { return nRotateState; }

void CChannels::setContinousState ( const int  state  )  [inline]

Definition at line 88 of file channels.h.

00088 { nContinousState = state; }

int CChannels::getContinousState (  )  const [inline]

Definition at line 89 of file channels.h.

00089 { return nContinousState; }

void CChannels::setZoombackState ( const int  state  )  [inline]

Definition at line 90 of file channels.h.

00090 { nZoombackState = state; }

int CChannels::getZoombackState (  )  const [inline]

Definition at line 91 of file channels.h.

00091 { return nZoombackState; }

int CChannels::getBackwardState (  )  const [inline]

Definition at line 92 of file channels.h.

00092 { return nBackwardState; }

void CChannels::setBackwardState ( const int  state  )  [inline]

Definition at line 93 of file channels.h.

00093 { nBackwardState = state; }

int CChannels::getForwardState (  )  const [inline]

Definition at line 94 of file channels.h.

00094 { return nForwardState; }

void CChannels::setForwardState ( const int  state  )  [inline]

Definition at line 95 of file channels.h.

00095 { nForwardState = state; }

GBool CChannels::isToolbarDirty (  )  const [inline]

Definition at line 97 of file channels.h.

00097 { return tbDirty;}    

eDmQuality CChannels::getToolbarUpdateType (  )  const [inline]

Definition at line 99 of file channels.h.

00099 { return  tbUpdateType; }

void CChannels::setToolbarDirty ( GBool  b = gTrue  )  [inline]

Definition at line 100 of file channels.h.

00100 { tbDirty = b;  }

void CChannels::setToolbarUpdateType ( const eDmQuality  t = dmQTyping  )  [inline]

Definition at line 101 of file channels.h.

00101 { tbUpdateType = t;}

void CChannels::redrawToolbar ( GBool  bSync = gTrue  ) 

Definition at line 390 of file channels.cpp.

00391 {
00392     if (isToolbarDirty())
00393     {
00394         // avoid redraw again and again, it's more faster
00395         tbDisableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);   
00396         tbClearIconSet(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);
00397         
00398         // rotate
00399         if (PortraitToLandscape == nRotateState)
00400         {
00401             tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_portrait_landscape, ccVwrToolbar);
00402             tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_portrait_landscape, iconState_normal);
00403         }
00404         else if (LandscapeToPortrait == nRotateState)
00405         {
00406             tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_landscape_portrait, ccVwrToolbar);
00407             tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_landscape_portrait, iconState_selected);
00408         }
00409 
00410         // page/continous mode 
00411         if (iconState_normal == nContinousState)
00412         {
00413             tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_page_mode, ccVwrToolbar);
00414             tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_page_mode, iconState_normal);
00415         }
00416         else if (3 == nContinousState)
00417         {
00418             tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_continuous_mode, ccVwrToolbar);
00419             tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_continuous_mode, iconState_selected);
00420         }            
00421 
00422         // zoom fit
00423         tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomfit, ccVwrToolbar);
00424         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomfit, iconState_normal );
00425     
00426         // zoom in
00427         tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomin, ccVwrToolbar);
00428         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomin, nZoominState);
00429 
00430         // zoom back
00431         tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomback, ccVwrToolbar);
00432         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_zoomback, nZoombackState);
00433 
00434         // temp. 
00435         tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pan, ccVwrToolbar);
00436         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pan, nPanState );
00437 
00438         // backward
00439         tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_back, ccVwrToolbar);
00440         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_back, nBackwardState);
00441     
00442         // forward
00443         tbAppendPlatformIcon(  ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_forward, ccVwrToolbar);
00444         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_forward, nForwardState);
00445         
00446         // scribble icons        
00447         updateScribbleIcons(doc);
00448         
00449         // repaint only once
00450         tbEnableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);   
00451         
00452         if (bSync)
00453         {
00454             tbSynchronise(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, ccVwrToolbarSync);
00455         }            
00456         setToolbarDirty(gFalse);
00457     }
00458 }

Here is the call graph for this function:

void CChannels::popupKeyboard ( GBool  bPopup = gTrue  ) 

Definition at line 468 of file channels.cpp.

00469 {   
00470     if (bPopup)
00471     {
00472         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_selected);
00473     }        
00474     else
00475     {
00476         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_keyboard, iconState_normal);
00477     }
00478 }

Here is the call graph for this function:

void CChannels::updateScribbleIcons ( ScbDocPtr  pDoc  ) 

Definition at line 104 of file channels.cpp.

00105 {
00106     // scribble could be disabled by manifest file.
00107     if (pDoc == 0) 
00108     {
00109         tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pen, ccVwrToolbar);
00110         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pen, iconState_grey);
00111         return;
00112     }        
00113 
00114     int index  = 0;
00115     // scribble icon
00116     tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pen, ccVwrToolbar);
00117     if (SCB_TBS_SCRIBBLE == pDoc->context.curState)
00118     {
00119         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_pen, iconState_selected);
00120     }
00121     
00122     // line icon
00123     if (SCB_TBS_SELECT_PEN_SIZE == pDoc->context.curState)
00124     {
00125         for(index = iconID_pen1pixelLow; index <= iconID_pen7pixelLow; ++index)
00126         {
00127             tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, index, ccVwrToolbar);
00128         }
00129         index = (int)iconID_pen1pixelLow + pDoc->context.curStrokeStyle.penSize/2;
00130         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, index, iconState_selected);
00131     }
00132     else
00133     {
00134         // line icon
00135         index = (int)iconID_pen1pixel + doc->context.curStrokeStyle.penSize/2;
00136         tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, index, ccVwrToolbar);
00137     }
00138 
00139     // color icon
00140     if (SCB_TBS_SELECT_LINE_COLOR == pDoc->context.curState)
00141     {
00142         for(index = iconID_penwhiteLow ; index >=iconID_penblackLow; --index)
00143         {
00144             tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, index, ccVwrToolbar);
00145         }
00146         index = (int)iconID_penblackLow + (int)SCB_DEV_COLOR_BLACK - (int)doc->context.curStrokeStyle.color;
00147         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, index, iconState_selected);
00148     }
00149     else
00150     {
00151         index = (int)iconID_penblack + (int)SCB_DEV_COLOR_BLACK - (int)doc->context.curStrokeStyle.color;
00152         tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, index, ccVwrToolbar);
00153     }
00154 
00155     // erase icon
00156     tbAppendPlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_eraseline, ccVwrToolbar);
00157     if (SCB_TBS_ERASE == pDoc->context.curState)
00158     {
00159         tbSetStatePlatformIcon(ertoolbarChannel, ER_PDF_VIEWER_UA_ID, iconID_eraseline, iconState_selected);
00160     }
00161 }

Here is the call graph for this function:

void CChannels::initScribbleState ( ScbDocPtr  pDoc  ) 

Definition at line 163 of file channels.cpp.

00164 {
00165     if (pDoc)
00166     {
00167         doc = pDoc;
00168         doc->context.curState = SCB_TBS_NONE;
00169     }        
00170     tbDisableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);   
00171     updateScribbleIcons(doc);
00172     tbEnableUpdate(ertoolbarChannel, ER_PDF_VIEWER_UA_ID);   
00173 }

Here is the call graph for this function:

void CChannels::onScribbleIconsClicked ( const int  iconID,
const int  state 
)

Definition at line 189 of file channels.cpp.

00190 {
00191     if (doc == 0)
00192     {
00193         return;
00194     }
00195 
00196     // zoom in/out and pan
00197     if (iconState_selected == nZoominState)
00198     {
00199         setToolbarDirty();
00200         setZoomIn(iconState_normal);
00201     }
00202     if (iconState_selected == nZoomoutState)
00203     {
00204         setToolbarDirty();
00205         setZoomOut(iconState_normal);
00206     }
00207     if (iconState_selected == nPanState)
00208     {
00209         setToolbarDirty();
00210         setPanState(iconState_normal);
00211     }      
00212 
00213     if (iconID == iconID_pen)
00214     {
00215         if (SCB_TBS_SCRIBBLE == doc->context.curState)
00216         {
00217             doc->context.curState = SCB_TBS_NONE;
00218         }
00219         else
00220         {
00221             doc->context.curState = SCB_TBS_SCRIBBLE;
00222         }
00223         setToolbarDirty(); 
00224     }
00225     else if (iconID_pen1pixel <= iconID && (int)iconID_pen7pixel >= iconID)
00226     {
00227         if (SCB_TBS_SELECT_PEN_SIZE != doc->context.curState)
00228         {
00229             doc->context.curState = SCB_TBS_SELECT_PEN_SIZE;
00230         }
00231         setToolbarDirty();
00232     }
00233     else if (iconID_pen1pixelLow <= iconID && iconID_pen7pixelLow >= iconID)
00234     {
00235         doc->context.curState = SCB_TBS_SCRIBBLE;
00236         doc->context.curStrokeStyle.penSize = ((int)iconID - (int)iconID_pen1pixelLow) * 2 + 1;
00237         setToolbarDirty();
00238     }
00239     else if ((int)iconID_penblack <= iconID && (int)iconID_penwhite >= iconID)
00240     {
00241         if (SCB_TBS_SELECT_LINE_COLOR != doc->context.curState)
00242         {
00243             doc->context.curState = SCB_TBS_SELECT_LINE_COLOR;
00244         }
00245         setToolbarDirty();
00246     }
00247     else if (iconID_penblackLow <= iconID && iconID_penwhiteLow >= iconID)
00248     {
00249         doc->context.curState = SCB_TBS_SCRIBBLE;
00250         doc->context.curStrokeStyle.color = (ScbDevColor)((int)SCB_DEV_COLOR_BLACK - ((int)iconID - (int)iconID_penblackLow));
00251         setToolbarDirty();   
00252     }
00253     else if (iconID_eraseline == iconID)
00254     {
00255         if (SCB_TBS_ERASE != doc->context.curState)
00256         {
00257             doc->context.curState = SCB_TBS_ERASE;
00258         }
00259         else
00260         {
00261             doc->context.curState = SCB_TBS_NONE;
00262         }
00263         setToolbarDirty();
00264     }
00265 
00266     if (isToolbarDirty())
00267     {
00268         setToolbarUpdateType();
00269     }
00270 }

Here is the call graph for this function:

void CChannels::setScribbleNone ( ScbDocPtr  pDoc  ) 

Definition at line 460 of file channels.cpp.

00461 {
00462     if (pDoc)
00463     {
00464         pDoc->context.curState = SCB_TBS_NONE;
00465     }        
00466 }

GBool CChannels::isScribbleEnable (  )  const [inline]

Definition at line 111 of file channels.h.

00111 { return (doc && doc->context.curState == SCB_TBS_SCRIBBLE); }

GBool CChannels::isEraseEnable (  )  const [inline]

Definition at line 112 of file channels.h.

00112 { return (doc && doc->context.curState == SCB_TBS_ERASE); }

GBool CChannels::isScribbleIcon ( const int  id  ) 

Definition at line 175 of file channels.cpp.

00176 {
00177     if ((iconID_pen == id) ||
00178         (iconID_eraseline == id) ||
00179         (iconID_pen1pixel <= id &&  iconID_pen7pixel >= id) ||
00180         (iconID_penblack <= id && iconID_penwhite >= id))
00181     {
00182         return gTrue;
00183     }        
00184     return gFalse;
00185 }


Member Data Documentation

Definition at line 41 of file channels.h.

Definition at line 42 of file channels.h.

Definition at line 43 of file channels.h.

Definition at line 44 of file channels.h.

int CChannels::nPanState [private]

Definition at line 48 of file channels.h.

int CChannels::nZoominState [private]

Definition at line 49 of file channels.h.

int CChannels::nZoomoutState [private]

Definition at line 50 of file channels.h.

int CChannels::nRotateState [private]

Definition at line 51 of file channels.h.

Definition at line 52 of file channels.h.

Definition at line 53 of file channels.h.

Definition at line 54 of file channels.h.

int CChannels::nForwardState [private]

Definition at line 55 of file channels.h.

ScbDocPtr CChannels::doc [private]

Definition at line 56 of file channels.h.

GBool CChannels::tbDirty [private]

Definition at line 57 of file channels.h.

Definition at line 58 of file channels.h.


The documentation for this class was generated from the following files:

Generated on Wed Feb 4 18:26:09 2009 by  doxygen 1.5.6