Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #pragma once
00025
00026 #include "cinder/Cinder.h"
00027 #include "cinder/app/Event.h"
00028 #include "cinder/Filesystem.h"
00029
00030 #include <vector>
00031 #include <string>
00032
00033 namespace cinder { namespace app {
00034
00036 class FileDropEvent : public Event {
00037 public:
00038 FileDropEvent( WindowRef win, int aX, int aY, const std::vector<fs::path> &aFiles )
00039 : Event( win ), mX( aX ), mY( aY ), mFiles( aFiles )
00040 {}
00041
00043 int getX() const { return mX; }
00045 int getY() const { return mY; }
00047 Vec2i getPos() const { return Vec2i( mX, mY ); }
00048
00050 const std::vector<fs::path>& getFiles() const { return mFiles; }
00052 size_t getNumFiles() const { return mFiles.size(); }
00054 const fs::path& getFile( size_t index ) const { return mFiles.at(index); }
00055
00056 private:
00057 int mX, mY;
00058 std::vector<fs::path> mFiles;
00059 };
00060
00061 inline std::ostream& operator<<( std::ostream &out, const FileDropEvent &event )
00062 {
00063 out << event.getPos() << ": ";
00064 out << "{" << std::endl;
00065 for( std::vector<fs::path>::const_iterator fIt = event.getFiles().begin(); fIt != event.getFiles().end(); ++fIt )
00066 out << " " << *fIt << std::endl;
00067 out << "}";
00068 return out;
00069 }
00070
00071 } }