| 7978 | } |
| 7979 | |
| 7980 | bool ImGui::IsWindowHovered(ImGuiHoveredFlags flags) |
| 7981 | { |
| 7982 | IM_ASSERT((flags & (ImGuiHoveredFlags_AllowWhenOverlapped | ImGuiHoveredFlags_AllowWhenDisabled)) == 0); // Flags not supported by this function |
| 7983 | ImGuiContext& g = *GImGui; |
| 7984 | ImGuiWindow* ref_window = g.HoveredWindow; |
| 7985 | ImGuiWindow* cur_window = g.CurrentWindow; |
| 7986 | if (ref_window == NULL) |
| 7987 | return false; |
| 7988 | |
| 7989 | if ((flags & ImGuiHoveredFlags_AnyWindow) == 0) |
| 7990 | { |
| 7991 | IM_ASSERT(cur_window); // Not inside a Begin()/End() |
| 7992 | const bool popup_hierarchy = (flags & ImGuiHoveredFlags_NoPopupHierarchy) == 0; |
| 7993 | const bool dock_hierarchy = (flags & ImGuiHoveredFlags_DockHierarchy) != 0; |
| 7994 | if (flags & ImGuiHoveredFlags_RootWindow) |
| 7995 | cur_window = GetCombinedRootWindow(cur_window, popup_hierarchy, dock_hierarchy); |
| 7996 | |
| 7997 | bool result; |
| 7998 | if (flags & ImGuiHoveredFlags_ChildWindows) |
| 7999 | result = IsWindowChildOf(ref_window, cur_window, popup_hierarchy, dock_hierarchy); |
| 8000 | else |
| 8001 | result = (ref_window == cur_window); |
| 8002 | if (!result) |
| 8003 | return false; |
| 8004 | } |
| 8005 | |
| 8006 | if (!IsWindowContentHoverable(ref_window, flags)) |
| 8007 | return false; |
| 8008 | if (!(flags & ImGuiHoveredFlags_AllowWhenBlockedByActiveItem)) |
| 8009 | if (g.ActiveId != 0 && !g.ActiveIdAllowOverlap && g.ActiveId != ref_window->MoveId) |
| 8010 | return false; |
| 8011 | return true; |
| 8012 | } |
| 8013 | |
| 8014 | bool ImGui::IsWindowFocused(ImGuiFocusedFlags flags) |
| 8015 | { |
nothing calls this directly
no test coverage detected