Source: midimountain/mvcMainView.h


Annotated List
Files
Globals
Hierarchy
Index
//=============================================================================
//  model view control main view
//=============================================================================
// Author  : Adrian Meyer
// Version : 0.2.1
// Log     :
//=============================================================================
// 11.04.2000 building class
// 05.09.2000 calculationg the window size with zoom
// 06.09.2000 drawing routines for grid and test with events
//            :) :) :) :) :) :) :) :) :) :) :) :) :) :) it WORKS!!!!!
// 08.09.2000 Adding header to main view
// 10.09.2000 adding selection events
// 11.09.2000 removing flickering with double buffer
//============================================================================
// to do   :
//=============================================================================
#include <gtk/gtk.h>
#include <gdk/gdk.h>
#include <stdio.h>

#include "glade_interface.h"
#include "glade_support.h"

#include <mvcBase.h>
#include <mvcHeader.h>
#include <mcSequence.h>


class TMvcMainView: public TMvcBase
{
  private:
    GtkWidget* fWidget;                               // main widget
    TMidiSequence* fSequence;                         // last displayed sequence
    TMvcHeader* fHeader;                              // header of view

    int fWidth;                                       // width of drawing area
    int fHeight;                                      // height of drawing area
    int fWindowWidth;                                 // width of window

    float fTicksPerPix;                               // midi ticks per pixel on screen
    long fMeasureCount;                               // measure count for x-axis
    bool fSelectionActive;                            // selection in progress

    GdkColor* colBackground;                          // background color
    GdkColor* colGrid;                                // color of grid
    GdkColor* colSubGrid;                             // color of subgrid
    GdkColor* colMidi;                                // midi event color
    GdkColor* colSelection;                           // selection color

    GdkPixmap* fBufferMainView;                       // pixmap buffer for main view

                                                      // read offset on grid
    long GetOffsetOnGrid( long aOffset, bool aRoundDown );
  public:
                                                      // constructor
    TMvcMainView( GtkWidget* aWidget, TMidiSequence* aSequence );
    GtkWidget* GetWidget( void );                     // read widget

    void Resize( void );                              // set new with and height
                                                      // draw in main area
    bool MainViewExpose( GtkWidget* aWidget, GdkEventExpose* aEvent );
                                                      // draw header area
    void MCMessage( TMidiBase* aMidiBase, sMCMessage* aMCMessage );                                                

    void MouseDown( long x );                         // mouse events
    void MouseUp( long x );
    void MouseMove( long x );

};

Generated by: root@castle on Fri Jul 20 00:33:17 2001, using kdoc 2.0a36.