wlmaker
Loading...
Searching...
No Matches
task_list.c File Reference
#include "task_list.h"
#include "config.h"
#include "toolkit/toolkit.h"
#include <libbase/libbase.h>
#include <limits.h>
#include <wlr/interfaces/wlr_buffer.h>
Include dependency graph for task_list.c:

Classes

struct  _wlmaker_task_list_t
 

Macros

#define _POSIX_C_SOURCE   1
 for PATH_MAX.
 
#define WLR_USE_UNSTABLE
 Include unstable interfaces of wlroots.
 

Functions

static void get_size (wlmaker_view_t *view_ptr, uint32_t *width_ptr, uint32_t *height_ptr)
 
static void task_list_refresh (wlmaker_task_list_t *task_list_ptr)
 
static struct wlr_buffer * create_wlr_buffer (wlmaker_workspace_t *workspace_ptr)
 
static void draw_into_cairo (cairo_t *cairo_ptr, wlmaker_workspace_t *workspace_ptr)
 
static void draw_window_into_cairo (cairo_t *cairo_ptr, wlmtk_window_t *window_ptr, bool active, int pos_y)
 
static const char * window_name (wlmtk_window_t *window_ptr)
 
static void handle_task_list_enabled (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_task_list_disabled (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_window_mapped (struct wl_listener *listener_ptr, void *data_ptr)
 
static void handle_window_unmapped (struct wl_listener *listener_ptr, void *data_ptr)
 
wlmaker_task_list_twlmaker_task_list_create (wlmaker_server_t *server_ptr)
 
void wlmaker_task_list_destroy (wlmaker_task_list_t *task_list_ptr)
 

Variables

const wlmaker_view_impl_t task_list_view_impl
 
static const uint32_t task_list_width = 400
 
static const uint32_t task_list_height = 200
 

Detailed Description

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

◆ create_wlr_buffer()

struct wlr_buffer * create_wlr_buffer ( wlmaker_workspace_t * workspace_ptr)
static

Creates a struct wlr_buffer with windows of workspace_ptr drawn into.

Parameters
workspace_ptr
Returns
A pointer to the struct wlr_buffer with the list of windows (tasks), or NULL on error.

◆ draw_into_cairo()

void draw_into_cairo ( cairo_t * cairo_ptr,
wlmaker_workspace_t * workspace_ptr )
static

Draws all tasks of workspace_ptr into cairo_ptr.

Parameters
cairo_ptr
workspace_ptr

◆ draw_window_into_cairo()

void draw_window_into_cairo ( cairo_t * cairo_ptr,
wlmtk_window_t * window_ptr,
bool active,
int pos_y )
static

Draws one window (task) into cairo_ptr.

Parameters
cairo_ptr
window_ptr
activeWhether this window is currently active.
pos_yY position within the cairo_ptr.

◆ get_size()

void get_size ( wlmaker_view_t * view_ptr,
uint32_t * width_ptr,
uint32_t * height_ptr )
static

Provides the size of the view into *width_ptr, *height_ptr.

Parameters
view_ptr
width_ptrIf not NULL: This view's width in pixels will get stored at *width_ptr..
height_ptrIf not NULL: This view's height in pixels will get stored at *height_ptr..

◆ handle_task_list_disabled()

void handle_task_list_disabled ( struct wl_listener * listener_ptr,
void * data_ptr )
static

Handler for the task_list_disabled_listener: Hides the list.

Parameters
listener_ptr
data_ptr

◆ handle_task_list_enabled()

void handle_task_list_enabled ( struct wl_listener * listener_ptr,
void * data_ptr )
static

Handler for the task_list_enabled_listener.

Enables the task listener: Creates the task list for the currently-active workspace and enables the task list on that workspace.

Parameters
listener_ptr
data_ptr

◆ handle_window_mapped()

void handle_window_mapped ( struct wl_listener * listener_ptr,
void * data_ptr )
static

Handler for the window_mapped_listener: Refreshes the list (if enabled).

Parameters
listener_ptr
data_ptr

◆ handle_window_unmapped()

void handle_window_unmapped ( struct wl_listener * listener_ptr,
void * data_ptr )
static

Handler for the window_unmapped_listener: Refreshes the list (if enabled).

Parameters
listener_ptr
data_ptr

◆ task_list_refresh()

void task_list_refresh ( wlmaker_task_list_t * task_list_ptr)
static

Refreshes the task list. Should be done whenever a list is mapped/unmapped.

Parameters
task_list_ptr

◆ window_name()

const char * window_name ( wlmtk_window_t * window_ptr)
static

Constructs a comprehensive name for the window.

Parameters
window_ptr
Returns
Pointer to the constructed name. This is a static buffer that does not require to be free'd, but will be re-used upon next call to window_name.

◆ wlmaker_task_list_create()

wlmaker_task_list_t * wlmaker_task_list_create ( wlmaker_server_t * server_ptr)

Creates a task list for the server.

Will allocate the task list handle, and register signal handlers so the task list reacts to task_list_enabled_event and task_list_disabled_event of the wlmaker_server_t.

Parameters
server_ptr
Returns
The task list handle or NULL on error. Must be released by calling wlmaker_task_list_destroy.

◆ wlmaker_task_list_destroy()

void wlmaker_task_list_destroy ( wlmaker_task_list_t * task_list_ptr)

Destroys the task list, as created by wlmaker_task_list_create.

Parameters
task_list_ptr

Variable Documentation

◆ task_list_height

const uint32_t task_list_height = 200
static

Height of the task list overlay.

◆ task_list_view_impl

const wlmaker_view_impl_t task_list_view_impl
Initial value:
= {
.set_activated = NULL,
.get_size = get_size,
.handle_axis = NULL
}
static void get_size(wlmaker_view_t *view_ptr, uint32_t *width_ptr, uint32_t *height_ptr)
Definition task_list.c:193

View implementor methods.

◆ task_list_width

const uint32_t task_list_width = 400
static

Width of the task list overlay.