/* * Roo/E, the Kangaroo Punch Portable GUI Toolkit * Copyright (C) 2022 Scott Duensing * * http://kangaroopunch.com * * * This file is part of Roo/E. * * Roo/E is free software: you can redistribute it and/or modify it under the * terms of the GNU Affero General Public License as published by the Free * Software Foundation, either version 3 of the License, or (at your option) * any later version. * * Roo/E 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 Affero General Public License * along with Roo/E. If not, see . * */ #ifndef HSCROLL_H #define HSCROLL_H #include "../gui.h" typedef struct HscrollS { WidgetT base; // Required by all widgets. int32_t min; int32_t max; int32_t value; RectT thumb; ClickHandlerT handler; // Actual event handler. } HscrollT; extern uint8_t __MAGIC_HSCROLL; // Magic ID assigned to us from the GUI. void hscrollClickSet(HscrollT *hscroll, ClickHandlerT handler, void *data); HscrollT *hscrollCreate(int16_t w, ClickHandlerT handler, void *data, ...); void hscrollRangeSet(HscrollT *hscroll, int32_t min, int32_t max); RegisterT *hscrollRegister(uint8_t magic); int32_t hscrollValueGet(HscrollT *hscroll); void hscrollValueSet(HscrollT *hscroll, int32_t value); void hscrollWidthSet(HscrollT *hscroll, int16_t w); #endif // HSCROLL_H