Ignore:
Timestamp:
Aug 22, 2010, 7:52:12 PM (10 years ago)
Author:
sam
Message:

Store the frame number in the Ticker instead of duplicating the information
in each class that uses it.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/gtk/glmapview.cpp

    r166 r167  
    119119}
    120120
    121 gboolean GlMapView::Draw(GdkEventExpose *event)
    122 {
    123     if (event->count > 0)
     121gboolean GlMapView::Draw(GdkEventExpose *e)
     122{
     123    if (e->count > 0)
    124124        return TRUE;
    125125
     
    187187}
    188188
    189 gboolean GlMapView::MouseButton(GdkEventButton *event)
    190 {
    191     if (event->type == GDK_BUTTON_PRESS && event->button == 2)
     189gboolean GlMapView::MouseButton(GdkEventButton *e)
     190{
     191    if (e->type == GDK_BUTTON_PRESS && e->button == 2)
    192192    {
    193193        panning = TRUE;
    194         xpan = event->x;
    195         ypan = event->y;
     194        xpan = e->x;
     195        ypan = e->y;
    196196        GdkCursor *cursor = gdk_cursor_new(GDK_HAND1);
    197197        gdk_window_set_cursor(glarea->window, cursor);
     
    199199        return FALSE;
    200200    }
    201     else if (event->type == GDK_BUTTON_RELEASE && event->button == 2)
     201    else if (e->type == GDK_BUTTON_RELEASE && e->button == 2)
    202202    {
    203203        panning = FALSE;
     
    209209}
    210210
    211 gboolean GlMapView::MouseMotion(GdkEventMotion *event)
     211gboolean GlMapView::MouseMotion(GdkEventMotion *e)
    212212{
    213213    if (panning)
    214214    {
    215         if (event->x != xpan)
     215        if (e->x != xpan)
    216216        {
    217217            double val = gtk_adjustment_get_value(hadj);
    218218            int map_width = mapviewer->GetWidth();
    219             val += xpan - event->x;
    220             xpan = event->x;
     219            val += xpan - e->x;
     220            xpan = e->x;
    221221            if (val + glarea->allocation.width > map_width)
    222222                val = map_width - glarea->allocation.width;
     
    225225        }
    226226
    227         if (event->y != ypan)
     227        if (e->y != ypan)
    228228        {
    229229            double val = gtk_adjustment_get_value(vadj);
    230230            int map_height = mapviewer->GetHeight();
    231             val += ypan - event->y;
    232             ypan = event->y;
     231            val += ypan - e->y;
     232            ypan = e->y;
    233233            if (val + glarea->allocation.height > map_height)
    234234                val = map_height - glarea->allocation.height;
     
    241241}
    242242
    243 gboolean GlMapView::KeyPress(GdkEventKey *event)
    244 {
    245     switch (event->keyval)
     243gboolean GlMapView::KeyPress(GdkEventKey *e)
     244{
     245    switch (e->keyval)
    246246    {
    247247    case GDK_Up:    MoveAdjustments(  0.0, -10.0); break;
     
    273273}
    274274
    275 gboolean GlMapView::DrawSignal(GtkWidget *w, GdkEventExpose *event,
     275gboolean GlMapView::DrawSignal(GtkWidget *w, GdkEventExpose *e,
    276276                               GlMapView *that)
    277277{
    278278    (void)w;
    279     return that->Draw(event);
    280 }
    281 
    282 gboolean GlMapView::ReshapeSignal(GtkWidget *w, GdkEventConfigure *event,
     279    return that->Draw(e);
     280}
     281
     282gboolean GlMapView::ReshapeSignal(GtkWidget *w, GdkEventConfigure *e,
    283283                                  GlMapView *that)
    284284{
    285285    (void)w;
    286     (void)event;
     286    (void)e;
    287287    return that->Setup();
    288288}
    289289
    290 gboolean GlMapView::MouseButtonSignal(GtkWidget *w, GdkEventButton *event,
     290gboolean GlMapView::MouseButtonSignal(GtkWidget *w, GdkEventButton *e,
    291291                                      GlMapView *that)
    292292{
    293293    (void)w;
    294     return that->MouseButton(event);
    295 }
    296 
    297 gboolean GlMapView::MouseMotionSignal(GtkWidget *w, GdkEventMotion *event,
     294    return that->MouseButton(e);
     295}
     296
     297gboolean GlMapView::MouseMotionSignal(GtkWidget *w, GdkEventMotion *e,
    298298                                      GlMapView *that)
    299299{
    300300    (void)w;
    301     return that->MouseMotion(event);
    302 }
    303 
    304 gboolean GlMapView::KeyPressSignal(GtkWidget *w, GdkEventKey *event,
     301    return that->MouseMotion(e);
     302}
     303
     304gboolean GlMapView::KeyPressSignal(GtkWidget *w, GdkEventKey *e,
    305305                                   GlMapView *that)
    306306{
    307307    (void)w;
    308     return that->KeyPress(event);
    309 }
    310 
     308    return that->KeyPress(e);
     309}
     310
Note: See TracChangeset for help on using the changeset viewer.