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

« back to all changes in this revision

Viewing changes to Nux/HScrollBar.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:
151
151
    }
152
152
  }
153
153
 
154
 
  void HScrollBar::ScrollRight(void *v)
 
154
  void HScrollBar::ScrollRight(void * /* v */)
155
155
  {
156
156
    OnScrollRight.emit(m_ScrollUnit, 1);
157
157
 
163
163
    QueueDraw();
164
164
  }
165
165
 
166
 
  void HScrollBar::ScrollLeft(void *v)
 
166
  void HScrollBar::ScrollLeft(void * /* v */)
167
167
  {
168
168
    OnScrollLeft.emit(m_ScrollUnit, 1);
169
169
 
175
175
    QueueDraw();
176
176
  }
177
177
 
178
 
  void HScrollBar::TrackLeft(void *v)
 
178
  void HScrollBar::TrackLeft(void * /* v */)
179
179
  {
180
180
    if (m_TrackMouseCoord.x < _slider->GetBaseX() - _track->GetBaseX())
181
181
    {
185
185
    }
186
186
  }
187
187
 
188
 
  void HScrollBar::TrackRight(void *v)
 
188
  void HScrollBar::TrackRight(void * /* v */)
189
189
  {
190
190
    if (m_TrackMouseCoord.x > _slider->GetBaseX() + _slider->GetBaseWidth() - _track->GetBaseX())
191
191
    {
195
195
    }
196
196
  }
197
197
 
198
 
  void HScrollBar::RecvStartScrollLeft(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
198
  void HScrollBar::RecvStartScrollLeft(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
199
199
  {
200
200
    if (!AtMinimum())
201
201
      ScrollLeft(this);
202
202
  }
203
203
 
204
 
  void HScrollBar::RecvStartScrollRight(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
204
  void HScrollBar::RecvStartScrollRight(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
205
205
  {
206
206
    if (!AtMaximum())
207
207
      ScrollRight(this);
208
208
  }
209
209
 
210
 
  void HScrollBar::RecvEndScrollRight(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
210
  void HScrollBar::RecvEndScrollRight(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
211
211
  {
212
212
    if (m_RightTimerHandler.IsValid())
213
213
      GetTimer().RemoveTimerHandler(m_RightTimerHandler);
215
215
    m_RightTimerHandler = 0;
216
216
  }
217
217
 
218
 
  void HScrollBar::RecvEndScrollLeft(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
218
  void HScrollBar::RecvEndScrollLeft(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
219
219
  {
220
220
    if (m_LeftTimerHandler.IsValid())
221
221
      GetTimer().RemoveTimerHandler(m_LeftTimerHandler);
223
223
    m_LeftTimerHandler = 0;
224
224
  }
225
225
 
226
 
  void HScrollBar::RecvTrackMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
226
  void HScrollBar::RecvTrackMouseDown(int x, int y, unsigned long /* button_flags */, unsigned long /* key_flags */)
227
227
  {
228
228
    m_TrackMouseCoord = Point(x, y);
229
229
 
241
241
    }
242
242
  }
243
243
 
244
 
  void HScrollBar::RecvTrackMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
244
  void HScrollBar::RecvTrackMouseUp(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
245
245
  {
246
246
    if (m_TrackLeftTimerHandler.IsValid())
247
247
      GetTimer().RemoveTimerHandler(m_TrackLeftTimerHandler);
253
253
    m_TrackRightTimerHandler = 0;
254
254
  }
255
255
 
256
 
  void HScrollBar::RecvTrackMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
 
256
  void HScrollBar::RecvTrackMouseDrag(int /* x */, int /* y */, int /* dx */, int /* dy */, unsigned long /* button_flags */, unsigned long /* key_flags */)
257
257
  {
258
258
 
259
259
  }
275
275
    return this;
276
276
  }
277
277
 
278
 
  void HScrollBar::Draw(GraphicsEngine &graphics_engine, bool force_draw)
 
278
  void HScrollBar::Draw(GraphicsEngine &graphics_engine, bool /* force_draw */)
279
279
  {
280
280
    Geometry base = GetGeometry();
281
281
    GetPainter().PaintBackground(graphics_engine, base);
292
292
                         eHSCROLLBAR, true);
293
293
  };
294
294
 
295
 
  void HScrollBar::SetContainerSize(int x, int y, int w, int h)
 
295
  void HScrollBar::SetContainerSize(int /* x */, int /* y */, int w, int h)
296
296
  {
297
297
    // x and y are not needed
298
298
    container_width_ = w;
300
300
    ComputeScrolling();
301
301
  }
302
302
 
303
 
  void HScrollBar::SetContentSize(int x, int y, int w, int h)
 
303
  void HScrollBar::SetContentSize(int /* x */, int /* y */, int w, int h)
304
304
  {
305
305
    // x and y are not needed
306
306
    content_width_ = w;
356
356
/////////////////
357
357
//  RECEIVERS  //
358
358
/////////////////
359
 
  void HScrollBar::SetValue(float value)
 
359
  void HScrollBar::SetValue(float /* value */)
360
360
  {
361
361
    //m_ValueString.setCaption(value);
362
362
  }
363
363
 
364
 
  void HScrollBar::SetParameterName(const char *parameter_name)
 
364
  void HScrollBar::SetParameterName(const char * /* parameter_name */)
365
365
  {
366
366
    //m_ParameterName.setCaption(parameter_name);
367
367
  }
370
370
//  EMITTERS  //
371
371
////////////////
372
372
 
373
 
  void HScrollBar::OnSliderMouseDown(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
373
  void HScrollBar::OnSliderMouseDown(int x, int y, unsigned long /* button_flags */, unsigned long /* key_flags */)
374
374
  {
375
375
    m_SliderDragPositionX = x;
376
376
    m_SliderDragPositionY = y;
380
380
    GetTimer().AddOneShotTimer(10, callback, this);
381
381
  }
382
382
 
383
 
  void HScrollBar::OnSliderMouseUp(int x, int y, unsigned long button_flags, unsigned long key_flags)
 
383
  void HScrollBar::OnSliderMouseUp(int /* x */, int /* y */, unsigned long /* button_flags */, unsigned long /* key_flags */)
384
384
  {
385
385
    b_MouseDownTimer = false;
386
386
    b_MouseUpTimer = true;
387
387
    GetTimer().AddOneShotTimer(10, callback, this);
388
388
  }
389
389
 
390
 
  void HScrollBar::OnSliderMouseDrag(int x, int y, int dx, int dy, unsigned long button_flags, unsigned long key_flags)
 
390
  void HScrollBar::OnSliderMouseDrag(int x, int /* y */, int dx, int /* dy */, unsigned long /* button_flags */, unsigned long /* key_flags */)
391
391
  {
392
392
    if (_track->GetBaseWidth() - _slider->GetBaseWidth() > 0)
393
393
    {