~unity-team/nux/nux.redirected-views

« back to all changes in this revision

Viewing changes to Nux/Coverflow.cpp

  • Committer: Tarmac
  • Author(s): Michi Henning
  • Date: 2012-10-02 01:05:45 UTC
  • mfrom: (667.2.5 1056633)
  • Revision ID: tarmac-20121002010545-jphizk30nj3oe9ui
Added -Wextra to compiler flags and removed a large number of warnings about unused parameters. Code compiles clean now without warnings, except for one remaining warning (see bug #1052765).. Fixes: https://bugs.launchpad.net/bugs/1056633. Approved by Michi Henning.

Show diffs side-by-side

added added

removed removed

Lines of Context:
444
444
    return false;
445
445
  }
446
446
 
447
 
  bool Coverflow::Impl::CoverAtPoint(int x, int y, Cover& out_cover)
 
447
  bool Coverflow::Impl::CoverAtPoint(int /* x */, int /* y */, Cover& out_cover)
448
448
  {
449
449
    Cover best;
450
450
 
481
481
    return false;
482
482
  }
483
483
 
484
 
  void Coverflow::Impl::HandleKeyDown(unsigned long   eventType  , /*event type*/
 
484
  void Coverflow::Impl::HandleKeyDown(unsigned long   /* eventType */  , /*event type*/
485
485
                                  unsigned long   keysym     , /*event keysym*/
486
 
                                  unsigned long   state      , /*event state*/
487
 
                                  const char*     character  , /*character*/
488
 
                                  unsigned short  keyCount     /*key repeat count*/)
 
486
                                  unsigned long   /* state */      , /*event state*/
 
487
                                  const char*     /* character */  , /*character*/
 
488
                                  unsigned short  /* keyCount */     /*key repeat count*/)
489
489
  {
490
490
    switch (keysym)
491
491
    {
499
499
    }
500
500
  }
501
501
 
502
 
  void Coverflow::Impl::HandleMouseClick(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
502
  void Coverflow::Impl::HandleMouseClick(int x, int y, unsigned long button_flags, unsigned long /* key_flags */)
503
503
  {
504
504
    if (std::abs(mouse_down_position_.x - x) > 10 || std::abs(mouse_down_position_.y - y) > 10)
505
505
      return;
520
520
  }
521
521
 
522
522
  void Coverflow::Impl::HandleKeyUp(unsigned int keysym,
523
 
                                  unsigned long x11_key_code,
524
 
                                  unsigned long special_keys_state)
 
523
                                  unsigned long /* x11_key_code */,
 
524
                                  unsigned long /* special_keys_state */)
525
525
  {
526
526
    switch (keysym)
527
527
    {
538
538
    }
539
539
  }
540
540
 
