Esempio n. 1
0
void DisposeWindowFromThreadID(uint32_t tid)
{
    for (int i = 0; i < captures.size(); i++)
    {
        if (captures[i]->ThreadID == tid)
        {
            captures.removeAt(i);
            i--;
        }
    }
    for (int i = 0; i < windows.size(); i++)
    {
        guiserver_window* w = windows[i];
        if (w->ThreadID == tid)
        {
            if (prevWindow == w) prevWindow = NULL;
            if (activeWindow == w) {
                activeWindow = NULL;
//                ActivateWindow(NULL);
            }
            if (w->FormBufferHandle != 0)
            {
                w->Visible = false;
                DrawWindow(w);
            }
            windows.removeAt(i);
            MemoryMap::unmap(w->Handle);
            i--;
        }
    }
    if (activeWindow == NULL) ActivateWindow(GetFrontWindow());
}
Esempio n. 2
0
bool DisposeWindow(uint32_t handle)
{
    if (prevWindow != NULL && prevWindow->Handle == handle) prevWindow = NULL;
    if (activeWindow != NULL && activeWindow->Handle == handle) ActivateWindow(NULL);

    int size_c = captures.size();
    for (int i = 0; i < size_c; i++)
    {
        if (captures[i]->Handle == handle)
        {
            captures.removeAt(i);
            break;
        }
    }
    int size_w = windows.size();
    for (int i = 0; i < size_w; i++)
    {
        guiserver_window* w = windows[i];
        if (w->Handle == handle)
        {
            if (w->__internal2) DestructionEffect(w);
            windows.removeAt(i);
            MemoryMap::unmap(handle);
            if (activeWindow == NULL) ActivateWindow(GetFrontWindow());
            return true;
        }
    }
    return false;
}
Esempio n. 3
0
static void unregisterReceiver(uint32_t tid)
{
    int size = receivers.size();
    for (int i = 0; i < size; i++)
    {
        if (receivers[i] != tid) continue;
        receivers.removeAt(i);
        return;
    }
}
Esempio n. 4
0
    int __mlibc_filelist_remove_by_index(void *p, int n)
    {
        HList<FILE*>* list;

        if( p == NULL ) p = __mlibc_filelist_initializer(p);
        list = (HList<FILE*>*)p;
        if( list->size() <= n ) return 0;
        list->removeAt(n);
        return 1;
    }
Esempio n. 5
0
File: main.cpp Progetto: s50/mona
 void sendToClients(MessageInfo* msg)
 {
     for (int i = clients_.size() - 1; i >= 0; i--)
     {
         if (Message::send(clients_[i], msg) != M_OK)
         {
             monapi_warn("send error to pid = %x", clients_[i]);
             uint32_t temp;
             clients_.removeAt(i, &temp);
         }
     }
 }
Esempio n. 6
0
bool DisposeBitmap(uint32_t handle)
{
	int size = bitmaps.size();
	for (int i = 0; i < size; i++)
	{
		if (bitmaps[i]->Handle == handle)
		{
			bitmaps.removeAt(i);
			MemoryMap::unmap(handle);
			return true;
		}
	}
	return false;
}
Esempio n. 7
0
void notifyProcessTerminated(uint32_t tid, int status)
{
    int i = 0;
    while (i < receivers.size())
    {
        if (Message::send(receivers[i], MSG_PROCESS_TERMINATED, tid, status) == M_OK)
        {
            i++;
        }
        else
        {
            _printf("%s: can not connect to %d\n", SVR, receivers[i]);
            removeProcessInfo(receivers[i]);
            receivers.removeAt(i);
        }
    }
}
Esempio n. 8
0
void notifyProcessCreated(uint32_t tid, uint32_t parent, const CString& path)
{
    int i = 0;
    while (i < receivers.size())
    {
        if (Message::send(receivers[i], MSG_PROCESS_CREATED, tid, parent, 0, path) == M_OK)
        {
            i++;
        }
        else
        {
            _printf("%s: can not connect to %d\n", SVR, receivers[i]);
            removeProcessInfo(receivers[i]);
            receivers.removeAt(i);
        }
    }
}