예제 #1
0
int FN_TBG_NONE_Clicked(void)
{
	ActiveGadget=NULL;
	ApplySelectionWindow();
	SetWindowPointer(CurrentWindowNode->nw_Window,TAG_DONE);
	return 1;
}
예제 #2
0
/***********************************************************************************
 * Procedure: set_idle
 * Synopsis:  (void)set_idle();
 * Purpose:   Remove the busy mark on the window
 ***********************************************************************************/
void set_idle(void)
{

   uncover_window();
#ifdef WA_BusyPointer
   if (IntuitionBase->LibNode.lib_Version >= 39)
   {
      struct TagItem taglist[1];
      taglist[0].ti_Tag  = TAG_DONE;
      taglist[0].ti_Data = TRUE;

      /* Put up the busy pointer, with pointer-delay */
      SetWindowPointer( global.window, taglist);
   }
   else
#endif
   {
      /* Do the 1.3 stuff here */
   }
   if (busy_pointer)
   {
      ClearPointer(global.window);
      FreeMem(busy_pointer, sizeof(busy_data));
   }

   busy_pointer = NULL;
}
예제 #3
0
int FN_TBG_TREEVIEW_Clicked(void)
{
	if(ActiveGadget!=TREEVIEW_ID) ActiveGadget=TREEVIEW_ID; else ActiveGadget=NULL;
	ApplySelectionWindow();
	SetWindowPointer(CurrentWindowNode->nw_Window,WA_Pointer,DrawPtr,TAG_DONE);
	return 1;
}
예제 #4
0
int FN_TBG_MODE_FRAME_Clicked(void)
{
	int ret;
	ret=FN_MainObjTypeFrame_Selected();
	ApplySelectionWindow();
	SetWindowPointer(CurrentWindowNode->nw_Window,WA_Pointer,DrawPtr,TAG_DONE);
	return ret;
}
예제 #5
0
int FN_TBG_MODE_GADGET_Clicked(void)
{
	int ret;
	ret=FN_MainObjTypeGadget_Selected();
	ApplySelectionWindow();
	SetWindowPointer(CurrentWindowNode->nw_Window,TAG_DONE);
	return ret;
}
예제 #6
0
///
/// ShowSelectPointer()
void ShowSelectPointer(struct InstData *data, Object *obj)
{
  ENTER();

  // even if it seems to be a waste of performance, but
  // we unfortunately have to always set the window pointer
  // regardless of the point if it was previously set or not.
  // This is required as any other gadget or process might
  // reset the window pointer and as such we would end up
  // with no custom pointer as well. So we only check the window
  // sleep status here :(
  if(data->PointerObj != NULL &&
     xget(_win(obj), MUIA_Window_Sleep) == FALSE)
  {
    // try to identify the black/white colors
    // of the current screen colormap
    if(data->activeSelectPointer == FALSE)
      IdentifyPointerColors(obj);

    // now we set the actual new custom window pointer. Please note
    // that we can't unfortunately check for data->activeSelectPointer
    // here because otherwise we might end up with the standard
    // window pointer when quickly switching pointer TE.mcc
    #if defined(__amigaos4__)
    SetWindowPointer(_window(obj), LIB_VERSION_IS_AT_LEAST(IntuitionBase, 53, 407) ? WA_PointerType : WA_Pointer, data->PointerObj, TAG_DONE);
    #elif defined(__MORPHOS__)
    SetWindowPointer(_window(obj), IS_MORPHOS2 ? WA_PointerType : WA_Pointer, data->PointerObj, TAG_DONE);
    #else
    if(LIB_VERSION_IS_AT_LEAST(IntuitionBase, 39, 0))
      SetWindowPointer(_window(obj), WA_Pointer, data->PointerObj, TAG_DONE);
    else
      SetPointer(_window(obj), (APTR)data->PointerObj, selectPointerHeight,
                                                       selectPointerWidth,
                                                       selectPointerXOffset,
                                                       selectPointerYOffset);
    #endif

    data->activeSelectPointer = TRUE;
  }

  LEAVE();
}
예제 #7
0
///
/// HideSelectPointer()
void HideSelectPointer(struct InstData *data, Object *obj)
{
  ENTER();

  if(data->activeSelectPointer == TRUE &&
     data->PointerObj != NULL)
  {
    #if defined(__amigaos4__) || defined(__MORPHOS__)
    SetWindowPointer(_window(obj), TAG_DONE);
    #else
    if(LIB_VERSION_IS_AT_LEAST(IntuitionBase, 39, 0))
      SetWindowPointer(_window(obj), TAG_DONE);
    else
      ClearPointer(_window(obj));
    #endif

    data->activeSelectPointer = FALSE;
  }

  LEAVE();
}
예제 #8
0
void ami_update_pointer(struct Window *win, gui_pointer_shape shape)
{
	if(drag_save_data) return;

	if(nsoption_bool(use_os_pointers))
	{
		switch(shape)
		{
			case GUI_POINTER_DEFAULT:
				SetWindowPointer(win, TAG_DONE);
			break;

			case GUI_POINTER_WAIT:
				SetWindowPointer(win,
					WA_BusyPointer, TRUE,
					WA_PointerDelay, TRUE,
					TAG_DONE);
			break;

			default:
				if(mouseptrobj[shape])
				{
					SetWindowPointer(win, WA_Pointer, mouseptrobj[shape], TAG_DONE);
				}
				else
				{
					SetWindowPointer(win, TAG_DONE);
				}
			break;
		}
	}
	else
	{
		if(mouseptrobj[shape])
		{
			SetWindowPointer(win, WA_Pointer, mouseptrobj[shape], TAG_DONE);
		}
		else
		{
			if(shape ==	GUI_POINTER_WAIT)
			{
				SetWindowPointer(win,
					WA_BusyPointer, TRUE,
					WA_PointerDelay, TRUE,
					TAG_DONE);
			}
			else
			{
				SetWindowPointer(win, TAG_DONE);
			}
		}
	}
}
예제 #9
0
/***********************************************************************************
 * Procedure: set_busy
 * Synopsis:  (void)set_busy();
 * Purpose:   Mark the window as busy so no input will come into it
 ***********************************************************************************/
