summaryrefslogtreecommitdiff
path: root/framebuffer/fbtk.h
diff options
context:
space:
mode:
Diffstat (limited to 'framebuffer/fbtk.h')
-rw-r--r--framebuffer/fbtk.h45
1 files changed, 42 insertions, 3 deletions
diff --git a/framebuffer/fbtk.h b/framebuffer/fbtk.h
index ccc4ac7d3..b201a9d34 100644
--- a/framebuffer/fbtk.h
+++ b/framebuffer/fbtk.h
@@ -1,3 +1,24 @@
+/*
+ * Copyright 2008 Vincent Sanders <vince@simtec.co.uk>
+ *
+ * This file is part of NetSurf, http://www.netsurf-browser.org/
+ *
+ * NetSurf is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * NetSurf 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 General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+
+#ifndef NETSURF_FB_FBTK_H
+#define NETSURF_FB_FBTK_H
+
#define FB_SCROLL_COLOUR 0xFFAAAAAA
#define FB_FRAME_COLOUR 0xFFDDDDDD
@@ -6,6 +27,24 @@
typedef struct fbtk_widget_s fbtk_widget_t;
+enum fbtk_callback_info_type {
+ FBTK_CBIT_NONE,
+ FBTK_CBIT_SCROLLX,
+ FBTK_CBIT_SCROLLY,
+};
+
+typedef struct fbtk_callback_info {
+ enum fbtk_callback_info_type type;
+ void *context;
+ nsfb_event_t *event;
+ int x;
+ int y;
+ char *text;
+} fbtk_callback_info;
+
+typedef int (*fbtk_callback)(fbtk_widget_t *widget, fbtk_callback_info *cbi);
+
+
/* user widget callback */
typedef int (*fbtk_user_t)(fbtk_widget_t *widget, void *pw);
@@ -86,7 +125,7 @@ fbtk_create_fill(fbtk_widget_t *window, int x, int y, int width, int height, col
* @return new widget handle or NULL on error.
*/
fbtk_widget_t *
-fbtk_create_hscroll(fbtk_widget_t *window, int x, int y, int width, int height, colour fg, colour bg);
+fbtk_create_hscroll(fbtk_widget_t *window, int x, int y, int width, int height, colour fg, colour bg, fbtk_callback callback, void *context);
/** Create a vertical scroll widget
*
@@ -96,7 +135,7 @@ fbtk_create_hscroll(fbtk_widget_t *window, int x, int y, int width, int height,
* @return new widget handle or NULL on error.
*/
fbtk_widget_t *
-fbtk_create_vscroll(fbtk_widget_t *window, int x, int y, int width, int height, colour fg, colour bg);
+fbtk_create_vscroll(fbtk_widget_t *window, int x, int y, int width, int height, colour fg, colour bg, fbtk_callback callback, void *context);
/** Create a user widget.
*
@@ -210,7 +249,7 @@ int fbtk_keycode_to_ucs4(int code, uint8_t mods);
/* clip a box to a widgets area */
bool fbtk_clip_to_widget(fbtk_widget_t *widget, bbox_t * restrict box);
-
+#endif