예제 #1
0
bool BBP_read_window_modes(struct plugin_info *PI, const char *rcfile)
{
    if (0 == PI->rcpath[0])
        BBP_get_rcpath(PI->rcpath, PI->hInstance, rcfile);

    PI->xpos = BBP_read_int(PI,  "position.x", 20);
    PI->ypos = BBP_read_int(PI,  "position.y", 20);

    const char *place_string = BBP_read_string(PI, NULL, "placement", NULL);
    if (place_string)
        PI->place = BBP_get_placement(place_string);

    PI->hMon = GetMonitorRect(&PI->xpos, &PI->mon_rect, GETMON_FROM_POINT);
    set_place(PI);

    PI->useSlit         = BBP_read_bool(PI, "useSlit", false);
    PI->alwaysOnTop     = BBP_read_bool(PI, "alwaysOnTop", false);
    PI->autoHide        = BBP_read_bool(PI, "autoHide", false);
    PI->snapWindow      = BBP_read_int(PI, "snapWindow", 20);
    PI->pluginToggle    = BBP_read_bool(PI, "pluginToggle", true);
    PI->clickRaise      = BBP_read_bool(PI, "clickRaise", true);
	PI->transparent     = BBP_read_bool(PI, "transparent", false);
    PI->alphaValue      = (BYTE)eightScale_up(BBP_read_int(PI,  "alpha.value",  *(int *)GetSettingPtr(SN_MENUALPHA)));
    PI->orient_vertical = PI->is_bar || 0 == stricmp("vertical", BBP_read_string(PI, NULL, "orientation", "vertical"));
	if (false == PI->no_icons)
	{
		PI->saturation		= eightScale_up(BBP_read_int(PI,  "icon.saturation", 3));
		PI->hue				= eightScale_up(BBP_read_int(PI,  "icon.hue", 2));
	}
    if (NULL == place_string) {
        BBP_write_window_modes(PI);
        return false;
    }
    return true;
}
예제 #2
0
파일: place.cpp 프로젝트: D4ryus/studium
Place& Place::operator=(const Place& place){
	if(this == &place){
		return *this;
	}else{
		set_place(place.get_x(), place.get_y(), place.get_name(), place.get_sign());
	}
}
예제 #3
0
파일: place.cpp 프로젝트: D4ryus/studium
Place::Place(const Place& place) {
	name = NULL;
	sign = NULL;
	x = 0;
	y = 0;
	if (place.name && place.sign) {
        set_place(place.get_x(), place.get_y(), place.get_name(), place.get_sign());
    } else {
        cout << "Cannot copy NULL pointer!!" << endl;
    }
}
예제 #4
0
void BBP_set_window_modes(plugin_info *PI)
{
    bool useslit = PI->useSlit && PI->hSlit;
    bool visible = PI->visible && (false == PI->toggled_hidden || useslit);
    bool updateslit = false;
    BYTE trans = 255;

    PI->auto_hidden = false;

    if (visible != PI->is_visible)
    {
        ShowWindow(PI->hwnd, visible ? SW_SHOWNA : SW_HIDE);
        PI->is_visible = visible;
        updateslit = true;
    }

    if (useslit)// && false == hidden)
    {
        RECT r;
        int w, h;
        bool update_size;

        GetWindowRect(PI->hwnd, &r);
        w = r.right - r.left;
        h = r.bottom - r.top;
        update_size = (w != PI->width || h != PI->height);

        if (update_size)
        {
            SetWindowPos(
                PI->hwnd,
                NULL,
                0,
                0,
                PI->width,
                PI->height,
                SWP_NOACTIVATE|SWP_NOMOVE|SWP_NOZORDER
                );
            updateslit = true;
        }

        if (false == PI->inSlit)
        {
            if (PI->is_alpha != trans)
            {
                SetTransparency(PI->hwnd, trans);
                PI->is_alpha = trans;
            }
            PI->inSlit = true;
            SendMessage(PI->hSlit, SLIT_ADD, (WPARAM)PI->broam_key, (LPARAM)PI->hwnd);
        }
        else
        if (updateslit)
        {
            SendMessage(PI->hSlit, SLIT_UPDATE, 0, (LPARAM)PI->hwnd);
        }
    }
    else
    {
        int x, y, w, h;
        HWND hwnd_after;
        UINT flags = SWP_NOACTIVATE;

        if (PI->inSlit)
        {
            SendMessage(PI->hSlit, SLIT_REMOVE, 0, (LPARAM)PI->hwnd);
            PI->inSlit = false;
        }

        set_place(PI);
        x = PI->xpos;
        y = PI->ypos;
        w = PI->width;
        h = PI->height;

        if (PI->autoHide && false == PI->auto_shown)
        {
            int hangout = 3;
            int place = PI->place;
            if ((false == PI->orient_vertical && (place == POS_TopLeft || place == POS_BottomLeft))
                || place == POS_CenterLeft || place == POS_Left)
            {
                x = PI->mon_rect.left, w = hangout;
                PI->auto_hidden = true;
            }
            else
            if ((false == PI->orient_vertical && (place == POS_TopRight || place == POS_BottomRight))
                || place == POS_CenterRight || place == POS_Right)
            {
                x = PI->mon_rect.right - hangout, w = hangout;
                PI->auto_hidden = true;
            }
            else
            if (place == POS_TopLeft || place == POS_TopCenter || place == POS_TopRight || place == POS_Top)
            {
                y = PI->mon_rect.top, h = hangout;
                PI->auto_hidden = true;
            }
            else
            if (place == POS_BottomLeft || place == POS_BottomCenter || place == POS_BottomRight || place == POS_Bottom)
            {
                y = PI->mon_rect.bottom - hangout, h = hangout;
                PI->auto_hidden = true;
            }
        }

        if (WS_CHILD & GetWindowLong(PI->hwnd, GWL_STYLE))
        {
            flags |= SWP_NOZORDER;
            hwnd_after = NULL;
        }
        else
        {
            if (PI->alwaysOnTop || PI->auto_shown || PI->auto_hidden)
                hwnd_after = HWND_TOPMOST;
            else
                hwnd_after = HWND_NOTOPMOST;
        }

        SetWindowPos(PI->hwnd, hwnd_after, x, y, w, h, flags);

        trans = PI->auto_hidden ? 255 : PI->alphaValue;

        if (PI->is_alpha != trans)
        {
            if (PI->transparent)
				SetFullTransparency(PI->hwnd, trans);
			else
				SetTransparency(PI->hwnd, trans);
            PI->is_alpha = trans;
        }
    }

    PI->pos_changed(_THIS);
}
예제 #5
0
파일: place.cpp 프로젝트: D4ryus/studium
/* Regular Called Constructor to set x, y, name and sign */
Place::Place(int setX, int setY, const char* setname, const char* setsign) {
    set_place(setX, setY, setname, setsign);
}