Ejemplo n.º 1
0
ColumnListView::ColumnListView(BRect Frame, BScrollView **ContainerView, const char *Name,
	uint32 ResizingMode, uint32 flags, list_view_type Type, bool hierarchical, bool horizontal,
	bool vertical, border_style border, const BFont *LabelFont)
: BListView(Frame,Name,Type,B_FOLLOW_ALL_SIDES,flags|B_PULSE_NEEDED),
fColumnList(6),
fColumnDisplayList(6),
fSortKeyList(6),
fFullItemList(32),
fRightArrow(BRect(0.0,0.0,10.0,10.0),B_COLOR_8_BIT,CLVRightArrowData,false,false),
fDownArrow(BRect(0.0,0.0,10.0,10.0),B_COLOR_8_BIT,CLVDownArrowData,false,false),
_selectedColumn(-1), _editMessage(NULL)
{
	fHierarchical = hierarchical;

	//Create the column titles bar view
	font_height FontAttributes;
	LabelFont->GetHeight(&FontAttributes);
	float fLabelFontHeight = ceil(FontAttributes.ascent) + ceil(FontAttributes.descent);
	float ColumnLabelViewBottom = Frame.top+1.0+fLabelFontHeight+3.0;
	fColumnLabelView = new CLVColumnLabelView(BRect(Frame.left,Frame.top,Frame.right,
		ColumnLabelViewBottom),this,LabelFont);

	//Create the container view
	CreateContainer(horizontal,vertical,border,ResizingMode,flags);
	*ContainerView = fScrollView;

	//Complete the setup
	UpdateColumnSizesDataRectSizeScrollBars();
	fColumnLabelView->UpdateDragGroups();
	fExpanderColumn = -1;
	fCompare = NULL;
}
Ejemplo n.º 2
0
void
CreateTestApp(NodeObj Main){

	/* Create a test app to copy a file */

	NodeObj TestApp = CreateContainer(Main, "TestApp");

	// Create a file writer object
	NodeObj WriteFile = CreateObject(TestApp, "File");
	SetPropStr (WriteFile, "Name", "Writer");
	SetPropStr (WriteFile, "Path", "out.txt");
	SetPropStr (WriteFile, "Mode", "w");
	SetPropInt (WriteFile, "State", 1);

	// Create a file reader object
	NodeObj ReadFile = CreateObject(TestApp, "File");
	SetPropStr (ReadFile, "Name", "Reader"); 
	SetPropStr (ReadFile, "Path", "in.txt");
	SetPropStr (ReadFile, "Mode", "r");
	SetPropInt (ReadFile, "State", 1);

	// Copy the input to the output
	Connect(ReadFile, "Out", WriteFile, "In");
	
}
Ejemplo n.º 3
0
Container::Container(MotifUI *parent,
		     char *name, 
		     ContainerType container_type,
		     SelectionType select_type)
	: MotifUI(parent, name, NULL)
{
   CreateContainer(parent, name, NULL, container_type, select_type);
}
Ejemplo n.º 4
0
Container::Container(char *category, 
		     MotifUI *parent,
		     char *name, 
		     ContainerType container_type,
		     SelectionType select_type)
	: MotifUI(parent, name, category)
{
   CreateContainer(parent, name, category, container_type, select_type);
}
Ejemplo n.º 5
0
AbstractPiece::AbstractPiece(int col, int row, int dep) {
	this->col = col;
	this->row = row;
	this->dep = dep;
	location.col = 0;
	location.row = 0;
	location.dep = 0;
	CreateContainer();
}
void CXTPDockingPaneTabbedContainer::CreateContainer()
{
	SAFE_CALLPTR(m_pParentContainer, CreateContainer());

	if (!m_hWnd)
	{
		Create(_T("XTPDockingPaneTabbedContainer"), _T(""), WS_CLIPCHILDREN | WS_CLIPSIBLINGS | WS_CHILD | WS_VISIBLE, CRect(0, 0, 0, 0), GetDockingSite(), 0);
		m_pDropTarget->Register(this);
	}
}
Ejemplo n.º 7
0
UPnpCDSExtensionResults *UPnpCDSExtension::ProcessAll ( UPnpCDSRequest          *pRequest,
                                                        UPnpCDSExtensionResults *pResults,
                                                        QStringList             &/*idPath*/ )
{
    pResults->m_nTotalMatches   = 0;
    pResults->m_nUpdateID       = 1;

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    switch( pRequest->m_eBrowseFlag )
    {
        case CDS_BrowseMetadata:
        {
            // --------------------------------------------------------------
            // Return Container Object Only
            // --------------------------------------------------------------

            UPnpCDSRootInfo *pInfo = GetRootInfo( 0 );

            if (pInfo != NULL)
            {
                pResults->m_nTotalMatches   = 1;
                pResults->m_nUpdateID       = 1;

                CDSObject *pItem = CreateContainer( pRequest->m_sObjectId,
                                                    QObject::tr( pInfo->title ),
                                                    m_sExtensionId );

                pItem->SetChildCount( GetDistinctCount( pInfo ) );

                pResults->Add( pItem );
            }

            break;
        }

        case CDS_BrowseDirectChildren:
        {

            CreateItems( pRequest, pResults, 0, "", false );

            break;
        }

        case CDS_BrowseUnknown:
        default:
            break;

    }


    return pResults;
}
Ejemplo n.º 8
0
INT_PTR SendMessageCommand_W(WPARAM wParam, LPARAM lParam)
{
	HWND hwnd;
	char *szProto;
	struct TNewWindowData newData = {
		0
	};
	struct TContainerData *pContainer = 0;
	int isSplit = 1;

	/*
	 * make sure that only the main UI thread will handle window creation
     */
	if (GetCurrentThreadId() != PluginConfig.dwThreadID) {
		if (lParam) {
			unsigned iLen = lstrlenW((wchar_t *)lParam);
			wchar_t *tszText = (wchar_t *)malloc((iLen + 1) * sizeof(wchar_t));
			wcsncpy(tszText, (wchar_t *)lParam, iLen + 1);
			tszText[iLen] = 0;
			PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SENDMESSAGECOMMANDW, wParam, (LPARAM)tszText);
		} else
			PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SENDMESSAGECOMMANDW, wParam, 0);
		return 0;
	}

	/* does the HCONTACT's protocol support IM messages? */
	szProto = (char *) CallService(MS_PROTO_GETCONTACTBASEPROTO, wParam, 0);
	if (szProto) {
		if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
			return 0;
	} else {
		/* unknown contact */
		return 0;
	}

	if (hwnd = M->FindWindow((HANDLE) wParam)) {
		if (lParam) {
			HWND hEdit;
			hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
			SendMessage(hEdit, EM_SETSEL, -1, SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0));
			SendMessage(hEdit, EM_REPLACESEL, FALSE, (LPARAM)(TCHAR *) lParam);
		}
		SendMessage(hwnd, DM_ACTIVATEME, 0, (LPARAM) 0);
	} else {
		TCHAR szName[CONTAINER_NAMELEN + 1];

		GetContainerNameForContact((HANDLE) wParam, szName, CONTAINER_NAMELEN);
		pContainer = FindContainerByName(szName);
		if (pContainer == NULL)
			pContainer = CreateContainer(szName, FALSE, (HANDLE)wParam);
		CreateNewTabForContact(pContainer, (HANDLE) wParam, 1, (const char *)lParam, TRUE, TRUE, FALSE, 0);
	}
	return 0;
}
Ejemplo n.º 9
0
CDSObject *CDSObject::CreateGenre( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == nullptr)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.genre";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    return( pObject );
}
Ejemplo n.º 10
0
CDSObject *CDSObject::CreatePerson( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == NULL)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.person";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "language", "dc" ));

    return( pObject );
}
Ejemplo n.º 11
0
 Container::Ptr Decode(const Binary::Container& rawData) const override
 {
   if (!Format->Match(rawData))
   {
     return Container::Ptr();
   }
   const Formats::ImageBuilder::Ptr builder = CreateSparsedImageBuilder();
   TeleDiskImage::ImageVisitorAdapter visitor(builder);
   if (const std::size_t usedSize = TeleDiskImage::Parse(rawData, visitor))
   {
     return CreateContainer(builder->GetResult(), usedSize);
   }
   return Container::Ptr();
 }
