wlmaker
Loading...
Searching...
No Matches
wlm_graph_shared.h File Reference
#include <stdint.h>
Include dependency graph for wlm_graph_shared.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  wlm_graph_values_t
struct  wlm_graph_app_config_t

Macros

#define WLM_GRAPH_REGENERATE_HISTORY_MAX   512

Enumerations

enum  wlm_graph_mode_t { WLM_GRAPH_ACCUMULATE_MODE_INDEPENDENT , WLM_GRAPH_ACCUMULATE_MODE_STACKED }
enum  wlm_graph_read_result_t { WLM_GRAPH_READ_ERROR = -1 , WLM_GRAPH_READ_OK = 0 , WLM_GRAPH_READ_OK_AND_REGENERATE = 1 }

Functions

int wlm_graph_app_run (int argc, const char **argv, const wlm_graph_app_config_t *config)

Detailed Description

Shared graph rendering utilities for wlmaker dock-apps.

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.

Macro Definition Documentation

◆ WLM_GRAPH_REGENERATE_HISTORY_MAX

#define WLM_GRAPH_REGENERATE_HISTORY_MAX   512

Recommended history size for apps implementing regenerate_fn. Apps storing raw values for regeneration can use this as their buffer size. 512 supports up to 4x HiDPI with no bezel (64 suffices for 1x).

Enumeration Type Documentation

◆ wlm_graph_mode_t

Sample accumulation mode: method of accumulating samples for display.

Enumerator
WLM_GRAPH_ACCUMULATE_MODE_INDEPENDENT 

Each value fills from bottom independently, overlapping to create heat-map colors where multiple values coincide. The peak line shows the maximum value across all categories.

WLM_GRAPH_ACCUMULATE_MODE_STACKED 

Values stack cumulatively on top of each other, with each category rendered as a distinct layer. The peak line shows the sum of all values (clamped to 255).

◆ wlm_graph_read_result_t

Return value for stats_read_fn callback.

Enumerator
WLM_GRAPH_READ_ERROR 

Error reading stats; sample will be skipped.

WLM_GRAPH_READ_OK 

Success; sample filled normally.

WLM_GRAPH_READ_OK_AND_REGENERATE 

Success; also regenerate historical samples (scale changed).

Function Documentation

◆ wlm_graph_app_run()

int wlm_graph_app_run ( int argc,
const char ** argv,
const wlm_graph_app_config_t * config )

Runs a graph application.

Handles argument parsing, wlclient setup, icon creation, callback registration, main loop, and cleanup. Apps just need to initialize their state and provide a configuration.

Graph state is managed internally by this function.

Parameters
argcArgument count.
argvArgument vector.
configApplication configuration.
Returns
EXIT_SUCCESS or EXIT_FAILURE.