Beispiel #1
0
void UserInterface::blitAddressQueueList(	vector<string>* AddressQueueListItems)	//OK Dec 6
{
	ReloadItems(						//A helper macro to implement the body of UserInterface::blitROBList()
				AddressQueueListItems,	//1 In vector:				AddressQueueListItems
				addressQueueItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.addressQueueItems
				addressQueueItemsCount,
				addressQueue		);	//3 Widget to blit to:		_interfaceWidgets.addressQueue

				/*library bug. Remove items  if list shrank*/
				while(_interfaceWidgetItemCount.addressQueueItemsCount > loop)
					{
						_interfaceWidgetItemCount.addressQueueItemsCount--;
						deleteCDKScrollItem(_interfaceWidgets.addressQueue,
											_interfaceWidgetItemCount.addressQueueItemsCount);
					}
					_interfaceWidgetItemCount.addressQueueItemsCount = loop;
					/*re-set list items to new list*/
				_interfaceWidgetItems.addressQueueItems = charROBListItems;
				if(_interfaceWidgetItems.addressQueueItems == NULL)
					return;
				setCDKScrollItems (	_interfaceWidgets.addressQueue,
									(char**)_interfaceWidgetItems.addressQueueItems,
									loop,
									true								);



//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.addressQueue,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Beispiel #2
0
void UserInterface::blitROBList(vector<string>* ROBListItems)
{
	int 						loop = 0;
	const char* 				charROBListItems[ROBListItems->size()];
	vector<string>::iterator 	listit;

	for(listit =ROBListItems->begin(); listit != ROBListItems->end(); listit++)	//Iterate over each string
	{
		charROBListItems[loop] = convert(*listit);
		loop++;
	}

	_interfaceWidgetItems.ROBListItems = charROBListItems;		//Set the items list.
	if(_interfaceWidgetItems.ROBListItems == NULL)
		return;

	setCDKScrollItems (	_interfaceWidgets.ROBList,				//Nuke the old content and refresh
						(char**)_interfaceWidgetItems.ROBListItems,
						ROBListItems->size(),
						true								);

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.ROBList,		//Draw this window
					true						);	//Draw with a box around it
#endif
//DOUBT I DOUBT THAT THE LIST ITEMS WILL STAY IN SCOPE OUTSIDE OF THIS FUNCTION

}
Beispiel #3
0
void UserInterface::blitTraceLogWindow(	vector<string>* TraceLogListItems)
{
	ReloadItems(							//A helper macro to implement the body of UserInterface::blitROBList()
				TraceLogListItems,			//1 In vector:				TraceLogListItems
				traceLogWindowItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.traceLogWindowItems
				traceLogWindowItemsCount,
				tracelogwindow		);		//3 Widget to blit to:		_interfaceWidgets.tracelogwindow

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.tracelogwindow,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Beispiel #4
0
void UserInterface::blitLSPipe(			vector<string>* LSPipeListItems)	//OK
{
	ReloadItems(					//A helper macro to implement the body of UserInterface::blitROBList()
				LSPipeListItems,	//1 In vector:				LSPipeListItems
				LSPipeItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.LSPipeItems
				LSPipeItemsCount,
				LSPipe		);		//3 Widget to blit to:		_interfaceWidgets.LSPipe

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.LSPipe,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Beispiel #5
0
void UserInterface::blitFPQueueList(		vector<string>* FPQueueListItems)	//working OK Dec 6 2k14
{
	ReloadItems(					//A helper macro to implement the body of UserInterface::blitROBList()
				FPQueueListItems,	//1 In vector:				FPQueueListItems
				fpQueueItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.fpQueueItems
				fpQueueItemsCount,
				fpQueue		);		//3 Widget to blit to:		_interfaceWidgets.fpQueue

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.fpQueue,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Beispiel #6
0
void UserInterface::blitRegMapTable(vector<string>* RegMapListItems)	//working OK Dec 6 2k14.
{
	ReloadItems(						//A helper macro to implement the body of UserInterface::blitROBList()
				RegMapListItems,		//1 In vector:				RegMapListItems
				regmaptableItems,		//2	WidgetList to refresh:	_interfaceWidgetItems.regmaptableItems
				regmaptableItemsCount,
				regmaptable		);		//3 Widget to blit to:		_interfaceWidgets.regmaptable

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.regmaptable,	//Draw this window
					true						);	//Draw with a box around it
#endif
}
Beispiel #7
0
void UserInterface::UserInterface::blitFreeList(vector<string>* FreeListItems)
{
	ReloadItems(						//A helper macro to implement the body of UserInterface::blitROBList()
				FreeListItems,			//1 In vector:				FreeListItems
				freelistItems,			//2	WidgetList to refresh:	_interfaceWidgetItems.freelistItems
				freelistItemsCount,		//Needed for UI fix up (remove items over the new list length)
				freelist		);		//3 Widget to blit to:		_interfaceWidgets.freelist

//TODO blit all on clock
#ifdef DEBUG
	drawCDKScroll (_interfaceWidgets.freelist,		//Draw this window
					true						);	//Draw with a box around it
#endif
}
Beispiel #8
0
/*
 * This injects a single character into the file selector.
 */
char *injectCDKFselect (CDKFSELECT *fselect, chtype input)
{
   /* Declare local variables. */
   char		*filename;
   boolean	file;

   /* Let the user play. */
   filename = injectCDKEntry (fselect->entryField, input);

   /* Copy the entry field exitType to the fileselector. */
   fselect->exitType = fselect->entryField->exitType;

   /* If we exited early, make sure we don't interpret it as a file. */
   if (fselect->exitType == vEARLY_EXIT)
   {
      return 0;
   }

   /* Can we change into the directory? */
   file = chdir (filename);
   chdir (fselect->pwd);

   /* If it's not a directory, return the filename. */
   if (file != 0)
   {
      /* It's a regular file, create the full path. */
      fselect->pathname = copyChar (filename);

      /* Return the complete pathname. */
      return (fselect->pathname);
   }
   else
   {
      /* Set the file selector information. */
      setCDKFselect (fselect, filename,
			fselect->fieldAttribute, fselect->fillerCharacter,
			fselect->highlight,
			fselect->dirAttribute, fselect->fileAttribute,
			fselect->linkAttribute, fselect->sockAttribute,
			ObjOf(fselect)->box);

      /* Redraw the scrolling list. */
      drawCDKScroll (fselect->scrollField, ObjOf(fselect->scrollField)->box);
   }

   /* Set the exit type and return a null pointer. */
   fselect->exitType = vEARLY_EXIT;
   return 0;
}
Beispiel #9
0
/*
 * This draws the file selector widget.
 */
static void _drawCDKFselect (CDKOBJS *object, boolean Box GCC_UNUSED)
{
   CDKFSELECT *fselect = (CDKFSELECT *)object;

   /* Draw in the shadow if we need to. */
   if (fselect->shadowWin != 0)
   {
      drawShadow (fselect->shadowWin);
   }

   /* Draw in the entry field. */
   drawCDKEntry (fselect->entryField, ObjOf(fselect->entryField)->box);

   /* Draw in the scroll field. */
   drawCDKScroll (fselect->scrollField, ObjOf(fselect->scrollField)->box);
}
Beispiel #10
0
/*
 * This draws the file selector widget.
 */
static void _drawCDKAlphalist (CDKOBJS *obj, boolean Box GCC_UNUSED)
{
    CDKALPHALIST * alphalist = (CDKALPHALIST *)obj;

   /* Does this widget have a shadow? */
   if (alphalist->shadowWin != 0)
   {
      drawShadow (alphalist->shadowWin);
   }

   /* Draw in the entry field. */
   drawCDKEntry (alphalist->entryField, ObjOf(alphalist->entryField)->box);

   /* Draw in the scroll field. */
   drawCDKScroll (alphalist->scrollField, ObjOf(alphalist->scrollField)->box);
}
Beispiel #11
0
/*
 * This moves the scroll field to the given location.
 */
static void _moveCDKScroll (CDKOBJS *object,
			    int xplace,
			    int yplace,
			    boolean relative,
			    boolean refresh_flag)
{
   /* *INDENT-EQLS* */
   CDKSCROLL *scrollp = (CDKSCROLL *)object;
   int currentX       = getbegx (scrollp->win);
   int currentY       = getbegy (scrollp->win);
   int xpos           = xplace;
   int ypos           = yplace;
   int xdiff          = 0;
   int ydiff          = 0;

   /*
    * If this is a relative move, then we will adjust where we want
    * to move to.
    */
   if (relative)
   {
      xpos = getbegx (scrollp->win) + xplace;
      ypos = getbegy (scrollp->win) + yplace;
   }

   /* Adjust the window if we need to. */
   alignxy (WindowOf (scrollp), &xpos, &ypos, scrollp->boxWidth, scrollp->boxHeight);

   /* Get the difference. */
   xdiff = currentX - xpos;
   ydiff = currentY - ypos;

   /* Move the window to the new location. */
   moveCursesWindow (scrollp->win, -xdiff, -ydiff);
   moveCursesWindow (scrollp->listWin, -xdiff, -ydiff);
   moveCursesWindow (scrollp->shadowWin, -xdiff, -ydiff);
   moveCursesWindow (scrollp->scrollbarWin, -xdiff, -ydiff);

   /* Touch the windows so they 'move'. */
   refreshCDKWindow (WindowOf (scrollp));

   /* Redraw the window, if they asked for it. */
   if (refresh_flag)
   {
      drawCDKScroll (scrollp, ObjOf (scrollp)->box);
   }
}
Beispiel #12
0
/*
 * This actually does all the 'real' work of managing the scrolling list.
 */
int activateCDKScroll (CDKSCROLL *scrollp, chtype *actions)
{
   /* Draw the scrolling list */
   drawCDKScroll (scrollp, ObjOf (scrollp)->box);

   if (actions == 0)
   {
      chtype input;
      boolean functionKey;
      int ret;

      for (;;)
      {
	 fixCursorPosition (scrollp);
	 input = (chtype)getchCDKObject (ObjOf (scrollp), &functionKey);

	 /* Inject the character into the widget. */
	 ret = injectCDKScroll (scrollp, input);
	 if (scrollp->exitType != vEARLY_EXIT)
	 {
	    return ret;
	 }
      }
   }
   else
   {
      int length = chlen (actions);
      int i = 0;
      int ret;

      /* Inject each character one at a time. */
      for (i = 0; i < length; i++)
      {
	 ret = injectCDKScroll (scrollp, actions[i]);
	 if (scrollp->exitType != vEARLY_EXIT)
	    return ret;
      }
   }

   /* Set the exit type for the widget and return. */
   setExitType (scrollp, 0);
   return -1;
}
Beispiel #13
0
static void drawMyScroller (CDKALPHALIST *widget)
{
   SaveFocus (widget);
   drawCDKScroll (widget->scrollField, ObjOf (widget->scrollField)->box);
   RestoreFocus (widget);
}
Beispiel #14
0
void UserInterface::drawALL()
{
	 //===========================================================================================
	 //									DRAW ALL WIDGETS
	 //===========================================================================================
	   /* Draw the scrolling window. */
	//DRAW FETCH
		drawCDKScroll (_interfaceWidgets.instructionlist, true);
		drawCDKScroll (_interfaceWidgets.tracewindow, true);
	//DRAW DECODE
	   	drawCDKScroll (_interfaceWidgets.regmaptable, true);//(swindow, swindow->box); where box is bool true for box show.
		drawCDKScroll (_interfaceWidgets.freelist, 1);
		/*drawCDKScroll (_interfaceWidgets.activelist, 1);	RETIRED WIDGET*/
	//DRAW QUEUES
		drawCDKScroll (_interfaceWidgets.fpQueue, true);
		drawCDKScroll (_interfaceWidgets.addressQueue, true);
		drawCDKScroll (_interfaceWidgets.integerQueue, true);
	//DRAW PIPES
		drawCDKScroll (_interfaceWidgets.fpMPipe,1);
		drawCDKScroll (_interfaceWidgets.fpAPipe,1);
		drawCDKScroll (_interfaceWidgets.ALUAPipe,1);
		drawCDKScroll (_interfaceWidgets.ALUBPipe,1);
		drawCDKScroll (_interfaceWidgets.LSPipe,1);
	//DRAW COMMIT / ROB
		drawCDKScroll (_interfaceWidgets.ROBList, 1);
	//DRAW TRACELOG
		drawCDKScroll (_interfaceWidgets.tracelogwindow, true);
}
Beispiel #15
0
void CDKScroll::draw(void)
{
    drawCDKScroll (scroll, TRUE);
}