wlmaker
Loading...
Searching...
No Matches
Functions | Variables
wlmclock.c File Reference
#include <cairo.h>
#include <libbase/libbase.h>
#include <wlclient/wlclient.h>
#include <math.h>
#include <primitives/primitives.h>
#include <primitives/segment_display.h>
#include <stdbool.h>
#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/time.h>
#include <time.h>
#include "wlclient/icon.h"
#include "wlclient/dblbuf.h"
Include dependency graph for wlmclock.c:

Functions

uint64_t next_draw_time (void)
 
bool icon_callback (bs_gfxbuf_t *gfxbuf_ptr, void *ud_ptr)
 
void timer_callback (wlmcl_client_t *client_ptr, void *ud_ptr)
 
static void _handle_configure (void *ud_ptr, uint32_t width, uint32_t height)
 
int main (int argc, char **argv)
 

Variables

static wlmcl_client_twlclient_ptr
 
static wlmcl_dblbuf_tdblbuf_ptr
 
static const uint32_t color_led = 0xff55ffff
 
static const uint32_t color_off = 0xff114444
 
static const uint32_t color_background = 0xff111111
 

Detailed Description

Demonstrator for using the icon protocol.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Example app for libwlclient.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

https://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Function Documentation

◆ _handle_configure()

static void _handle_configure ( void *  ud_ptr,
uint32_t  width,
uint32_t  height 
)
static

Handles configure events.

◆ icon_callback()

bool icon_callback ( bs_gfxbuf_t *  gfxbuf_ptr,
void *  ud_ptr 
)

Draws contents into the icon buffer.

Parameters
gfxbuf_ptr
ud_ptr

◆ main()

int main ( int  argc,
char **  argv 
)

Main program.

◆ next_draw_time()

uint64_t next_draw_time ( void  )

Returns the next full second for when to draw the clock.

◆ timer_callback()

void timer_callback ( wlmcl_client_t client_ptr,
void *  ud_ptr 
)

Called once per second.

Variable Documentation

◆ color_background

const uint32_t color_background = 0xff111111
static

Background color in the VFD-style display.

◆ color_led

const uint32_t color_led = 0xff55ffff
static

Foreground color of a LED in the VFD-style display.

◆ color_off

const uint32_t color_off = 0xff114444
static

Color of a turned-off element in the VFD-style display.

◆ dblbuf_ptr

wlmcl_dblbuf_t* dblbuf_ptr
static

Double buffer.

◆ wlclient_ptr

wlmcl_client_t* wlclient_ptr
static

State of the client.