Ansel 0.0
A darktable fork - bloat + design vision
Loading...
Searching...
No Matches
widget.h File Reference
#include "lua/call.h"
#include "lua/lua.h"
#include <gtk/gtk.h>
+ Include dependency graph for widget.h:
+ This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Data Structures

struct  dt_lua_widget_t
 
struct  dt_lua_widget_type_t
 

Macros

#define dt_lua_widget_register_gtk_callback(L, widget_type, signal_name, lua_name, callback)    dt_lua_widget_register_gtk_callback_type(L,luaA_type_find(L, #widget_type),signal_name,lua_name,callback)
 
#define dt_lua_init_widget_type(L, widget_type, lua_type, gtk_type)    dt_lua_init_widget_type_type(L, widget_type, #lua_type,gtk_type)
 

Typedefs

typedef dt_lua_widget_tlua_widget
 
typedef struct dt_lua_widget_type_t dt_lua_widget_type_t
 

Functions

void dt_lua_widget_set_callback (lua_State *L, int index, const char *name)
 
void dt_lua_widget_get_callback (lua_State *L, int index, const char *name)
 
int dt_lua_widget_trigger_callback (lua_State *L)
 
void dt_lua_widget_register_gtk_callback_type (lua_State *L, luaA_Type type_id, const char *signal_name, const char *lua_name, GCallback callback)
 
luaA_Type dt_lua_init_widget_type_type (lua_State *L, dt_lua_widget_type_t *widget_type, const char *lua_type, GType gtk_type)
 
void dt_lua_widget_bind (lua_State *L, lua_widget widget)
 
void dt_lua_widget_unbind (lua_State *L, lua_widget widget)
 
int dt_lua_init_widget (lua_State *L)
 

Variables

dt_lua_widget_type_t widget_type
 

Macro Definition Documentation

◆ dt_lua_init_widget_type

#define dt_lua_init_widget_type (   L,
  widget_type,
  lua_type,
  gtk_type 
)     dt_lua_init_widget_type_type(L, widget_type, #lua_type,gtk_type)

◆ dt_lua_widget_register_gtk_callback

#define dt_lua_widget_register_gtk_callback (   L,
  widget_type,
  signal_name,
  lua_name,
  callback 
)     dt_lua_widget_register_gtk_callback_type(L,luaA_type_find(L, #widget_type),signal_name,lua_name,callback)

Typedef Documentation

◆ dt_lua_widget_type_t

◆ lua_widget

Function Documentation

◆ dt_lua_init_widget()

◆ dt_lua_init_widget_type_type()

◆ dt_lua_widget_bind()

void dt_lua_widget_bind ( lua_State L,
lua_widget  widget 
)

Bind a lua widget, i.e prevent it from being destroyed by the lua GC. after that, the lua object is guaranteed to exist until it is unbound or the associated GtkWidget is destroyed

You want to call that on widget you add to the UI so they stay alive.

References dt_lua_widget_t::widget.

Referenced by _guides_gui_callback(), register_lib(), register_pref_sub(), and register_storage().

◆ dt_lua_widget_get_callback()

void dt_lua_widget_get_callback ( lua_State L,
int  index,
const char *  name 
)

push the callback for name "name" on the stack, or nil if not available

References dt_lua_isa, and name.

Referenced by gtk_signal_member(), and reset_member().

◆ dt_lua_widget_register_gtk_callback_type()

void dt_lua_widget_register_gtk_callback_type ( lua_State L,
luaA_Type  type_id,
const char *  signal_name,
const char *  lua_name,
GCallback  callback 
)

◆ dt_lua_widget_set_callback()

void dt_lua_widget_set_callback ( lua_State L,
int  index,
const char *  name 
)

pop a function from the top of the stack, register as a callback named "name" for the object (not type) at index index

References dt_lua_isa, and name.

Referenced by container_init(), gtk_signal_member(), register_pref_sub(), and reset_member().

◆ dt_lua_widget_trigger_callback()

int dt_lua_widget_trigger_callback ( lua_State L)

triggers a callback for the object, first param : the lua_storage to trigger second param : the name of the event to fire other params : passed to the callback returns nothing, might raise exceptions

this function is meant to be called via dt_lua_async_call if needed

References dt_lua_redraw_screen(), dt_lua_treated_pcall(), and name.

Referenced by changed_callback(), clicked_callback(), clicked_callback(), container_reset(), file_set_callback(), gui_reset_wrapper(), gui_reset_wrapper(), on_child_added(), on_child_removed(), reset_widget_lua(), response_callback_lua(), and update_widget_lua().

◆ dt_lua_widget_unbind()

void dt_lua_widget_unbind ( lua_State L,
lua_widget  widget 
)

Referenced by widget_gc().

Variable Documentation

◆ widget_type

dt_lua_widget_type_t widget_type
extern

TODO use name to save/restore states as pref like other widgets have a way to save presets luastorage can't save presets dt_ui_section_label : make new lua widget - Done widget names : implement for CSS ? - Done

Referenced by cleanup_widget_sub(), dt_lua_init_widget(), dt_lua_init_widget_type_type(), get_widget_params(), and init_widget_sub().