Browse Source

Enabled some code that was disabled for mingw, but which will work with the latest version.

tags/2021-05-28
jules 13 years ago
parent
commit
3a9cad8f2c
7 changed files with 57 additions and 73 deletions
  1. +2
    -4
      extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp
  2. +0
    -1
      modules/juce_core/native/juce_BasicNativeHeaders.h
  3. +0
    -15
      modules/juce_core/native/juce_win32_ComSmartPtr.h
  4. +10
    -11
      modules/juce_core/native/juce_win32_Files.cpp
  5. +0
    -4
      modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp
  6. +4
    -1
      modules/juce_gui_basics/components/juce_Component.h
  7. +41
    -37
      modules/juce_gui_basics/widgets/juce_ListBox.cpp

+ 2
- 4
extras/Introjucer/Source/Utility/jucer_FileHelpers.cpp View File

@@ -198,10 +198,8 @@ namespace FileHelpers
return toks.joinIntoString ("/");
}
else
{
return p;
}
return p;
}
String simplifyPath (const String& path)


+ 0
- 1
modules/juce_core/native/juce_BasicNativeHeaders.h View File

@@ -126,7 +126,6 @@
#if JUCE_MSVC && ! JUCE_DONT_AUTOLINK_TO_WIN32_LIBRARIES
#pragma comment (lib, "kernel32.lib")
#pragma comment (lib, "user32.lib")
#pragma comment (lib, "shell32.lib")
#pragma comment (lib, "wininet.lib")
#pragma comment (lib, "advapi32.lib")
#pragma comment (lib, "ws2_32.lib")


+ 0
- 15
modules/juce_core/native/juce_win32_ComSmartPtr.h View File

@@ -63,12 +63,7 @@ public:
HRESULT CoCreateInstance (REFCLSID classUUID, DWORD dwClsContext = CLSCTX_INPROC_SERVER)
{
#if ! JUCE_MINGW
return ::CoCreateInstance (classUUID, 0, dwClsContext, __uuidof (ComClass), (void**) resetAndGetPointerAddress());
#else
jassertfalse; // need to find a mingw equivalent of __uuidof to make this possible
return E_NOTIMPL;
#endif
}
template <class OtherComClass>
@@ -83,12 +78,7 @@ public:
template <class OtherComClass>
HRESULT QueryInterface (ComSmartPtr<OtherComClass>& destObject) const
{
#if ! JUCE_MINGW
return this->QueryInterface (__uuidof (OtherComClass), destObject);
#else
jassertfalse; // need to find a mingw equivalent of __uuidof to make this possible
return E_NOTIMPL;
#endif
}
private:
@@ -130,12 +120,7 @@ public:
JUCE_COMRESULT QueryInterface (REFIID refId, void** result)
{
#if ! JUCE_MINGW
if (refId == __uuidof (ComClass)) { this->AddRef(); *result = dynamic_cast <ComClass*> (this); return S_OK; }
#else
jassertfalse; // need to find a mingw equivalent of __uuidof to make this possible
#endif
if (refId == IID_IUnknown) { this->AddRef(); *result = dynamic_cast <IUnknown*> (this); return S_OK; }
*result = 0;


+ 10
- 11
modules/juce_core/native/juce_win32_Files.cpp View File

@@ -711,20 +711,19 @@ bool Process::openDocument (const String& fileName, const String& parameters)
void File::revealToUser() const
{
#if JUCE_MINGW
jassertfalse; // not supported in MinGW..
#else
#pragma warning (push)
#pragma warning (disable: 4090) // (alignment warning)
ITEMIDLIST* const itemIDList = ILCreateFromPath (fullPath.toWideCharPointer());
#pragma warning (pop)
DynamicLibrary dll ("Shell32.dll");
JUCE_LOAD_WINAPI_FUNCTION (dll, ILCreateFromPathW, ilCreateFromPathW, ITEMIDLIST*, (LPCWSTR))
JUCE_LOAD_WINAPI_FUNCTION (dll, ILFree, ilFree, void, (ITEMIDLIST*))
JUCE_LOAD_WINAPI_FUNCTION (dll, SHOpenFolderAndSelectItems, shOpenFolderAndSelectItems, HRESULT, (ITEMIDLIST*, UINT, void*, DWORD))
if (itemIDList != nullptr)
if (ilCreateFromPathW != nullptr && shOpenFolderAndSelectItems != nullptr && ilFree != nullptr)
{
SHOpenFolderAndSelectItems (itemIDList, 0, nullptr, 0);
ILFree (itemIDList);
if (ITEMIDLIST* const itemIDList = ilCreateFromPathW (fullPath.toWideCharPointer()))
{
shOpenFolderAndSelectItems (itemIDList, 0, nullptr, 0);
ilFree (itemIDList);
}
}
#endif
}
//==============================================================================


+ 0
- 4
modules/juce_graphics/native/juce_win32_DirectWriteTypeLayout.cpp View File

@@ -40,11 +40,7 @@ namespace DirectWriteTypeLayout
JUCE_COMRESULT QueryInterface (REFIID refId, void** result)
{
#if ! JUCE_MINGW
if (refId == __uuidof (IDWritePixelSnapping)) { AddRef(); *result = dynamic_cast <IDWritePixelSnapping*> (this); return S_OK; }
#else
jassertfalse; // need to find a mingw equivalent of __uuidof to make this possible
#endif
return ComBaseClassHelper<IDWriteTextRenderer>::QueryInterface (refId, result);
}


+ 4
- 1
modules/juce_gui_basics/components/juce_Component.h View File

@@ -1547,7 +1547,10 @@ public:
If not overridden, a component will forward this message to its parent, so
that parent components can collect mouse-wheel messages that happen to
child components which aren't interested in them.
child components which aren't interested in them. (Bear in mind that if
you attach a component as a mouse-listener to other components, then
those wheel moves will also end up calling this method and being passed up
to the parents, which may not be what you intended to happen).
@param event details about the mouse event
@param wheel details about the mouse wheel movement


