Skip to content

Commit

Permalink
refactor: add interface class to act as superclass of all widgets
Browse files Browse the repository at this point in the history
Signed-off-by: Aditya Agarwal <[email protected]>
  • Loading branch information
Aditya-A-garwal committed Feb 17, 2024
1 parent 146a59b commit eac554e
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions include/widgets/widget.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#ifndef __WIDGETS_WIDGET_H__
#define __WIDGETS_WIDGET_H__

#include "Arduino.h"
#include "Adafruit_GFX.h"
#include "MCUFRIEND_kbv.h"

class Widget {

public:

virtual void draw() const;
virtual void clear() const;

virtual bool update(unsigned touch_x, unsigned touch_y);

virtual unsigned height() const;
virtual unsigned width() const;
};

#endif

0 comments on commit eac554e

Please sign in to comment.