541
 
  void Coverflow::Impl::HandleMouseMove(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
 
541
  void Coverflow::Impl::HandleMouseMove(int x, int y, int /* dx */, int /* dy */, unsigned long /* button_flags */, unsigned long /* key_flags */)
542
542
  {
543
543
    mouse_position_.x = x;
544
544
    mouse_position_.y = y;
545
545
    MaybeQueueDraw();
546
546
  }
547
547
 
548
 
  void Coverflow::Impl::HandleMouseEnter(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
548
  void Coverflow::Impl::HandleMouseEnter(int x, int y, unsigned long /* button_flags */, unsigned long /* key_flags */)
549
549
  {
550
550
    mouse_position_.x = x;
551
551
    mouse_position_.y = y;
553
553
    MaybeQueueDraw();
554
554
  }
555
555
 
556
 
  void Coverflow::Impl::HandleMouseLeave(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
556
  void Coverflow::Impl::HandleMouseLeave(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
557
557
  {
558
558
    mouse_position_.x = 0xFFFFFFFF;
559
559
    mouse_position_.y = 0xFFFFFFFF;
561
561
    MaybeQueueDraw();
562
562
  }
563
563
 
564
 
  void Coverflow::Impl::HandleMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
564
  void Coverflow::Impl::HandleMouseDown(int x, int y, unsigned long /* button_flags */, unsigned long /* key_flags */)
565
565
  {
566
566
    velocity_ = 0; // stop an current velocity based animations
567
567
    mouse_down_position_.x = x;
598
598
    return result;
599
599
  }
600
600
 
601
 
  void Coverflow::Impl::HandleMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
601
  void Coverflow::Impl::HandleMouseUp(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
602
602
  {
603
603
    MaybeQueueDraw();
604
604
    velocity_ = GetCurrentVelocity(32);
614
614
    }
615
615
  }
616
616
 
617
 
  void Coverflow::Impl::HandleMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
 
617
  void Coverflow::Impl::HandleMouseDrag(int /* x */, int /* y */, int dx, int /* dy */, unsigned long /* button_flags */, unsigned long /* key_flags */)
618
618
  {
619
619
    nux::Point2 top_left, bottom_right;
620
620
    Get3DBoundingBox(camera_position_.z, top_left, bottom_right);
624
624
    SetPosition(position_ - (dx * scalar * parent_->mouse_drag_rate), false);
625
625
  }
626
626
 
627
 
  void Coverflow::Impl::HandleMouseWheel(int x, int y, int wheel_delta, unsigned long button_flags, unsigned long key_flags)
 
627
  void Coverflow::Impl::HandleMouseWheel(int /* x */, int /* y */, int /* wheel_delta */, unsigned long /* button_flags */, unsigned long /* key_flags */)
628
628
  {
629
629
    // do nothing yet
630
630
  }
631
631
 
632
 
  void Coverflow::Impl::HandleGeometryChange(Area* area, Geometry geo)
 
632
  void Coverflow::Impl::HandleGeometryChange(Area* /* area */, Geometry /* geo */)
633
633
  {
634
634
  }
635
635
 
636
 
  CoverList Coverflow::Impl::GetCoverList(float animation_progress, gint64 timestep)
 
636
  CoverList Coverflow::Impl::GetCoverList(float animation_progress, gint64 /* timestep */)
637
637
  {
638
638
    CoverList results;
639
639
 
729
729
    MaybeQueueDraw();
730
730
  }
731
731
 
732
 
  void Coverflow::Impl::OnItemAdded(CoverflowModel* owner, CoverflowItem::Ptr new_item)
733
 
  {
734
 
    SetPosition(position_, true);
735
 
    MaybeQueueDraw();
736
 
  }
737
 
 
738
 
  void Coverflow::Impl::OnItemRemoved(CoverflowModel* owner, CoverflowItem::Ptr old_item)
739
 
  {
740
 
    SetPosition(position_, true);
741
 
    MaybeQueueDraw();
742
 
  }
743
 
 
744
 
  void Coverflow::Impl::OnSelectionChanged(CoverflowModel* owner, CoverflowItem::Ptr selection)
 
732
  void Coverflow::Impl::OnItemAdded(CoverflowModel* /* owner */, CoverflowItem::Ptr /* new_item */)
 
733
  {
 
734
    SetPosition(position_, true);
 
735
    MaybeQueueDraw();
 
736
  }
 
737
 
 
738
  void Coverflow::Impl::OnItemRemoved(CoverflowModel* /* owner */, CoverflowItem::Ptr /* old_item */)
 
739
  {
 
740
    SetPosition(position_, true);
 
741
    MaybeQueueDraw();
 
742
  }
 
743
 
 
744
  void Coverflow::Impl::OnSelectionChanged(CoverflowModel* /* owner */, CoverflowItem::Ptr /* selection */)
745
745
  {
746
746
    size_t selection_index = parent_->model()->SelectionIndex();
747
747
 
1073
1073
    pimpl->MaybeQueueDraw();
1074
1074
  }
1075
1075
 
1076
 
  bool Coverflow::InspectKeyEvent(unsigned int eventType, unsigned int keysym, const char* character)
 
1076
  bool Coverflow::InspectKeyEvent(unsigned int /* eventType */, unsigned int /* keysym */, const char* /* character */)
1077
1077
  {
1078
1078
    return true;
1079
1079
  }
1080
1080
 
1081
 
  void Coverflow::ClientDraw(nux::GraphicsEngine& graphics_engine, nux::DrawAreaContext &ctx, bool force_draw)
 
1081
  void Coverflow::ClientDraw(nux::GraphicsEngine& graphics_engine, nux::DrawAreaContext &ctx, bool /* force_draw */)
1082
1082
  {
1083
1083
    gint64 current_time = g_get_monotonic_time();
1084
1084
    float animation_progress = std::min<float>(1.0f, (current_time - pimpl->position_set_time_) / static_cast<float>(animation_length() * 1000));