void info_wait(int id) { POINTL pt; if (id) load_string(id, szWait, sizeof(szWait)); else szWait[0] = '\0'; if (hwnd_status) { WinInvalidateRect(hwnd_status, (PRECTL)NULL, TRUE); WinUpdateWindow(hwnd_status); } /* find out if cursor over hwnd_bmp */ if (!WinQueryPointerPos(HWND_DESKTOP, &pt)) return; if (hwnd_bmp == WinWindowFromPoint(HWND_DESKTOP, &pt, TRUE)) WinSendMsg(hwnd_bmp, WM_MOUSEMOVE, MPFROM2SHORT(pt.x, pt.y), (MPARAM)0); }
/***************************************************************************** * Control: control facility for the vout *****************************************************************************/ static int Control( vout_display_t *vd, int query, va_list args ) { vout_display_sys_t *sys = vd->sys; switch (query) { case VOUT_DISPLAY_HIDE_MOUSE: { POINTL ptl; WinQueryPointerPos( HWND_DESKTOP, &ptl ); if( WinWindowFromPoint( HWND_DESKTOP, &ptl, TRUE ) == sys->client ) { WinShowPointer( HWND_DESKTOP, FALSE ); sys->is_mouse_hidden = true; } return VLC_SUCCESS; } case VOUT_DISPLAY_CHANGE_FULLSCREEN: { vout_display_cfg_t cfg = *va_arg(args, const vout_display_cfg_t *); if( sys->parent_window ) vout_window_SetFullScreen(sys->parent_window, cfg.is_fullscreen); else WinPostMsg( sys->client, WM_VLC_FULLSCREEN_CHANGE, MPFROMLONG( cfg.is_fullscreen ), 0 ); return VLC_SUCCESS; } case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: { const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *); bool is_forced = va_arg(args, int); if( is_forced ) { if( sys->parent_window ) { vout_window_SetSize(sys->parent_window, cfg->display.width, cfg->display.height); /* Workaround : * If changing aspect ratio after resizing a main window, * an embedded window is misplaced. So reposition it, here. */ WinSetWindowPos( WinQueryWindow( sys->parent, QW_PARENT ), HWND_TOP, 0, 1, 0, 0, SWP_MOVE ); WinSetWindowPos( WinQueryWindow( sys->parent, QW_PARENT ), HWND_TOP, 0, 0, 0, 0, SWP_MOVE ); } else WinPostMsg( sys->client, WM_VLC_SIZE_CHANGE, MPFROMLONG( cfg->display.width ), MPFROMLONG( cfg->display.height )); } return VLC_SUCCESS; } case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: case VOUT_DISPLAY_CHANGE_SOURCE_CROP: { const video_format_t *source = va_arg(args, const video_format_t *); if( query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT ) { sys->kvas.ulAspectWidth = ( int64_t )source->i_width * source->i_sar_num / source->i_sar_den; sys->kvas.ulAspectHeight = source->i_height; } else { sys->kvas.rclSrcRect.xLeft = source->i_x_offset; sys->kvas.rclSrcRect.yTop = source->i_y_offset; sys->kvas.rclSrcRect.xRight = source->i_x_offset + source->i_visible_width; sys->kvas.rclSrcRect.yBottom = source->i_y_offset + source->i_visible_height; } kvaSetup( &sys->kvas ); return VLC_SUCCESS; } case VOUT_DISPLAY_RESET_PICTURES: case VOUT_DISPLAY_CHANGE_WINDOW_STATE: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: case VOUT_DISPLAY_CHANGE_ZOOM: case VOUT_DISPLAY_GET_OPENGL: /* TODO */ break; } msg_Err(vd, "Unsupported query(=%d) in vout display KVA", query); return VLC_EGENERIC; }
/*----------------------------------------------------------------------*/ void DMLBCheckTargetLocation(HWND SrcHwnd, DMLBData *InstData, SHORT X, SHORT Y) /*----------------------------------------------------------------------*/ /* X,Y is in SrcHwnd window coordinates. */ /* Given an Y,Y coordinate of the pointer, determine if the pointer is */ /* over a listbox that will accept a drop. If it is, we save the */ /* handle of the listbox and set the PrevLocation to POINT_INSIDE in */ /* the instance data. Otherwise, we see if the position is near the */ /* top/bottom edge of the last good target listbox we had. If so, set */ /* the PrevLocation to POINT_NORTH/SOUTH as appropriate. Finally, if */ /* none of the above, just set the PrevLocation to POINT_OUTSIDE. */ /*----------------------------------------------------------------------*/ { RECTL Rect; POINTL ScreenPoint; HWND OverHwnd; char OverClass[10]; InstData->PrevLocation = POINT_OUTSIDE; // Assume this until we know otherwise /* See if window under the pointer is a listbox. */ ScreenPoint.x = X; ScreenPoint.y = Y; WinMapWindowPoints(SrcHwnd, HWND_DESKTOP, &ScreenPoint, 1L); OverHwnd = WinWindowFromPoint(HWND_DESKTOP, &ScreenPoint, TRUE); WinQueryClassName(OverHwnd, sizeof(OverClass), OverClass); if (!strcmp(OverClass, LISTBOX_CLASS_STRING)) { /* Yes, it is a listbox -- see if it will accept our drop */ MRESULT Answer; /* If this is part of an MCLB, the MCLB is really the target */ WinQueryClassName(WinQueryWindow(OverHwnd, QW_OWNER), sizeof(OverClass), OverClass); if (!strcmp(OverClass, "MCLBCls")) OverHwnd = WinQueryWindow(OverHwnd, QW_OWNER); Answer = WinSendMsg(WinQueryWindow(OverHwnd, QW_OWNER), WM_CONTROL, MPFROM2SHORT(WinQueryWindowUShort(OverHwnd, QWS_ID), LN_DMLB_QRYDROP), MPFROMHWND(SrcHwnd)); if ((BOOL)SHORT1FROMMR(Answer)) { /* Yes, it will accept the drop */ InstData->TargetHwnd = OverHwnd; // Note new target // if (SrcHwnd == OverHwnd) // InstData->TargetDropMode = DROPMODE_MOVE; // Force MOVE for same-listbox drops // else InstData->TargetDropMode = SHORT2FROMMR(Answer); // Copy, Move, or Delete InstData->PrevLocation = POINT_INSIDE; // We are inside the listbox now return; } /* It will not accept a drop, proceed as point outside */ return; } /* Not a listbox class window. See if pointer is near north/south */ /* edge of last good target listbox. ("Near" is defined as the */ /* height of a menu bar). */ WinQueryWindowRect(InstData->TargetHwnd, &Rect); /* Translate rectangle to screen coordinates */ WinMapWindowPoints(InstData->TargetHwnd, HWND_DESKTOP, (POINTL *)&Rect, 2L); if ((ScreenPoint.x >= Rect.xLeft) && (ScreenPoint.x <= Rect.xRight)) { if ((ScreenPoint.y < Rect.yTop + WinQuerySysValue(HWND_DESKTOP, SV_CYMENU)) && (ScreenPoint.y > Rect.yBottom - WinQuerySysValue(HWND_DESKTOP, SV_CYMENU))) { if (ScreenPoint.y > Rect.yTop) InstData->PrevLocation = POINT_NORTH; else if (ScreenPoint.y < Rect.yBottom) InstData->PrevLocation = POINT_SOUTH; return; } // Within a menu-size distance of north/south edge } // Within the horizontal boundries of the listbox /* Pointer is outside the range of interest */ return; }
/***************************************************************************** * Control: control facility for the vout *****************************************************************************/ static int Control( vout_display_t *vd, int query, va_list args ) { vout_display_sys_t *sys = vd->sys; switch (query) { case VOUT_DISPLAY_HIDE_MOUSE: { POINTL ptl; WinQueryPointerPos( HWND_DESKTOP, &ptl ); if( !sys->is_mouse_hidden && WinWindowFromPoint( HWND_DESKTOP, &ptl, TRUE ) == sys->client ) { WinShowPointer( HWND_DESKTOP, FALSE ); sys->is_mouse_hidden = true; } return VLC_SUCCESS; } case VOUT_DISPLAY_CHANGE_FULLSCREEN: { bool fs = va_arg(args, int); WinPostMsg( sys->client, WM_VLC_FULLSCREEN_CHANGE, MPFROMLONG(fs), 0 ); return VLC_SUCCESS; } case VOUT_DISPLAY_CHANGE_WINDOW_STATE: { const unsigned state = va_arg( args, unsigned ); const bool is_on_top = (state & VOUT_WINDOW_STATE_ABOVE) != 0; if( is_on_top ) WinSetWindowPos( sys->frame, HWND_TOP, 0, 0, 0, 0, SWP_ZORDER ); sys->is_on_top = is_on_top; return VLC_SUCCESS; } case VOUT_DISPLAY_CHANGE_DISPLAY_SIZE: case VOUT_DISPLAY_CHANGE_ZOOM: { const vout_display_cfg_t *cfg = va_arg(args, const vout_display_cfg_t *); WinPostMsg( sys->client, WM_VLC_SIZE_CHANGE, MPFROMLONG( cfg->display.width ), MPFROMLONG( cfg->display.height )); return VLC_SUCCESS; } case VOUT_DISPLAY_CHANGE_SOURCE_ASPECT: case VOUT_DISPLAY_CHANGE_SOURCE_CROP: { if( query == VOUT_DISPLAY_CHANGE_SOURCE_ASPECT ) { vout_display_place_t place; vout_display_PlacePicture(&place, &vd->source, vd->cfg, false); sys->kvas.ulAspectWidth = place.width; sys->kvas.ulAspectHeight = place.height; } else { video_format_t src_rot; video_format_ApplyRotation(&src_rot, &vd->source); sys->kvas.rclSrcRect.xLeft = src_rot.i_x_offset; sys->kvas.rclSrcRect.yTop = src_rot.i_y_offset; sys->kvas.rclSrcRect.xRight = src_rot.i_x_offset + src_rot.i_visible_width; sys->kvas.rclSrcRect.yBottom = src_rot.i_y_offset + src_rot.i_visible_height; } kvaSetup( &sys->kvas ); return VLC_SUCCESS; } case VOUT_DISPLAY_RESET_PICTURES: case VOUT_DISPLAY_CHANGE_DISPLAY_FILLED: /* TODO */ break; } msg_Err(vd, "Unsupported query(=%d) in vout display KVA", query); return VLC_EGENERIC; }