Esempio n. 1
0
static gint expose (GtkWidget *widget, GdkEventExpose *event, gpointer data)
{
  if (event->count > 0)
    return TRUE;

  if (!CanProcess ())
    return TRUE;

  if (g_bTexViewReady)
  {
    g_2DView.m_rect.bottom = widget->allocation.height;
    g_2DView.m_rect.right = widget->allocation.width;

    if (!g_QglTable.m_pfn_glwidget_make_current (g_pToolWidget))
    {
      Sys_Printf("TexTool: glMakeCurrent failed\n");
      return TRUE;
    }

    DoExpose ();

    g_QglTable.m_pfn_glwidget_swap_buffers (g_pToolWidget);
  }

  return TRUE;
}
Esempio n. 2
0
bool CWindowListener::Paint()
{
  if (!CanProcess ())
    return false;

  if (g_bTexViewReady)
    DoExpose();

  return true;
}
Esempio n. 3
0
void DoExp(){

   XClearWindow(dpy, win);
   XClearWindow(dpy, iconWin);

   XCopyArea(dpy, XPM ,win, gc, 1 + (26) * 6, 10, 6, 8, 5, 51);
   XCopyArea(dpy, XPM, iconWin, gc, 1 + (26) * 6, 10, 6, 8, 5, 51);
   XCopyArea(dpy, XPM, win, gc, 1 + (27) * 6, 10, 6, 8, 53, 51);
   XCopyArea(dpy, XPM, iconWin, gc, 1 + (27) * 6, 10, 6, 8, 53, 51);

   XCopyArea(dpy, XPM, win, gc, 106, 0, 28, 8, 17, 50);
   XCopyArea(dpy, XPM, iconWin, gc, 106, 0, 28, 8, 17, 50);

   DoExpose();
}
Esempio n. 4
0
void DoEvents() {

   unsigned long long compteur = 0;

   XEvent ev ;

   for (;;){
      if (!compteur){
	 if (CheckProcChange()) DoExpose();
	 compteur = UPDATE_NB * DELAY;
      }
      while(XPending(dpy)){
	 XNextEvent(dpy,&ev);
	 switch(ev.type) {
	  case Expose : DoExp(); break;
	  case ButtonPress : DoClick(ev); break;
	 }
      }
      usleep(DELAY);
      compteur -= DELAY;
   }
}
Esempio n. 5
0
void DoClick(XEvent ev)
{
   unsigned char doubleClick = 0;
   static unsigned char firstClick = 0;
   _desc *curseur;
   char zone, i;

   zone = CheckZone();

   if (ev.xbutton.button == CLICK_TWO) {
      DoExpose() ;
   }

   /* Mouse wheel patch by Mathieu Cuny */

   if (ev.xbutton.button == WHEEL_UP && gNbProc > NB_LINE) {
      for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--);
      if (curseur) posProc = posProc -> next;
      DoExpose();
   }

   if (ev.xbutton.button == WHEEL_DOWN && posProc -> previous && gNbProc > NB_LINE) {
      	   posProc = posProc -> previous;
	   DoExpose();
   }

   /* Mouse wheel patch end */

   if (ev.xbutton.button == CLICK_ONE) {

      struct timeval temp;
      long long nms1;

      gettimeofday(&temp, NULL);
      nms1 = temp.tv_sec - timev.tv_sec; /* nb sec since last click */

      if  ((!nms1 || nms1 == 1)){
	 long long yop = (nms1 * 1000000L) + (temp.tv_usec - timev.tv_usec); /* nb mlsec since last click */
	 if (firstClick && (yop < DOUBLE_CLICK_DELAY)){  /* we got double click */
	    doubleClick = 1;
	    firstClick = 0;
	 } else firstClick = 1;
      } else firstClick = 1;

       timev = temp;

      if (zone == UP && !doubleClick && gNbProc > NB_LINE)
	{
	   for (i = NB_LINE, curseur = posProc; i; curseur = curseur -> next, i--);
	   if (curseur) posProc = posProc -> next;
	   DoExpose();
	}

      else if (zone == DOWN && posProc -> previous && !doubleClick && gNbProc > NB_LINE)
	{
	   posProc = posProc -> previous;
	   DoExpose();
	}

      else if (zone == UP && doubleClick && gNbProc > NB_LINE)
	{

	   for (curseur = pList; curseur -> next; curseur = curseur -> next);    /* curseur = end of list */

	   for (i = NB_LINE - 1; i; curseur = curseur -> previous, i--);
	   posProc = curseur;
	   DoExpose();
	}

      else if (zone == DOWN && doubleClick && gNbProc > NB_LINE)
	{
	   posProc = pList;
	   DoExpose();
	}

      else if (zone > 0 && zone <= NB_LINE && doubleClick && tabNoProc[zone - 1] != -1)
	{
	   kill(tabNoProc[zone - 1], SIGKILL); /* let's kill the mofo */
	   waitpid(tabNoProc[zone - 1], NULL, 0);
	}

      if (doubleClick) doubleClick = 0;

   }
}