NetSurf
Data Structures | Enumerations | Functions
widget.h File Reference
#include <stdbool.h>
Include dependency graph for widget.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  fbtk_widget_s
 Widget description. More...
 

Enumerations

enum  fbtk_widgettype_e {
  FB_WIDGET_TYPE_ROOT = 0 , FB_WIDGET_TYPE_WINDOW , FB_WIDGET_TYPE_BITMAP , FB_WIDGET_TYPE_FILL ,
  FB_WIDGET_TYPE_TEXT , FB_WIDGET_TYPE_HSCROLL , FB_WIDGET_TYPE_VSCROLL , FB_WIDGET_TYPE_USER
}
 

Functions

fbtk_widget_tfbtk_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. More...
 
fbtk_widget_tfbtk_get_root_widget (fbtk_widget_t *widget)
 find the root widget from any widget in the toolkit hierarchy. More...
 
int fbtk_set_ptr (fbtk_widget_t *widget, fbtk_callback_info *cbi)
 set pointer to bitmap in context. More...
 

Enumeration Type Documentation

◆ fbtk_widgettype_e

Enumerator
FB_WIDGET_TYPE_ROOT 
FB_WIDGET_TYPE_WINDOW 
FB_WIDGET_TYPE_BITMAP 
FB_WIDGET_TYPE_FILL 
FB_WIDGET_TYPE_TEXT 
FB_WIDGET_TYPE_HSCROLL 
FB_WIDGET_TYPE_VSCROLL 
FB_WIDGET_TYPE_USER 

Definition at line 24 of file widget.h.

Function Documentation

◆ fbtk_get_root_widget()

fbtk_widget_t * fbtk_get_root_widget ( fbtk_widget_t widget)

find the root widget from any widget in the toolkit hierarchy.

Parameters
widgetAny widget.
Returns
The root widget or NULL if widget was not valid.

Definition at line 412 of file fbtk.c.

References FB_WIDGET_TYPE_ROOT, NSLOG, fbtk_widget_s::parent, and fbtk_widget_s::type.

Referenced by fb_redraw_text(), fb_redraw_text_button(), fbtk_click(), fbtk_enable_oskb(), fbtk_event(), fbtk_get_caret(), fbtk_get_nsfb(), fbtk_get_redraw_pending(), fbtk_get_widget_at(), fbtk_input(), fbtk_redraw(), fbtk_set_caret(), fbtk_set_focus(), fbtk_set_ptr(), fbtk_tgrab_pointer(), fbtk_warp_pointer(), hscroll_redraw(), and vscroll_redraw().

Here is the caller graph for this function:

◆ fbtk_set_ptr()

int fbtk_set_ptr ( fbtk_widget_t widget,
fbtk_callback_info cbi 
)

set pointer to bitmap in context.

widget helper callback to set cursor image to the bitmap passed in the callbacks private data.

Definition at line 393 of file fbtk.c.

References fbtk_callback_info::context, fbtk_get_root_widget(), fbtk_bitmap::height, fbtk_bitmap::hot_x, fbtk_bitmap::hot_y, fbtk_bitmap::pixdata, root, and fbtk_bitmap::width.

Referenced by fbtk_create_button(), and fbtk_create_text_button().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ fbtk_widget_new()

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.

The widget is set to defaults of false, 0 or NULL.

Parameters
parentThe parent widget. The new widget will be added with the shallowest z order relative to its siblings.
typeThe type of the widget.
xThe x co-ordinate relative to the parent widget.
yThe y co-ordinate relative to the parent widget.
widththe widgets width. This will be clipped to the parent, if the value is 0 the largest extent which can fit within the parent is used, if the value is negative the largest value that will fit within the parent less the value given will be used.
heightthe widgets width. This will be clipped to the parent, if the value is 0 the largest extent which can fit within the parent is used, if the value is negative the largest value that will fit within the parent less the value given will be used.

Definition at line 546 of file fbtk.c.

References fbtk, fbtk_widget_s::height, height, fbtk_widget_s::next, NSLOG, fbtk_widget_s::parent, parent, fbtk_widget_s::prev, type, fbtk_widget_s::type, fbtk_widget_s::width, width, fbtk_widget_s::x, and fbtk_widget_s::y.

Referenced by fbtk_create_bitmap(), fbtk_create_button(), fbtk_create_fill(), fbtk_create_hscroll(), fbtk_create_text(), fbtk_create_text_button(), fbtk_create_user(), fbtk_create_vscroll(), fbtk_create_window(), and fbtk_create_writable_text().

Here is the caller graph for this function: