26#include <libnsfb_plot.h>
27#include <libnsfb_event.h>
28#include <libnsfb_cursor.h>
53 nsfb_claim(
root->u.root.fb, &bbox);
58 nsfb_plot_rectangle_fill(
root->u.root.fb, &
rect, widget->
bg);
66 nsfb_plot_rectangle_fill(
root->u.root.fb, &
rect, widget->
fg);
67 nsfb_plot_rectangle(
root->u.root.fb, &
rect, 1, 0xFF999999,
false,
false);
76 vscroll = (widget->
height - 4);
81 rect.
y0 = bbox.y0 + 3 + vpos;
83 rect.
y1 = bbox.y0 + vscroll + vpos;
85 nsfb_plot_rectangle_fill(
root->u.root.fb, &
rect, widget->
bg);
87 nsfb_update(
root->u.root.fb, &bbox);
103 if (newpos < scrollw->u.scroll.minimum)
121 if (cbi->
event->type != NSFB_EVENT_KEY_DOWN)
125 if (newpos < scrollw->u.scroll.minimum)
140 if (cbi->
event->type != NSFB_EVENT_KEY_DOWN)
161 if (cbi->
event->type != NSFB_EVENT_KEY_DOWN) {
168 switch (cbi->
event->value.keycode) {
170 case NSFB_KEY_MOUSE_4:
173 if (newpos < widget->u.scroll.minimum)
178 case NSFB_KEY_MOUSE_5:
194 vscroll = (widget->
height - 4);
201 if (newpos < widget->u.scroll.minimum)
204 }
else if (cbi->
y > (vpos + vscroll)) {
310 nsfb_claim(
root->u.root.fb, &bbox);
315 nsfb_plot_rectangle_fill(
root->u.root.fb, &
rect, widget->
bg);
322 nsfb_plot_rectangle_fill(
root->u.root.fb, &
rect, widget->
fg);
325 nsfb_plot_rectangle(
root->u.root.fb, &
rect, 1, 0xFF999999,
false,
false);
333 hscroll = (widget->
width - 4);
337 NSLOG(netsurf, INFO,
"hscroll %d", hscroll);
339 rect.
x0 = bbox.x0 + 3 + hpos;
341 rect.
x1 = bbox.x0 + hscroll + hpos;
344 nsfb_plot_rectangle_fill(
root->u.root.fb, &
rect, widget->
bg);
346 nsfb_update(
root->u.root.fb, &bbox);
357 if (cbi->
event->type != NSFB_EVENT_KEY_DOWN)
361 if (newpos < scrollw->u.scroll.minimum)
365 NSLOG(netsurf, INFO,
"horiz scroll was the same %d", newpos);
378 if (cbi->
event->type != NSFB_EVENT_KEY_DOWN)
402 if (newpos < scrollw->u.scroll.minimum)
422 if (cbi->
event->type != NSFB_EVENT_KEY_DOWN) {
435 hscroll = (widget->
width - 4);
442 if (newpos < widget->u.scroll.minimum)
445 }
else if (cbi->
x > (hpos + hscroll)) {
574 if ((position < widget->u.scroll.minimum) ||
Browser window creation and manipulation interface.
fbtk_widget_t * fbtk_widget_new(fbtk_widget_t *parent, enum fbtk_widgettype_e type, int x, int y, int width, int height)
creates a new widget and insert it into to hierachy.
fbtk_widget_t * fbtk_get_root_widget(fbtk_widget_t *widget)
find the root widget from any widget in the toolkit hierarchy.
fbtk_callback fbtk_set_handler(fbtk_widget_t *widget, fbtk_callback_type cbt, fbtk_callback cb, void *pw)
Set a callback handler.
bool fbtk_set_pos_and_size(fbtk_widget_t *widget, int x, int y, int width, int height)
Change the widget's position and size.
void fbtk_request_redraw(fbtk_widget_t *widget)
Indicate a widget should be redrawn.
bool fbtk_tgrab_pointer(fbtk_widget_t *widget)
Toggle pointer grab.
int fbtk_post_callback(fbtk_widget_t *widget, fbtk_callback_type cbt,...)
Helper function to allow simple calling of callbacks with parameters.
bool fbtk_get_bbox(fbtk_widget_t *widget, struct nsfb_bbox_s *bbox)
Get a widget's bounding box in absolute screen co-ordinates.
fbtk_widget_t * fbtk_create_button(fbtk_widget_t *window, int x, int y, int width, int height, colour c, struct fbtk_bitmap *image, fbtk_callback click, void *pw)
Create a button widget with an image.
int(* fbtk_callback)(fbtk_widget_t *widget, fbtk_callback_info *cbi)
static struct directory * root
struct fbtk_bitmap scrolll
struct fbtk_bitmap scrollr
struct fbtk_bitmap scrolld
struct fbtk_bitmap scrollu
#define NSLOG(catname, level, logmsg, args...)
widget callback information
uint32_t colour
Colour type: XBGR.
struct rect rect
Rectangle coordinates.