示例#1
0
void VideoRendererItem::finalizeGL() {
	TextureRendererItem::finalizeGL();
	Q_ASSERT(QOpenGLContext::currentContext() != nullptr);
	d->black.destroy();
	_Delete(d->fbo);
	_Delete(d->shader);
	d->initialized = false;
}
示例#2
0
void
CachedExtentTree::_Delete(CachedExtent* node)
{
	if (node == NULL)
		return;
	_Delete(_GetValue(node->left));
	_Delete(_GetValue(node->right));
	node->Delete();
}
示例#3
0
/*********************************************************************
*
*       CHECKBOX_Callback
*/
void CHECKBOX_Callback (WM_MESSAGE *pMsg) {
  CHECKBOX_Handle hObj;
  CHECKBOX_Obj* pObj;
  hObj = pMsg->hWin;
  pObj = (CHECKBOX_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */
  /* Let widget handle the standard messages */
  if (WIDGET_HandleActive(hObj, pMsg) == 0) {
    return;
  }
  switch (pMsg->MsgId) {
  case WM_KEY:
    _OnKey(hObj, pObj, pMsg);
    break;
  case WM_PAINT:
    GUI_DEBUG_LOG("CHECKBOX: _Callback(WM_PAINT)\n");
    _Paint(pObj, hObj);
    return;
  case WM_TOUCH:
    _OnTouch(hObj, pObj, pMsg);
    break;
  case WM_DELETE:
    GUI_DEBUG_LOG("CHECKBOX: _Callback(WM_DELETE)\n");
    _Delete(pObj);
    break;       /* No return here ... WM_DefaultProc needs to be called */
  }
  WM_DefaultProc(pMsg);
}
示例#4
0
文件: app.cpp 项目: akhilo/cmplayer
void App::setMprisActivated(bool activated) {
#ifdef Q_OS_LINUX
	if (activated && !d->mpris)
		d->mpris = new mpris::RootObject(this);
	else if (!activated && d->mpris)
		_Delete(d->mpris);
#else
	Q_UNUSED(activated);
#endif
}
示例#5
0
/*********************************************************************
*
*       _Callback
*/
static void _Callback (WM_MESSAGE*pMsg) {
  PROGBAR_Handle hObj = (PROGBAR_Handle)pMsg->hWin;
  switch (pMsg->MsgId) {
  case WM_PAINT:
    _Paint(hObj);
    return;
  case WM_DELETE:
    _Delete(hObj);
    break;
  }
  WM_DefaultProc(pMsg);
}
示例#6
0
/*********************************************************************
*
*       BUTTON_Callback
*/
void BUTTON_Callback(WM_MESSAGE *pMsg) {
  BUTTON_Handle hObj = pMsg->hWin;
  BUTTON_Obj* pObj = BUTTON_H2P(hObj);
  /* Let widget handle the standard messages */
  if (WIDGET_HandleActive(hObj, pMsg) == 0) {
    return;
  }
  switch (pMsg->MsgId) {
#if BUTTON_REACT_ON_LEVEL
  case WM_PID_STATE_CHANGED:
    _OnPidStateChange(hObj, pObj, pMsg);
    return;      /* Message handled. Do not call WM_DefaultProc, because the window may have been destroyed */
#endif
  case WM_TOUCH:
    _OnTouch(hObj, pObj, pMsg);
    return;      /* Message handled. Do not call WM_DefaultProc, because the window may have been destroyed */
  case WM_PAINT:
    GUI_DEBUG_LOG("BUTTON: _BUTTON_Callback(WM_PAINT)\n");
    _Paint(pObj, hObj);
    return;
  case WM_DELETE:
    GUI_DEBUG_LOG("BUTTON: _BUTTON_Callback(WM_DELETE)\n");
    _Delete(pObj);
    break;       /* No return here ... WM_DefaultProc needs to be called */
  #if 0     /* TBD: Button should react to space & Enter */
  case WM_KEY:
    {
      int PressedCnt = ((WM_KEY_INFO*)(pMsg->Data.p))->PressedCnt;
      int Key = ((WM_KEY_INFO*)(pMsg->Data.p))->Key;
      if (PressedCnt > 0) {   /* Key pressed? */
        switch (Key) {
        case ' ':
          _ButtonPressed(hObj, pObj);
          return;
        }
      } else {
        switch (Key) {
        case ' ':
          _ButtonReleased(hObj, pObj, WM_NOTIFICATION_RELEASED);
          return;
        }
      }
    }
    break;
  #endif
  }
  WM_DefaultProc(pMsg);
}
示例#7
0
/*********************************************************************
*
*       _Callback
*/
static void _PROGBAR_Callback(WM_MESSAGE*pMsg) {
  PROGBAR_Handle hObj = (PROGBAR_Handle)pMsg->hWin;
  /* Let widget handle the standard messages */
  if (WIDGET_HandleActive(hObj, pMsg) == 0) {
    return;
  }
  switch (pMsg->MsgId) {
  case WM_PAINT:
    _Paint(hObj);
    return;
  case WM_DELETE:
    _Delete(hObj);
    break;
  }
  WM_DefaultProc(pMsg);
}
示例#8
0
文件: BUTTON.c 项目: Jaly314/CH-K-Lib
/*********************************************************************
*
*       BUTTON_Callback
*/
void BUTTON_Callback(WM_MESSAGE *pMsg) {
  int PressedCnt, Key;
  BUTTON_Handle hObj = pMsg->hWin;
  BUTTON_Obj * pObj = (BUTTON_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */
  /* Let widget handle the standard messages */
  if (WIDGET_HandleActive(hObj, pMsg) == 0) {
    return;
  }
  switch (pMsg->MsgId) {
#if BUTTON_REACT_ON_LEVEL
  case WM_PID_STATE_CHANGED:
    _OnPidStateChange(hObj, pObj, pMsg);
    return;      /* Message handled. Do not call WM_DefaultProc, because the window may have been destroyed */
#endif
  case WM_TOUCH:
    _OnTouch(hObj, pObj, pMsg);
    return;      /* Message handled. Do not call WM_DefaultProc, because the window may have been destroyed */
  case WM_PAINT:
    GUI_DEBUG_LOG("BUTTON: _BUTTON_Callback(WM_PAINT)\n");
    _Paint(pObj, hObj);
    return;
  case WM_DELETE:
    GUI_DEBUG_LOG("BUTTON: _BUTTON_Callback(WM_DELETE)\n");
    _Delete(pObj);
    break;       /* No return here ... WM_DefaultProc needs to be called */
  case WM_KEY:
    PressedCnt = ((WM_KEY_INFO*)(pMsg->Data.p))->PressedCnt;
    Key        = ((WM_KEY_INFO*)(pMsg->Data.p))->Key;
    switch (Key) {
    case GUI_KEY_ENTER:
      if (PressedCnt > 0) {
        _OnButtonPressed(hObj, pObj);
        _OnButtonReleased(hObj, pObj, WM_NOTIFICATION_RELEASED);
        return;
      }
      break;
    case GUI_KEY_SPACE:
      if (PressedCnt > 0) {
        _OnButtonPressed(hObj, pObj);
      } else {
        _OnButtonReleased(hObj, pObj, WM_NOTIFICATION_RELEASED);
      }
      return;
    }
  }
  WM_DefaultProc(pMsg);
}
示例#9
0
// MessageReceived
bool
PathManipulator::MessageReceived(BMessage* message, Command** _command)
{
	bool result = true;
	switch (message->what) {
		case MSG_TRANSFORM:
			if (!fSelection->IsEmpty())
				_SetMode(TRANSFORM_POINTS);
			break;
		case MSG_REMOVE_POINTS:
			*_command = _Delete();
			break;
		case MSG_SPLIT_POINTS:
			*_command = new SplitPointsCommand(fPath,
											   fSelection->Items(),
											   fSelection->CountItems());
			break;
		case MSG_FLIP_POINTS:
			*_command = new FlipPointsCommand(fPath,
											  fSelection->Items(),
											  fSelection->CountItems());
			break;
		case B_SELECT_ALL: {
			*fOldSelection = *fSelection;
			fSelection->MakeEmpty();
			int32 count = fPath->CountPoints();
			for (int32 i = 0; i < count; i++)
				fSelection->Add(i);
			if (*fOldSelection != *fSelection) {
//				*_command = new SelectPointsCommand(this, fPath,
//												   fOldSelection->Items(),
//												   fOldSelection->CountItems(),
//												   fSelection->Items(),
//												   fSelection->CountItems()));
				count = fSelection->CountItems();
				int32 indices[count];
				memcpy(indices, fSelection->Items(), count * sizeof(int32));
				_Select(indices, count);
			}
			break;
		}
		default:
			result = false;
			break;
	}
	return result;
}
示例#10
0
/*********************************************************************
*
*       _TEXT_Callback
*/
static void _TEXT_Callback (WM_MESSAGE*pMsg) {
  TEXT_Handle hObj = pMsg->hWin;
  TEXT_Obj* pObj = TEXT_H2P(hObj);
  /* Let widget handle the standard messages */
  if (WIDGET_HandleActive(hObj, pMsg) == 0) {
    return;
  }
  switch (pMsg->MsgId) {
  case WM_PAINT:
    GUI_DEBUG_LOG("TEXT: _Callback(WM_PAINT)\n");
    _Paint(hObj, pObj);
    return;
  case WM_DELETE:
    GUI_DEBUG_LOG("TEXT: _Callback(WM_DELETE)\n");
    _Delete(pObj);
    break;       /* No return here ... WM_DefaultProc needs to be called */
  }
  WM_DefaultProc(pMsg);
}
示例#11
0
/*********************************************************************
*
*       EDIT_Callback
*/
void EDIT_Callback (WM_MESSAGE * pMsg) {
  int IsEnabled;
  EDIT_Handle hObj;
  EDIT_Obj*   pObj;
  hObj = (EDIT_Handle) pMsg->hWin;       
  pObj = (EDIT_Obj *)GUI_ALLOC_h2p(hObj); /* Don't use use WIDGET_H2P because WIDGET_INIT_ID() has not be called at this point */
  IsEnabled = WM__IsEnabled(hObj);
  /* Let widget handle the standard messages */
  if (WIDGET_HandleActive(hObj, pMsg) == 0) {
    return;
  }
  switch (pMsg->MsgId) {
  case WM_TOUCH:
    _OnTouch(hObj, pObj, pMsg);
    break;
  case WM_PAINT:
    GUI_DEBUG_LOG("EDIT: _Callback(WM_PAINT)\n");
    _Paint(pObj, hObj);
    return;
  case WM_DELETE:
    GUI_DEBUG_LOG("EDIT: _Callback(WM_DELETE)\n");
    _Delete(pObj);
    break;       /* No return here ... WM_DefaultProc needs to be called */
  case WM_KEY:
    if (IsEnabled) {
      if ( ((const WM_KEY_INFO*)(pMsg->Data.p))->PressedCnt >0) {
        int Key = ((const WM_KEY_INFO*)(pMsg->Data.p))->Key;
        switch (Key) {
          case GUI_KEY_ENTER:
          case GUI_KEY_ESCAPE:
          case GUI_KEY_TAB:
          case GUI_KEY_BACKTAB:
            break;                    /* Send to parent by not doing anything */
          default:
            EDIT_AddKey(hObj, Key);
            return;
        }
      }
    }
    break;
  }
  WM_DefaultProc(pMsg);
}
示例#12
0
/*********************************************************************
*
*       Callback
*/
static void EDIT__Callback (WM_MESSAGE * pMsg) {
    int IsEnabled;
    EDIT_Handle hObj = (EDIT_Handle)pMsg->hWin;
    EDIT_Obj* pObj = (EDIT_Obj*)WM_HMEM2Ptr(hObj);
    IsEnabled = WIDGET__IsEnabled(&pObj->Widget);
    /* Let widget handle the standard messages */
    if (WIDGET_HandleActive(hObj, pMsg) == 0) {
        return;
    }
    switch (pMsg->MsgId) {
    case WM_TOUCH:
        if (IsEnabled) {
            _OnTouch(hObj, pObj, pMsg);
        }
        break;
    case WM_PAINT:
        GUI_DEBUG_LOG("EDIT: _Callback(WM_PAINT)\n");
        _Paint(pObj);
        return;
    case WM_DELETE:
        GUI_DEBUG_LOG("EDIT: _Callback(WM_DELETE)\n");
        _Delete(pObj);
        break;       /* No return here ... WM_DefaultProc needs to be called */
    case WM_KEY:
        if (IsEnabled) {
            if ( ((WM_KEY_INFO*)(pMsg->Data.p))->PressedCnt >0) {
                int Key = ((WM_KEY_INFO*)(pMsg->Data.p))->Key;
                switch (Key) {
                case GUI_KEY_TAB:
                    break;                    /* Send to parent by not doing anything */
                default:
                    EDIT_AddKey(hObj, Key);
                    return;
                }
            }
        }
        break;
    }
    WM_DefaultProc(pMsg);
}
示例#13
0
void
CachedExtentTree::Delete()
{
	_Delete(RootNode());
	Clear();
}
示例#14
0
	void unmap() { _Delete(m_mapper); }
示例#15
0
void MpOsdItem::finalizeGL() {
	FramebufferObjectRendererItem::finalizeGL();
	d->atlas.destroy();
	_Delete(d->shader);
}
示例#16
0
void
MainWindow::MessageReceived(BMessage* message)
{
	switch (message->what) {
		case MSG_MOUNT_ALL:
			_MountAll();
			break;
		case MSG_MOUNT:
			_Mount(fCurrentDisk, fCurrentPartitionID);
			break;
		case MSG_UNMOUNT:
			_Unmount(fCurrentDisk, fCurrentPartitionID);
			break;

		case MSG_FORMAT:
			printf("MSG_FORMAT\n");
			break;

		case MSG_CREATE: {
			_Create(fCurrentDisk, fCurrentPartitionID);
			break;
		}

		case MSG_INITIALIZE: {
			BString diskSystemName;
			if (message->FindString("disk system", &diskSystemName) != B_OK)
				break;
			_Initialize(fCurrentDisk, fCurrentPartitionID, diskSystemName);
			break;
		}

		case MSG_DELETE:
			_Delete(fCurrentDisk, fCurrentPartitionID);
			break;

		case MSG_EJECT:
			// TODO: completely untested, especially interesting
			// if partition list behaves when partitions disappear
			if (fCurrentDisk) {
				// TODO: only if no partitions are mounted anymore?
				fCurrentDisk->Eject(true);
				_ScanDrives();
			}
			break;
		case MSG_SURFACE_TEST:
			printf("MSG_SURFACE_TEST\n");
			break;

		// TODO: this could probably be done better!
		case B_DEVICE_UPDATE:
			printf("B_DEVICE_UPDATE\n");
		case MSG_RESCAN:
			_ScanDrives();
			break;

		case MSG_PARTITION_ROW_SELECTED:
			// selection of partitions via list view
			_AdaptToSelectedPartition();
			break;
		case MSG_SELECTED_PARTITION_ID: {
			// selection of partitions via disk view
			partition_id id;
			if (message->FindInt32("partition_id", &id) == B_OK) {
				if (BRow* row = fListView->FindRow(id)) {
					fListView->DeselectAll();
					fListView->AddToSelection(row);
					_AdaptToSelectedPartition();
				}
			}
			break;
		}

		default:
			BWindow::MessageReceived(message);
			break;
	}
}
示例#17
0
// HandleKeyDown
bool
PathManipulator::HandleKeyDown(uint32 key, uint32 modifiers, Command** _command)
{
	bool result = true;

	float nudgeDist = 1.0;
	if (modifiers & B_SHIFT_KEY)
		nudgeDist /= fCanvasView->ZoomLevel();

	switch (key) {
		// commit
		case B_RETURN:
			if (fTransformBox) {
				_SetTransformBox(NULL);
			}// else
//				_Perform();
			break;
		// cancel
		case B_ESCAPE:
			if (fTransformBox) {
				fTransformBox->Cancel();
				_SetTransformBox(NULL);
			} else if (fFallBackMode == NEW_PATH) {
				fFallBackMode = SELECT_POINTS;
				_SetTransformBox(NULL);
			}// else
//				_Cancel();
			break;
		case 't':
		case 'T':
			if (!fSelection->IsEmpty())
				_SetMode(TRANSFORM_POINTS);
			else
				result = false;
			break;
		// nudging
		case B_UP_ARROW:
			_Nudge(BPoint(0.0, -nudgeDist));
			break;
		case B_DOWN_ARROW:
			_Nudge(BPoint(0.0, nudgeDist));
			break;
		case B_LEFT_ARROW:
			_Nudge(BPoint(-nudgeDist, 0.0));
			break;
		case B_RIGHT_ARROW:
			_Nudge(BPoint(nudgeDist, 0.0));
			break;

		case B_DELETE:
			if (!fSelection->IsEmpty())
				*_command = _Delete();
			else
				result = false;
			break;

		default:
			result = false;
	}
	return result;
}