1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-02-08 04:20:09 +00:00

Fixed a linux time issue. Removed a blank line from the jucer's .sln file generator. Cleaned up some jucer code.

This commit is contained in:
Julian Storer 2010-11-30 19:23:37 +00:00
parent 952b8c3940
commit 4e52fac18e
24 changed files with 165 additions and 261 deletions

View file

@ -77609,8 +77609,31 @@ void ComponentPeer::handleFileDragDrop (const StringArray& files, const Point<in
return;
}
const Point<int> pos (targetComp->getLocalPoint (component, position));
target->filesDropped (files, pos.getX(), pos.getY());
// We'll use an async message to deliver the drop, because if the target decides
// to run a modal loop, it can gum-up the operating system..
class AsyncFileDropMessage : public CallbackMessage
{
public:
AsyncFileDropMessage (Component* target_, const Point<int>& position_, const StringArray& files_)
: target (target_), position (position_), files (files_)
{
}
void messageCallback()
{
if (target != 0)
target->filesDropped (files, position.getX(), position.getY());
}
private:
Component::SafePointer<Component> target;
Point<int> position;
StringArray files;
JUCE_DECLARE_NON_COPYABLE (AsyncFileDropMessage);
};
(new AsyncFileDropMessage (targetComp, targetComp->getLocalPoint (component, position), files))->post();
}
}
}
@ -77681,25 +77704,6 @@ void DialogWindow::resized()
}
}
class TempDialogWindow : public DialogWindow
{
public:
TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses)
: DialogWindow (title, colour, escapeCloses, true)
{
if (! JUCEApplication::isStandaloneApp())
setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level
}
void closeButtonPressed()
{
setVisible (false);
}
private:
JUCE_DECLARE_NON_COPYABLE (TempDialogWindow);
};
int DialogWindow::showModalDialog (const String& dialogTitle,
Component* contentComponent,
Component* componentToCentreAround,
@ -77708,6 +77712,25 @@ int DialogWindow::showModalDialog (const String& dialogTitle,
const bool shouldBeResizable,
const bool useBottomRightCornerResizer)
{
class TempDialogWindow : public DialogWindow
{
public:
TempDialogWindow (const String& title, const Colour& colour, const bool escapeCloses)
: DialogWindow (title, colour, escapeCloses, true)
{
if (! JUCEApplication::isStandaloneApp())
setAlwaysOnTop (true); // for a plugin, make it always-on-top because the host windows are often top-level
}
void closeButtonPressed()
{
setVisible (false);
}
private:
JUCE_DECLARE_NON_COPYABLE (TempDialogWindow);
};
TempDialogWindow dw (dialogTitle, colour, escapeKeyTriggersCloseButton);
dw.setContentComponent (contentComponent, true, true);
@ -97999,8 +98022,6 @@ ZEXTERN const uLongf * ZEXPORT get_crc_table OF((void));
BEGIN_JUCE_NAMESPACE
// internal helper object that holds the zlib structures so they don't have to be
// included publicly.
class GZIPCompressorOutputStream::GZIPCompressorHelper
{
public:
@ -98137,11 +98158,7 @@ bool GZIPCompressorOutputStream::write (const void* destBuffer, int howMany)
bool GZIPCompressorOutputStream::doNextBlock()
{
const int len = helper->doNextBlock (buffer, (int) GZIPCompressorHelper::gzipCompBufferSize);
if (len > 0)
return destStream->write (buffer, len);
else
return true;
return len <= 0 || destStream->write (buffer, len);
}
int64 GZIPCompressorOutputStream::getPosition()
@ -242963,8 +242980,6 @@ private:
{
}
~JuceDropTarget() {}
HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect)
{
updateFileList (pDataObject);
@ -256089,10 +256104,10 @@ double Time::getMillisecondCounterHiRes() throw()
bool Time::setSystemTimeToThisTime() const
{
timeval t;
t.tv_sec = millisSinceEpoch % 1000000;
t.tv_usec = millisSinceEpoch - t.tv_sec;
t.tv_sec = millisSinceEpoch / 1000;
t.tv_usec = (millisSinceEpoch - t.tv_sec * 1000) * 1000;
return settimeofday (&t, 0) ? false : true;
return settimeofday (&t, 0) == 0;
}
#endif
@ -273227,12 +273242,12 @@ BOOL NSViewComponentPeer::sendDragCallback (int type, id <NSDraggingInfo> sender
NSPoint p = [view convertPoint: [sender draggingLocation] fromView: nil];
const Point<int> pos ((int) p.x, (int) ([view frame].size.height - p.y));
StringArray files;
id list = [[sender draggingPasteboard] propertyListForType: bestType];
if (list == nil)
return false;
StringArray files;
if ([list isKindOfClass: [NSArray class]])
{
NSArray* items = (NSArray*) list;