Ejemplo n.º 12
0
DockCont *DockWindow::GetReleasedContainer(DockableCtrl &dc)
{
	DockCont *c = GetContainer(dc);
	if (c && c->GetCount() > 1) {
		dc.Remove();
		c->RefreshLayout();
		c = NULL;
	}
	if (c)
		Detach(*c);
	else
		c = CreateContainer(dc);
	return c;
}
Ejemplo n.º 13
0
CDSObject *CDSObject::CreateStorageFolder( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == NULL)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.storageFolder";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "storageUsed", "upnp", true ));

    return( pObject );
}
Ejemplo n.º 14
0
CDSObject *CDSObject::CreateGenre( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == NULL)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.genre";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "longDescription", "upnp" ));
    pObject->AddProperty( new Property( "description"    , "dc"   ));

    return( pObject );
}
Ejemplo n.º 15
0
INT_PTR SendMessageCommand(WPARAM hContact, LPARAM lParam)
{
	TNewWindowData newData = { 0 };
	int isSplit = 1;

	if (GetCurrentThreadId() != PluginConfig.dwThreadID) {
		if (lParam) {
			unsigned iLen = lstrlenA((char *)lParam);
			char *szText = (char *)mir_alloc(iLen + 1);
			strncpy(szText, (char *)lParam, iLen + 1);
			szText[iLen] = 0;
			PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SENDMESSAGECOMMAND, hContact, (LPARAM)szText);
		} else
			PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SENDMESSAGECOMMAND, hContact, 0);
		return 0;
	}

	/* does the MCONTACT's protocol support IM messages? */
	char *szProto = GetContactProto(hContact);
	if (szProto) {
		if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
			return 0;
	} else {
		/* unknown contact */
		return 0;
	}
	
	HWND hwnd = M.FindWindow(hContact);
	if (hwnd) {
		if (lParam) {
			HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
			SendMessage(hEdit, EM_SETSEL, -1, SendMessage(hEdit, WM_GETTEXTLENGTH, 0, 0));
			SendMessageA(hEdit, EM_REPLACESEL, FALSE, (LPARAM)(char *) lParam);
		}
		SendMessage(hwnd, DM_ACTIVATEME, 0, 0);          // ask the message window about its parent...
	}
	else {
		TCHAR szName[CONTAINER_NAMELEN + 1];
		GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN);
		TContainerData *pContainer = FindContainerByName(szName);
		if (pContainer == NULL)
			pContainer = CreateContainer(szName, FALSE, hContact);
		if (pContainer)
			CreateNewTabForContact(pContainer, hContact, 0, (const char *) lParam, TRUE, TRUE, FALSE, 0);
	}
	return 0;
}
Ejemplo n.º 16
0
CDSObject *CDSObject::CreateStorageVolume( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == nullptr)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.storageVolume";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "storageTotal" , "upnp", true, "-1"  ));
    pObject->AddProperty( new Property( "storageUsed"  , "upnp", true, "-1"  ));
    pObject->AddProperty( new Property( "storageFree"  , "upnp", true, "-1"  ));
    pObject->AddProperty( new Property( "storageMedium", "upnp", true, "HDD" ));

    return( pObject );
}
BOOL CXTPDockingPaneSidePanel::Init(CXTPDockingPaneBase* pBasePane, XTPDockingPaneDirection direction, CRect rc)
{
	CXTPDockingPaneBaseList lstPanes;
	pBasePane->FindPane(xtpPaneTypeDockingPane, &lstPanes);
	if (lstPanes.GetCount() == 0)
		return FALSE;

	m_direction = direction;
	m_rcWindow = rc;
	CreateContainer();

	CXTPDockingPaneTabbedContainer* pContainer = (CXTPDockingPaneTabbedContainer*)GetDockingPaneManager()->
		OnCreatePane(xtpPaneTypeTabbedContainer, m_pLayout);

	BOOL bInit = FALSE;

	POSITION pos = lstPanes.GetHeadPosition();
	while (pos)
	{
		CXTPDockingPane* pPane = (CXTPDockingPane*)lstPanes.GetNext(pos);

		if (pPane->GetContainer())
		{
			pPane->GetContainer()->RemovePane(pPane);
		}

		if (!bInit)
		{
			pContainer->Init((CXTPDockingPane*)pPane, this);
		}
		else
		{
			pContainer->_InsertPane(pPane, FALSE);
		}
		bInit = TRUE;
	}

	_InsertPane(pContainer);

	OnFocusChanged();

	m_nIdleFlags = 0;

	return TRUE;
}
Ejemplo n.º 18
0
static INT_PTR ReadMessageCommand(WPARAM, LPARAM lParam)
{
	MCONTACT hContact = ((CLISTEVENT *) lParam)->hContact;

	HWND hwndExisting = M.FindWindow(hContact);
	if (hwndExisting != 0)
		SendMessage(hwndExisting, DM_ACTIVATEME, 0, 0);
	else {
		TCHAR szName[CONTAINER_NAMELEN + 1];
		GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN);
		TContainerData *pContainer = FindContainerByName(szName);
		if (pContainer == NULL)
			pContainer = CreateContainer(szName, FALSE, hContact);
		if (pContainer)
			CreateNewTabForContact(pContainer, hContact, 0, NULL, TRUE, TRUE, FALSE, 0);
	}
	return 0;
}
Ejemplo n.º 19
0
CDSObject *CDSObject::CreateStorageSystem( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == NULL)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.storageSystem";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "storageTotal"       , "upnp", true )); 
    pObject->AddProperty( new Property( "storageUsed"        , "upnp", true )); 
    pObject->AddProperty( new Property( "storageFree"        , "upnp", true )); 
    pObject->AddProperty( new Property( "storageMaxPartition", "upnp", true )); 
    pObject->AddProperty( new Property( "storageMedium"      , "upnp", true )); 

    return( pObject );
}
boost::shared_ptr<ResourceContainer> ContainerManager::GetContainer(
	const std::string& name)
{
	MojLogTrace(s_log);
	MojLogInfo(s_log, _T("Looking up [Container %s]"), name.c_str());

	ContainerMap::iterator found = m_containers.find(name);
	if (found != m_containers.end()) {
		return found->second;
	}

	MojLogInfo(s_log, _T("Allocating new container for [Container %s]"),
		name.c_str());

	boost::shared_ptr<ResourceContainer> container = CreateContainer(name);
	m_containers[name] = container;

	return container;
}
Ejemplo n.º 21
0
INT_PTR SendMessageCommand_Worker(MCONTACT hContact, LPCSTR pszMsg, bool isWchar)
{
	// make sure that only the main UI thread will handle window creation
	if (GetCurrentThreadId() != PluginConfig.dwThreadID) {
		if (pszMsg) {
			wchar_t *tszText = (isWchar) ? mir_wstrdup((WCHAR*)pszMsg) : mir_a2u(pszMsg);
			PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SENDMESSAGECOMMANDW, hContact, (LPARAM)tszText);
		}
		else PostMessage(PluginConfig.g_hwndHotkeyHandler, DM_SENDMESSAGECOMMANDW, hContact, 0);
		return 0;
	}

	// does the MCONTACT's protocol support IM messages?
	char *szProto = GetContactProto(hContact);
	if (szProto == NULL)
		return 0; // unknown contact
	if (!CallProtoService(szProto, PS_GETCAPS, PFLAGNUM_1, 0) & PF1_IMSEND)
		return 0;

	HWND hwnd = M.FindWindow(hContact);
	if (hwnd) {
		if (pszMsg) {
			HWND hEdit = GetDlgItem(hwnd, IDC_MESSAGE);
			SendMessage(hEdit, EM_SETSEL, -1, GetWindowTextLength(hEdit));
			if (isWchar)
				SendMessageW(hEdit, EM_REPLACESEL, FALSE, (LPARAM)pszMsg);
			else
				SendMessageA(hEdit, EM_REPLACESEL, FALSE, (LPARAM)pszMsg);
		}
		SendMessage(hwnd, DM_ACTIVATEME, 0, 0);
	}
	else {
		TCHAR szName[CONTAINER_NAMELEN + 1];
		GetContainerNameForContact(hContact, szName, CONTAINER_NAMELEN);

		TContainerData *pContainer = FindContainerByName(szName);
		if (pContainer == NULL)
			pContainer = CreateContainer(szName, FALSE, hContact);
		if (pContainer)
			CreateNewTabForContact(pContainer, hContact, isWchar, pszMsg, TRUE, TRUE, FALSE, 0);
	}
	return 0;
}
Ejemplo n.º 22
0
boost::shared_ptr<ResourceContainer> ContainerManager::GetContainer(
	const std::string& name)
{
	LOG_TRACE("Entering function %s", __FUNCTION__);
	LOG_DEBUG("Looking up [Container %s]", name.c_str());

	ContainerMap::iterator found = m_containers.find(name);
	if (found != m_containers.end()) {
		return found->second;
	}

	LOG_DEBUG("Allocating new container for [Container %s]",
		name.c_str());

	boost::shared_ptr<ResourceContainer> container = CreateContainer(name);
	m_containers[name] = container;

	return container;
}
Ejemplo n.º 23
0
CDSObject *CDSObject::CreatePlaylistContainer( QString sId, QString sTitle, QString sParentId, CDSObject *pObject ) 
{
    if (pObject == nullptr)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.playlistContainer";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "artist"         , "upnp" ));
    pObject->AddProperty( new Property( "genre"          , "upnp" ));
    pObject->AddProperty( new Property( "producer"       , "upnp" ));
    pObject->AddProperty( new Property( "storageMedium"  , "upnp" ));
    pObject->AddProperty( new Property( "contributor"    , "dc"   ));  
    pObject->AddProperty( new Property( "language"       , "dc"   ));  
    pObject->AddProperty( new Property( "rights"         , "dc"   ));  

    return( pObject );
}
void CXTPDockingPaneSidePanel::_InsertPane(CXTPDockingPaneBase* pPane)
{
	ASSERT(m_lstPanes.IsEmpty());
	ASSERT(pPane->GetType() == xtpPaneTypeTabbedContainer);

	if (!m_hWnd && !m_pLayout->IsUserLayout() && pPane->GetPaneHwnd())
	{
		CreateContainer();
	}

	m_lstPanes.AddTail(pPane);

	pPane->SetParentContainer(this);
	pPane->SetDockingSite(this);

	pPane->OnParentContainerChanged(this);

	((CXTPDockingPaneTabbedContainer*)pPane)->ShowTitle(FALSE);

}
Ejemplo n.º 25
0
CDSObject *CDSObject::CreateAlbum( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == NULL)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.album";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "storageMedium"  , "upnp" ));
    pObject->AddProperty( new Property( "longDescription", "dc"   ));
    pObject->AddProperty( new Property( "description"    , "dc"   ));
    pObject->AddProperty( new Property( "publisher"      , "dc"   ));
    pObject->AddProperty( new Property( "contributor"    , "dc"   ));
    pObject->AddProperty( new Property( "date"           , "dc"   ));
    pObject->AddProperty( new Property( "relation"       , "dc"   ));
    pObject->AddProperty( new Property( "rights"         , "dc"   ));

    return( pObject );
}
Ejemplo n.º 26
0
    Formats::Chiptune::Container::Ptr Parse(const Binary::Container& rawData, Builder& target)
    {
      const Binary::TypedContainer data = CreateContainer(rawData);

      if (!FastCheck(data))
      {
        return Formats::Chiptune::Container::Ptr();
      }

      try
      {
        const Format format(data);

        StatisticCollectingBuilder statistic(target);
        format.ParseCommonProperties(statistic);
        format.ParsePositions(statistic);
        Indices usedPatterns = statistic.GetUsedPatterns();
        const uint_t mode = statistic.GetMode();
        if (mode != SINGLE_AY_MODE
         && !AddTSPatterns(mode, usedPatterns))
        {
          target.SetMode(SINGLE_AY_MODE);
        }
        format.ParsePatterns(usedPatterns, statistic);
        const Indices& usedSamples = statistic.GetUsedSamples();
        format.ParseSamples(usedSamples, target);
        const Indices& usedOrnaments = statistic.GetUsedOrnaments();
        format.ParseOrnaments(usedOrnaments, target);

        Require(format.GetSize() >= MIN_SIZE);
        const Binary::Container::Ptr subData = rawData.GetSubcontainer(0, format.GetSize());
        const RangeChecker::Range fixedRange = format.GetFixedArea();
        return CreateCalculatingCrcContainer(subData, fixedRange.first, fixedRange.second - fixedRange.first);
      }
      catch (const std::exception&)
      {
        Dbg("Failed to create");
        return Formats::Chiptune::Container::Ptr();
      }
    }
