Skip to content
Snippets Groups Projects
Select Git revision
  • fa375724479c68f289413d1b1426bd816420f8fa
  • master default protected
2 results

MacWindow.hpp

Blame
  • MacWindow.hpp 2.19 KiB
    /***************************************************************************
     *  MacWindow.hpp
     *  Part of 
     *  2016-  Florent Berthaut
     *  hitmuri.net
     ****************************************************************************/
    /*
     *  This program is free software; you can redistribute it and/or modify
     *  it under the terms of the GNU General Public License as published by
     *  the Free Software Foundation; either version 2 of the License, or
     *  (at your option) any later version.
     *
     *  This program is distributed in the hope that it will be useful,
     *  but WITHOUT ANY WARRANTY; without even the implied warranty of
     *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
     *  GNU General Public License for more details.
     *
     *  You should have received a copy of the GNU General Public License
     *  along with this program; if not, write to the Free Software
     *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
     */
    
    
    #ifndef MacWindow_h
    #define MacWindow_h
    
    #include <vector>
    #include <string>
    
    #include "../CutWindow.hpp"
    #import <ApplicationServices/ApplicationServices.h>
    //#import <Cocoa/Cocoa.h>
    //#import <QuartzCore/QuartzCore.h>
    //#import <AppKit/AppKit.h>
    
    class MacWindow: public CutWindow {
        public :
            MacWindow(CutWindowsManager* man, CGWindowID winID);
            virtual ~MacWindow();
            virtual void getPixels(const int& x, const int& y, 
                                   const int& sx, const int& sy,
                                   const std::vector<int>& srcIndices,
                                   const std::vector<std::vector<int> >& srcCoords,
                                   const std::vector<int>& destIndices,
                                   const uchar& alpha,
                                   const ZoneWidget::ZONE_COLOR& color,
                                   uchar* destImg);
            int computeNbPixPerRow(const int& srcW, const int& srcH);
            virtual uchar* grabImage();
            virtual void releaseImage();
            virtual void storeImage(const int& id);
            virtual uchar* retrieveImage(const int& id);
    
        protected:
            CGWindowID m_idCArray[1];
            CFArrayRef m_idArray;
            CGImageRef m_img;
            CFDataRef m_data;
    };
    
    #endif