NetSurf
Functions
bitmap.c File Reference
#include <stdbool.h>
#include <stdlib.h>
#include <libnsfb.h>
#include <libnsfb_plot.h>
#include "netsurf/browser_window.h"
#include "framebuffer/gui.h"
#include "framebuffer/fbtk.h"
#include "framebuffer/image_data.h"
#include "widget.h"
Include dependency graph for bitmap.c:

Go to the source code of this file.

Functions

static int fb_redraw_bitmap (fbtk_widget_t *widget, fbtk_callback_info *cbi)
 
void fbtk_set_bitmap (fbtk_widget_t *widget, struct fbtk_bitmap *image)
 Change the bitmap in a widget. More...
 
fbtk_widget_tfbtk_create_bitmap (fbtk_widget_t *parent, int x, int y, int width, int height, colour c, struct fbtk_bitmap *image)
 Create a bitmap widget. More...
 
fbtk_widget_tfbtk_create_button (fbtk_widget_t *parent, 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. More...
 

Function Documentation

◆ fb_redraw_bitmap()

static int fb_redraw_bitmap ( fbtk_widget_t widget,
fbtk_callback_info cbi 
)
static

Definition at line 36 of file bitmap.c.

References fbtk_widget_s::bg, fbtk_widget_s::bitmap, fbtk_get_bbox(), fbtk_get_nsfb(), fbtk_bitmap::height, nsfb, fbtk_bitmap::opaque, fbtk_bitmap::pixdata, fbtk_widget_s::u, and fbtk_bitmap::width.

Referenced by fbtk_create_bitmap(), and fbtk_create_button().

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

◆ fbtk_create_bitmap()

fbtk_widget_t * fbtk_create_bitmap ( fbtk_widget_t window,
int  x,
int  y,
int  width,
int  height,
colour  c,
struct fbtk_bitmap image 
)

Create a bitmap widget.

Create a widget which shows a bitmap.

Parameters
windowThe window to add the bitmap widget to.
xX coordinate of widget.
yY coordinate of widget.
widthWidth of the widget
heightHeight of the widget
cbackground colour
imageThe bitmap to put in the widget
Returns
new widget handle or NULL on error.

Definition at line 84 of file bitmap.c.

References fbtk_widget_s::bg, fbtk_widget_s::bitmap, fb_redraw_bitmap(), FB_WIDGET_TYPE_BITMAP, FBTK_CBT_REDRAW, fbtk_set_handler(), fbtk_widget_new(), height, fbtk_widget_s::mapped, parent, fbtk_widget_s::u, and width.

Referenced by create_toolbar().

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

◆ fbtk_create_button()

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.

Helper function which creates a bitmap widget and associate a handler for when it is clicked.

Parameters
windowThe window to add the button widget to.
xX coordinate of widget.
yY coordinate of widget.
widthWidth of the widget
heightHeight of the widget
cbackground colour
imageThe bitmap to put in the widget
clickThe callback upon a click
pwThe context tp pass to the callback
Returns
new widget handle or NULL on error.

Definition at line 107 of file bitmap.c.

References fbtk_widget_s::bg, fbtk_widget_s::bitmap, fb_redraw_bitmap(), FB_WIDGET_TYPE_BITMAP, FBTK_CBT_CLICK, FBTK_CBT_POINTERENTER, FBTK_CBT_REDRAW, fbtk_set_handler(), fbtk_set_ptr(), fbtk_widget_new(), hand_image, height, fbtk_widget_s::mapped, parent, fbtk_widget_s::u, and width.

Referenced by create_normal_browser_window(), create_toolbar(), fbtk_create_hscroll(), fbtk_create_vscroll(), and fbtk_enable_oskb().

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

◆ fbtk_set_bitmap()

void fbtk_set_bitmap ( fbtk_widget_t widget,
struct fbtk_bitmap image 
)

Change the bitmap in a widget.

Parameters
widgetThe widget to get the context from.
imageThe bitmap to put in the widget

Definition at line 72 of file bitmap.c.

References fbtk_widget_s::bitmap, FB_WIDGET_TYPE_BITMAP, fbtk_request_redraw(), fbtk_widget_s::type, and fbtk_widget_s::u.

Referenced by fb_update_back_forward(), gui_window_stop_throbber(), and throbber_advance().

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