Ejemplo n.º 27
0
CDSObject *CDSObject::CreateAlbum( QString sId, QString sTitle, QString sParentId, CDSObject *pObject )
{
    if (pObject == nullptr)
    {
        pObject = new CDSObject( sId, sTitle, sParentId );
        pObject->m_sClass = "object.container.album";
    }

    CreateContainer( sId, sTitle, sParentId, pObject );

    pObject->AddProperty( new Property( "storageMedium"  , "upnp" ));
    pObject->AddProperty( new Property( "publisher"      , "dc"   ));
    pObject->AddProperty( new Property( "contributor"    , "dc"   ));
    pObject->AddProperty( new Property( "relation"       , "dc"   ));
    pObject->AddProperty( new Property( "rights"         , "dc"   ));

    // Artwork
    pObject->AddProperty( new Property( "albumArtURI", "upnp", false, "", true)); // TN
    pObject->AddProperty( new Property( "albumArtURI", "upnp", false, "", true)); // SM
    pObject->AddProperty( new Property( "albumArtURI", "upnp", false, "", true)); // MED
    pObject->AddProperty( new Property( "albumArtURI", "upnp", false, "", true)); // LRG

    return( pObject );
}
void CXTPDockingPaneTabbedContainer::_InsertPane(CXTPDockingPane* pPane, BOOL bSetFocus)
{
	ASSERT(m_pLayout);
	if (!m_pLayout)
		return;

	if (!m_hWnd && !m_pLayout->IsUserLayout())
	{
		CreateContainer();
	}

	m_lstPanes.AddTail(pPane);

	pPane->SetParentContainer(this);
	pPane->SetDockingSite(GetDockingSite());

	m_bDelayRedraw = TRUE;
	GetDockingPaneManager()->RecalcFrameLayout(this, TRUE);

	SelectPane(pPane, bSetFocus);

	SAFE_CALLPTR(m_pParentContainer, OnChildContainerChanged(this));

}
Ejemplo n.º 29
0
void ShowRoom(SESSION_INFO *si, WPARAM wp, BOOL bSetForeground)
{
	if (si == NULL)
		return;

	if (si->hWnd != NULL) {
		ActivateExistingTab(si->pContainer, si->hWnd);
		return;
	}

	TCHAR szName[CONTAINER_NAMELEN + 2]; szName[0] = 0;
	TContainerData *pContainer = si->pContainer;
	if (pContainer == NULL) {
		GetContainerNameForContact(si->hContact, szName, CONTAINER_NAMELEN);
		if (!g_Settings.bOpenInDefault && !_tcscmp(szName, _T("default")))
			_tcsncpy(szName, _T("Chat Rooms"), CONTAINER_NAMELEN);
		szName[CONTAINER_NAMELEN] = 0;
		pContainer = FindContainerByName(szName);
	}
	if (pContainer == NULL)
		pContainer = CreateContainer(szName, FALSE, si->hContact);
	if (pContainer)
		si->hWnd = CreateNewRoom(pContainer, si, TRUE, TRUE, FALSE);
}
Ejemplo n.º 30
0
UPnpCDSExtensionResults *UPnpCDSExtension::ProcessKey( UPnpCDSRequest          *pRequest,
                                                       UPnpCDSExtensionResults *pResults,
                                                       QStringList             &idPath )
{
    pResults->m_nTotalMatches   = 0;
    pResults->m_nUpdateID       = 1;

    // ----------------------------------------------------------------------
    //
    // ----------------------------------------------------------------------

    QString sKey = idPath.last().section( '=', 1, 1 );
    QUrl::decode( sKey );

    if (sKey.length() > 0)
    {
        int nNodeIdx = idPath[ idPath.count() - 2 ].toInt();

        switch( pRequest->m_eBrowseFlag )
        {

            case CDS_BrowseMetadata:
            {
                UPnpCDSRootInfo *pInfo = GetRootInfo( nNodeIdx );

                if (pInfo == NULL)
                    return pResults;

                pRequest->m_sParentId = RemoveToken( "/", pRequest->m_sObjectId, 1 );

                // --------------------------------------------------------------
                // Since Key is not always the title, we need to lookup title.
                // --------------------------------------------------------------

                MSqlQuery query(MSqlQuery::InitCon());

                if (query.isConnected())
                {
                    QString sSQL   = QString( pInfo->sql )
                                        .arg( pInfo->where );

                    // -=>TODO: There is a problem when called for an Item, instead of a container
                    //          sKey = '<KeyName>/item?ChanId' which is incorrect.


                    query.prepare  ( sSQL );
                    query.bindValue( ":KEY", sKey );
                    query.exec();

                    if (query.isActive() && query.size() > 0)
                    {
                        if ( query.next() )
                        {
                            // ----------------------------------------------
                            // Return Container Object Only
                            // ----------------------------------------------

                            pResults->m_nTotalMatches   = 1;
                            pResults->m_nUpdateID       = 1;

                            CDSObject *pItem = CreateContainer( pRequest->m_sObjectId,
                                                                query.value(1).toString(),
                                                                pRequest->m_sParentId );

                            pItem->SetChildCount( GetDistinctCount( pInfo ));

                            pResults->Add( pItem );
                        }
                    }
                }
                break;
            }

            case CDS_BrowseDirectChildren:
            {

                CreateItems( pRequest, pResults, nNodeIdx, sKey, true );

                break;
            }

            case CDS_BrowseUnknown:
                default:
                break;
        }
    }

    return pResults;
}