Gooey GUI Library
Loading...
Searching...
No Matches
gooey_drop_surface.h File Reference

Header file for the GooeyDropSurface module. More...

#include "common/gooey_common.h"

Go to the source code of this file.

Functions

GooeyDropSurface * GooeyDropSurface_Create (int x, int y, int width, int height, char *default_message, void(*callback)(char *mime, char *file_path))
 Adds a file drop surface.
 
void GooeyDropSurface_Clear (GooeyDropSurface *drop_surface)
 Clears the content of a drop surface.
 

Detailed Description

Header file for the GooeyDropSurface module.

Author
Yassine Ahmed Ali

Provides functionality for creating file drop surfaces, handling file drops, and rendering drop surfaces within a GooeyWindow.

Function Documentation

◆ GooeyDropSurface_Clear()

void GooeyDropSurface_Clear ( GooeyDropSurface *  drop_surface)

Clears the content of a drop surface.

Resets the drop surface, removing any dropped file information and restoring the default message.

Parameters
drop_surfaceThe drop surface to clear.

◆ GooeyDropSurface_Create()

GooeyDropSurface * GooeyDropSurface_Create ( int  x,
int  y,
int  width,
int  height,
char *  default_message,
void(*)(char *mime, char *file_path)  callback 
)

Adds a file drop surface.

Creates a new GooeyDropSurface that allows users to drop files onto it. When a file is dropped, the provided callback function is triggered with the MIME type and file path.

Parameters
xThe x-coordinate of the drop surface's position.
yThe y-coordinate of the drop surface's position.
widthThe width of the drop surface.
heightThe height of the drop surface.
default_messageThe default text displayed on the drop surface.
callbackThe function to call when a file is dropped. It receives the file's MIME type and path.
Returns
A pointer to the newly created GooeyDropSurface.