1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-31 03:00:05 +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

@ -167,8 +167,23 @@ private:
const ScopedPointer* getAddress() const throw() { return this; }
#if ! JUCE_MSVC // (MSVC can't deal with multiple copy constructors)
// This is private to stop people accidentally copying a const ScopedPointer (the compiler
// will let you do so by implicitly casting the source to its raw object pointer).
/* This is private to stop people accidentally copying a const ScopedPointer (the compiler
would let you do so by implicitly casting the source to its raw object pointer).
A side effect of this is that you may hit a puzzling compiler error when you write something
like this:
ScopedPointer<MyClass> m = new MyClass(); // Compile error: copy constructor is private.
Even though the compiler would normally ignore the assignment here, it can't do so when the
copy constructor is private. It's very easy to fis though - just write it like this:
ScopedPointer<MyClass> m (new MyClass()); // Compiles OK
It's good practice to always use the latter form when writing your object declarations anyway,
rather than writing them as assignments and assuming (or hoping) that the compiler will be
smart enough to replace your construction + assignment with a single constructor.
*/
ScopedPointer (const ScopedPointer&);
#endif
};

View file

@ -507,8 +507,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();
}
}
}

View file

@ -62,25 +62,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,
@ -89,6 +70,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);

View file

@ -246,7 +246,6 @@ public:
ValueTree getMarkerListCreating (bool xAxis, UndoManager* undoManager);
};
private:
//==============================================================================
RelativeParallelogram bounds;

View file

@ -43,8 +43,6 @@ BEGIN_JUCE_NAMESPACE
//==============================================================================
// internal helper object that holds the zlib structures so they don't have to be
// included publicly.
class GZIPCompressorOutputStream::GZIPCompressorHelper
{
public:
@ -130,7 +128,6 @@ public:
bool finished, shouldFinish;
};
//==============================================================================
GZIPCompressorOutputStream::GZIPCompressorOutputStream (OutputStream* const destStream_,
int compressionLevel,
@ -184,11 +181,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()

View file

@ -185,10 +185,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;
}

View file

@ -1504,12 +1504,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;

View file

@ -1850,8 +1850,6 @@ private:
{
}
~JuceDropTarget() {}
HRESULT __stdcall DragEnter (IDataObject* pDataObject, DWORD /*grfKeyState*/, POINTL mousePos, DWORD* pdwEffect)
{
updateFileList (pDataObject);