+ 41
- 37
modules/juce_gui_basics/widgets/juce_ListBox.cpp View File

@@ -27,30 +27,30 @@ class ListBox::RowComponent : public Component,
public TooltipClient
{
public:
RowComponent (ListBox& owner_)
: owner (owner_), row (-1),
RowComponent (ListBox& lb)
: owner (lb), row (-1),
selected (false), isDragging (false), selectRowOnMouseUp (false)
{
}
void paint (Graphics& g)
{
if (owner.getModel() != nullptr)
owner.getModel()->paintListBoxItem (row, g, getWidth(), getHeight(), selected);
if (ListBoxModel* m = owner.getModel())
m->paintListBoxItem (row, g, getWidth(), getHeight(), selected);
}
void update (const int row_, const bool selected_)
void update (const int newRow, const bool nowSelected)
{
if (row != row_ || selected != selected_)
if (row != newRow || selected != nowSelected)
{
repaint();
row = row_;
selected = selected_;
row = newRow;
selected = nowSelected;
}
if (owner.getModel() != nullptr)
if (ListBoxModel* m = owner.getModel())
{
customComponent = owner.getModel()->refreshComponentForRow (row_, selected_, customComponent.release());
customComponent = m->refreshComponentForRow (newRow, nowSelected, customComponent.release());
if (customComponent != nullptr)
{
@@ -71,8 +71,8 @@ public:
{
owner.selectRowsBasedOnModifierKeys (row, e.mods, false);
if (owner.getModel() != nullptr)
owner.getModel()->listBoxItemClicked (row, e);
if (ListBoxModel* m = owner.getModel())
m->listBoxItemClicked (row, e);
}
else
{
@@ -87,31 +87,35 @@ public:
{
owner.selectRowsBasedOnModifierKeys (row, e.mods, true);
if (owner.getModel() != nullptr)
owner.getModel()->listBoxItemClicked (row, e);
if (ListBoxModel* m = owner.getModel())
m->listBoxItemClicked (row, e);
}
}
void mouseDoubleClick (const MouseEvent& e)
{
if (owner.getModel() != nullptr && isEnabled())
owner.getModel()->listBoxItemDoubleClicked (row, e);
if (ListBoxModel* m = owner.getModel())
if (isEnabled())
m->listBoxItemDoubleClicked (row, e);
}
void mouseDrag (const MouseEvent& e)
{
if (isEnabled() && owner.getModel() != nullptr && ! (e.mouseWasClicked() || isDragging))
if (ListBoxModel* m = owner.getModel())
{
const SparseSet<int> selectedRows (owner.getSelectedRows());
if (selectedRows.size() > 0)
if (isEnabled() && ! (e.mouseWasClicked() || isDragging))
{
const var dragDescription (owner.getModel()->getDragSourceDescription (selectedRows));
const SparseSet<int> selectedRows (owner.getSelectedRows());
if (! (dragDescription.isVoid() || (dragDescription.isString() && dragDescription.toString().isEmpty())))
if (selectedRows.size() > 0)
{
isDragging = true;
owner.startDragAndDrop (e, dragDescription, true);
const var dragDescription (m->getDragSourceDescription (selectedRows));
if (! (dragDescription.isVoid() || (dragDescription.isString() && dragDescription.toString().isEmpty())))
{
isDragging = true;
owner.startDragAndDrop (e, dragDescription, true);
}
}
}
}
@@ -125,8 +129,8 @@ public:
String getTooltip()
{
if (owner.getModel() != nullptr)
return owner.getModel()->getTooltipForRow (row);
if (ListBoxModel* m = owner.getModel())
return m->getTooltipForRow (row);
return String::empty;
}
@@ -146,8 +150,8 @@ private:
class ListBox::ListViewport : public Viewport
{
public:
ListViewport (ListBox& owner_)
: owner (owner_)
ListViewport (ListBox& lb)
: owner (lb)
{
setWantsKeyboardFocus (false);
@@ -184,8 +188,8 @@ public:
{
updateVisibleArea (true);
if (owner.getModel() != nullptr)
owner.getModel()->listWasScrolled();
if (ListBoxModel* m = owner.getModel())
m->listWasScrolled();
}
void updateVisibleArea (const bool makeSureItUpdatesContent)
@@ -334,9 +338,9 @@ private:
enum { defaultListRowHeight = 22 };
//==============================================================================
ListBox::ListBox (const String& name, ListBoxModel* const model_)
ListBox::ListBox (const String& name, ListBoxModel* const m)
: Component (name),
model (model_),
model (m),
totalItems (0),
rowHeight (defaultListRowHeight),
minimumRowWidth (0),
@@ -401,7 +405,7 @@ void ListBox::paintOverChildren (Graphics& g)
void ListBox::resized()
{
viewport->setBoundsInset (BorderSize<int> (outlineThickness + ((headerComponent != nullptr) ? headerComponent->getHeight() : 0),
viewport->setBoundsInset (BorderSize<int> (outlineThickness + (headerComponent != nullptr ? headerComponent->getHeight() : 0),
outlineThickness, outlineThickness, outlineThickness));
viewport->setSingleStepSizes (20, getRowHeight());
@@ -509,7 +513,7 @@ void ListBox::setSelectedRows (const SparseSet<int>& setOfRowsToBeSelected,
viewport->updateContents();
if ((model != nullptr) && sendNotificationEventToModel == sendNotification)
if (model != nullptr && sendNotificationEventToModel == sendNotification)
model->selectedRowsChanged (lastRowSelected);
}
@@ -593,7 +597,7 @@ bool ListBox::isRowSelected (const int row) const
int ListBox::getLastRowSelected() const
{
return (isRowSelected (lastRowSelected)) ? lastRowSelected : -1;
return isRowSelected (lastRowSelected) ? lastRowSelected : -1;
}
//==============================================================================
@@ -839,9 +843,9 @@ void ListBox::colourChanged()
repaint();
}
void ListBox::setOutlineThickness (const int outlineThickness_)
void ListBox::setOutlineThickness (const int newThickness)
{
outlineThickness = outlineThickness_;
outlineThickness = newThickness;
resized();
}


Loading…
Cancel
Save