Esempio n. 1
0
static void
window_remove( CoreWindow *window )
{
     int i;
     CoreWindowStack *stack = window->stack;
     DFBRegion region = { window->x, window->y,
                          window->x + window->width - 1,
                          window->y + window->height - 1 };

     DFB_ASSERT( window->stack != NULL );

     window_withdraw( window );

     for (i=0; i<stack->num_windows; i++)
          if (stack->windows[i] == window)
               break;

     if (i < stack->num_windows) {
          stack->num_windows--;

          for (; i<stack->num_windows; i++)
               stack->windows[i] = stack->windows[i+1];

          if (stack->num_windows) {
               stack->windows =
                    shrealloc( stack->windows,
                               sizeof(CoreWindow*) * stack->num_windows );
          }
          else {
               shfree( stack->windows );
               stack->windows = NULL;
          }
     }

     window->initialized = false;

     /* If window was visible... */
     if (window->opacity) {
          /* Update the affected region */
          repaint_stack( stack, &region, 0 );
          
          /* Possibly change focus to window now under the cursor */
          handle_enter_leave_focus( stack );
          
          /* Always try to have a focused window */
          ensure_focus( stack );
     }

     window->stack = NULL;
}
Esempio n. 2
0
void
FORTRANIFY (shpclmove) (int *addr, int *length, long *errcode, int *abort)
{
  INIT_CHECK ();

  addr = shrealloc (addr, *length);

  /* pass back status code */
  *errcode = malloc_error;

  /* if malloc succeeded, nothing else to do */
  if (malloc_error == SHMEM_MALLOC_OK)
    {
      return;
      /* NOT REACHED */
    }

  /* failed somehow, we might have to abort */
  __shmem_trace (*abort ? SHMEM_LOG_FATAL : SHMEM_LOG_MEMORY,
		 "shpdeallc() failed: %s", sherror ());
  /* MAYBE NOT REACHED */
}
Esempio n. 3
0
static void
window_insert( CoreWindow *window,
               int         before )
{
     int              i;
     DFBWindowEvent   evt;
     CoreWindowStack *stack = window->stack;

     DFB_ASSERT( window->stack != NULL );
     
     if (!window->initialized) {
          if (before < 0  ||  before > stack->num_windows)
               before = stack->num_windows;

          stack->windows = shrealloc( stack->windows,
                                      sizeof(CoreWindow*) * (stack->num_windows+1) );

          for (i=stack->num_windows; i>before; i--)
               stack->windows[i] = stack->windows[i-1];

          stack->windows[before] = window;

          stack->num_windows++;

          window->initialized = true;
     }

     /* Send configuration */
     evt.type = DWET_POSITION_SIZE;
     evt.x    = window->x;
     evt.y    = window->y;
     evt.w    = window->width;
     evt.h    = window->height;
     dfb_window_dispatch( window, &evt );

     if (window->opacity)
          handle_enter_leave_focus( stack );
}