void set_busy(void)
{
#ifdef WA_BusyPointer
   if (IntuitionBase->LibNode.lib_Version >= 39)
   {
      struct TagItem taglist[3];

      taglist[0].ti_Tag  = WA_BusyPointer;
      taglist[0].ti_Data = TRUE;

      taglist[1].ti_Tag  = WA_PointerDelay;
      taglist[1].ti_Data = TRUE;

      taglist[2].ti_Tag  = TAG_DONE;
      taglist[2].ti_Data = TRUE;

      /* Put up the busy pointer, with pointer-delay */
      SetWindowPointer( global.window, taglist);
   }
   else
#endif
   {
      if (busy_pointer == NULL)
      {
         busy_pointer = AllocMem(sizeof(busy_data), MEMF_CHIP);
         if (busy_pointer)
         {
            memcpy(busy_pointer, busy_data, sizeof(busy_data));
            SetPointer(global.window, busy_pointer,
                 BUSY_HEIGHT, BUSY_WIDTH, BUSY_XOFFSET, BUSY_YOFFSET);
         }
      }
   }
   /* We need to create a single gadget that covers the entire screen so that */
   /* They can not click on any of the gadgets.                               */
   cover_window();
}
예제 #10
0
  LRESULT CALLBACK WindowsMessagePump(HWND aWindowHandle, UINT aMessage, WPARAM aWParam, LPARAM aLParam)
  {
    Window *window = GetWindowPointer(aWindowHandle);
    WindowData *windowData = window->mPlatformSpecificData.Get<WindowData>();

    switch (aMessage)
    {
      // Window Creation
      case WM_CREATE:
      {
        // This aLParam is our Window pointer
        Window* windowToSet = (Window*)((CREATESTRUCT*)(aLParam))->lpCreateParams;
        WindowData *windowToSetData = windowToSet->mPlatformSpecificData.Get<WindowData>();

        // Set it on the user data section of the window
        SetWindowPointer(aWindowHandle, windowToSet);

        windowToSetData->mWindowHandle = aWindowHandle;
        break;
      }

      case WM_MOUSEWHEEL:
      {
        window->mMouse.mWheelDelta = GET_WHEEL_DELTA_WPARAM(aWParam) / (float)WHEEL_DELTA;
        break;
      }

      case WM_LBUTTONUP:
      {
        // TODO: Change when we have events. Try to figure out how this should actually work.
        window->mEngine->mGraphicsSystem.mMousePosition.x = LOWORD(aLParam);
        window->mEngine->mGraphicsSystem.mMousePosition.y = HIWORD(aLParam);

        window->mMouse.mLeftMouseDown = false;
        break;
      }

      case WM_LBUTTONDOWN:
      {
        // TODO: Change when we have events. Try to figure out how this should actually work.
        window->mEngine->mGraphicsSystem.mMousePosition.x = LOWORD(aLParam);
        window->mEngine->mGraphicsSystem.mMousePosition.y = HIWORD(aLParam);

        window->mMouse.mLeftMouseDown = true;
        break;
      }

      case WM_MOUSEMOVE:
      {
        window->mMouse.mX = LOWORD(aLParam);
        window->mMouse.mY = HIWORD(aLParam);
        break;
      }


      // TODO: Add WM_TOUCH 

      // TODO: Add these:
      //       WM_LBUTTONDBLCLK
      //       WM_RBUTTONDBLCLK
      //       WM_MBUTTONDBLCLK

      // A key has been pressed.
      //case WM_KEYDOWN:
      //case WM_SYSKEYDOWN: 
      //{
      //  window->mKeyboard.UpdateKey(aWParam, true);
      //  break;
      //}
      //
      //  // A key has been released.
      //case WM_KEYUP:
      //case WM_SYSKEYUP:
      //{
      //  window->mKeyboard.UpdateKey(aWParam, false);
      //  break;
      //}

      case WM_PAINT:
      {
        // TODO: Send FrameUpdate here.
        // window->mEngine->mGraphicsSystem.Update(0.016f); 
        break;
      }

      // Should probably make sure DefWindowProc doesn't get called here. Return?
      case WM_CLOSE:
      case WM_DESTROY:
      {
        // Only close if we're the most parented window.
        // TODO: Handle the case of having multiple "topmost" windows.
        if (window->mParentWindow == nullptr)
        {
          window->mEngine->mShouldUpdate = false;
        }
        break;
      }
      default:
      {
        break;
      }
    }

    // Probably want to only do this sometimes not every time we pump.
    return DefWindowProc(aWindowHandle, aMessage, aWParam, aLParam);
  }