marco 1.29.1
Window manager
Loading...
Searching...
No Matches
marco-window-demo.c File Reference
View source
#include <gtk/gtk.h>
#include <gdk/gdkx.h>
#include <X11/Xatom.h>
#include <unistd.h>
Include dependency graph for marco-window-demo.c:

Macros

#define DOCK_SIZE   48
 

Enumerations

enum  {
  DOCK_TOP = 1 , DOCK_BOTTOM = 2 , DOCK_LEFT = 3 , DOCK_RIGHT = 4 ,
  DOCK_ALL = 5
}
 

Functions

static void do_appwindow (GSimpleAction *action, GVariant *parameter, gpointer user_data)
 
static void set_gdk_window_struts (GdkWindow *window, int left, int right, int top, int bottom)
 
static void on_realize_set_struts (GtkWindow *window, gpointer data)
 
static void set_gtk_window_struts (GtkWidget *window, int left, int right, int top, int bottom)
 
static void set_gdk_window_type (GdkWindow *window, const char *type)
 
static void on_realize_set_type (GtkWindow *window, gpointer data)
 
static void set_gtk_window_type (GtkWindow *window, const char *type)
 
static void set_gdk_window_border_only (GdkWindow *window)
 
static void on_realize_set_border_only (GtkWindow *window, gpointer data)
 
static void set_gtk_window_border_only (GtkWindow *window)
 
int main (int argc, char **argv)
 
static void response_cb (GtkDialog *dialog, int response_id, void *data)
 
static void make_dialog (GtkWidget *parent, int depth)
 
static void dialog_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void modal_dialog_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void no_parent_dialog_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void utility_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void toolbar_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void menu_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void override_redirect_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void border_only_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static gboolean focus_in_event_cb (GtkWidget *window, GdkEvent *event, gpointer data)
 
static gboolean focus_out_event_cb (GtkWidget *window, GdkEvent *event, gpointer data)
 
static GtkWidget * focus_label (GtkWidget *window)
 
static void splashscreen_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void make_dock (int type)
 
static void dock_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void override_background_color (GtkWidget *widget, GdkRGBA *rgba)
 
static void desktop_cb (GSimpleAction *action, GVariant *parameter, gpointer callback_data)
 
static void sleep_cb (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void toggle_aspect_ratio (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void toggle_decorated_cb (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void clicked_toolbar_cb (GSimpleAction *action, GVariant *parameter, gpointer data)
 
static void update_statusbar (GtkTextBuffer *buffer, GtkStatusbar *statusbar)
 
static void mark_set_callback (GtkTextBuffer *buffer, const GtkTextIter *new_location, GtkTextMark *mark, gpointer data)
 
static void destroy_cb (GtkWidget *w, gpointer data)
 
static GtkWidget * create_toolbar (void)
 

Variables

static gboolean aspect_on
 
static int window_count = 0
 
static const gchar * xml
 
static GActionEntry demo_entries []
 

Macro Definition Documentation

◆ DOCK_SIZE

#define DOCK_SIZE   48

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
DOCK_TOP 
DOCK_BOTTOM 
DOCK_LEFT 
DOCK_RIGHT 
DOCK_ALL 

Function Documentation

◆ border_only_cb()

static void border_only_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References FALSE, label, and set_gtk_window_border_only().

Here is the call graph for this function:

◆ clicked_toolbar_cb()

static void clicked_toolbar_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  data 
)
static

References NULL.

◆ create_toolbar()

static GtkWidget * create_toolbar ( void  )
static

References item, and NULL.

Referenced by do_appwindow().

◆ desktop_cb()

static void desktop_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References focus_label(), label, override_background_color(), and set_gtk_window_type().

Here is the call graph for this function:

◆ destroy_cb()

static void destroy_cb ( GtkWidget *  w,
gpointer  data 
)
static

References window_count.

Referenced by do_appwindow().

◆ dialog_cb()

static void dialog_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References make_dialog().

Here is the call graph for this function:

◆ do_appwindow()

static void do_appwindow ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  user_data 
)
static

References aspect_on, create_toolbar(), demo_entries, destroy_cb(), FALSE, mark_set_callback(), NULL, TRUE, update_statusbar(), window_count, and xml.

Referenced by main().

Here is the call graph for this function:

◆ dock_cb()

static void dock_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References DOCK_ALL, DOCK_BOTTOM, DOCK_LEFT, DOCK_RIGHT, DOCK_TOP, make_dock(), and NULL.

Here is the call graph for this function:

◆ focus_in_event_cb()

static gboolean focus_in_event_cb ( GtkWidget *  window,
GdkEvent *  event,
gpointer  data 
)
static

References TRUE.

Referenced by focus_label().

◆ focus_label()

static GtkWidget * focus_label ( GtkWidget *  window)
static

References focus_in_event_cb(), focus_out_event_cb(), and label.

Referenced by desktop_cb(), make_dock(), and splashscreen_cb().

Here is the call graph for this function:

◆ focus_out_event_cb()

static gboolean focus_out_event_cb ( GtkWidget *  window,
GdkEvent *  event,
gpointer  data 
)
static

References TRUE.

Referenced by focus_label().

◆ main()

int main ( int  argc,
char **  argv 
)

References do_appwindow(), and NULL.

Here is the call graph for this function:

◆ make_dialog()

static void make_dialog ( GtkWidget *  parent,
int  depth 
)
static

References NULL, and response_cb().

Referenced by dialog_cb(), no_parent_dialog_cb(), and response_cb().

Here is the call graph for this function:

◆ make_dock()

static void make_dock ( int  type)
static

References DOCK_ALL, DOCK_BOTTOM, DOCK_LEFT, DOCK_RIGHT, DOCK_SIZE, DOCK_TOP, FALSE, focus_label(), NULL, set_gtk_window_struts(), and set_gtk_window_type().

Referenced by dock_cb().

Here is the call graph for this function:

◆ mark_set_callback()

static void mark_set_callback ( GtkTextBuffer *  buffer,
const GtkTextIter *  new_location,
GtkTextMark *  mark,
gpointer  data 
)
static

References update_statusbar().

Referenced by do_appwindow().

Here is the call graph for this function:

◆ menu_cb()

static void menu_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References FALSE, label, and set_gtk_window_type().

Here is the call graph for this function:

◆ modal_dialog_cb()

static void modal_dialog_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References set_gtk_window_type().

Here is the call graph for this function:

◆ no_parent_dialog_cb()

static void no_parent_dialog_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References make_dialog(), and NULL.

Here is the call graph for this function:

◆ on_realize_set_border_only()

static void on_realize_set_border_only ( GtkWindow *  window,
gpointer  data 
)
static

References set_gdk_window_border_only().

Referenced by set_gtk_window_border_only().

Here is the call graph for this function:

◆ on_realize_set_struts()

static void on_realize_set_struts ( GtkWindow *  window,
gpointer  data 
)
static

References set_gdk_window_struts().

Referenced by set_gtk_window_struts().

Here is the call graph for this function:

◆ on_realize_set_type()

static void on_realize_set_type ( GtkWindow *  window,
gpointer  data 
)
static

References NULL, and set_gdk_window_type().

Referenced by set_gtk_window_type().

Here is the call graph for this function:

◆ override_background_color()

static void override_background_color ( GtkWidget *  widget,
GdkRGBA *  rgba 
)
static

References NULL.

Referenced by desktop_cb().

◆ override_redirect_cb()

static void override_redirect_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References FALSE, and label.

◆ response_cb()

static void response_cb ( GtkDialog *  dialog,
int  response_id,
void *  data 
)
static

References make_dialog().

Referenced by make_dialog().

Here is the call graph for this function:

◆ set_gdk_window_border_only()

static void set_gdk_window_border_only ( GdkWindow *  window)
static

◆ set_gdk_window_struts()

static void set_gdk_window_struts ( GdkWindow *  window,
int  left,
int  right,
int  top,
int  bottom 
)
static

◆ set_gdk_window_type()

static void set_gdk_window_type ( GdkWindow *  window,
const char *  type 
)
static

◆ set_gtk_window_border_only()

static void set_gtk_window_border_only ( GtkWindow *  window)
static

References NULL, on_realize_set_border_only(), and set_gdk_window_border_only().

Referenced by border_only_cb().

Here is the call graph for this function:

◆ set_gtk_window_struts()

static void set_gtk_window_struts ( GtkWidget *  window,
int  left,
int  right,
int  top,
int  bottom 
)
static

References NULL, on_realize_set_struts(), and set_gdk_window_struts().

Referenced by make_dock().

Here is the call graph for this function:

◆ set_gtk_window_type()

static void set_gtk_window_type ( GtkWindow *  window,
const char *  type 
)
static

References NULL, on_realize_set_type(), and set_gdk_window_type().

Referenced by desktop_cb(), make_dock(), menu_cb(), modal_dialog_cb(), splashscreen_cb(), toolbar_cb(), and utility_cb().

Here is the call graph for this function:

◆ sleep_cb()

static void sleep_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  data 
)
static

◆ splashscreen_cb()

static void splashscreen_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References FALSE, focus_label(), and set_gtk_window_type().

Here is the call graph for this function:

◆ toggle_aspect_ratio()

static void toggle_aspect_ratio ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  data 
)
static

References aspect_on.

◆ toggle_decorated_cb()

static void toggle_decorated_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  data 
)
static

◆ toolbar_cb()

static void toolbar_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References FALSE, label, and set_gtk_window_type().

Here is the call graph for this function:

◆ update_statusbar()

static void update_statusbar ( GtkTextBuffer *  buffer,
GtkStatusbar *  statusbar 
)
static

Referenced by do_appwindow(), and mark_set_callback().

◆ utility_cb()

static void utility_cb ( GSimpleAction *  action,
GVariant *  parameter,
gpointer  callback_data 
)
static

References FALSE, and set_gtk_window_type().

Here is the call graph for this function:

Variable Documentation

◆ aspect_on

gboolean aspect_on
static

◆ demo_entries

GActionEntry demo_entries[]
static
Initial value:
=
{
{ "dialog1", dialog_cb, NULL, NULL, NULL, {} },
{ "dialog2", modal_dialog_cb, NULL, NULL, NULL, {} },
{ "dialog3", no_parent_dialog_cb, NULL, NULL, NULL, {} },
{ "utility", utility_cb, NULL, NULL, NULL, {} },
{ "splashscreen", splashscreen_cb, NULL, NULL, NULL, {} },
{ "top-dock", dock_cb, NULL, NULL, NULL, {} },
{ "bottom-dock", dock_cb, NULL, NULL, NULL, {} },
{ "left-dock", dock_cb, NULL, NULL, NULL, {} },
{ "right-dock", dock_cb, NULL, NULL, NULL, {} },
{ "all-docks", dock_cb, NULL, NULL, NULL, {} },
{ "desktop", desktop_cb, NULL, NULL, NULL, {} },
{ "menu", menu_cb, NULL, NULL, NULL, {} },
{ "toolbar", toolbar_cb, NULL, NULL, NULL, {} },
{ "override-redirect", override_redirect_cb, NULL, NULL, NULL, {} },
{ "border-only", border_only_cb, NULL, NULL, NULL, {} },
{ "new", do_appwindow, NULL, NULL, NULL, {} },
{ "lock", sleep_cb, NULL, NULL, NULL, {} },
{ "decorations", toggle_decorated_cb, NULL, NULL, NULL, {} },
{ "quit", clicked_toolbar_cb, NULL, NULL, NULL, {} },
{ "ratio", toggle_aspect_ratio, NULL, NULL, NULL, {} },
}
#define NULL
Definition async-getprop.c:44
static void override_redirect_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:430
static void border_only_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:452
static void clicked_toolbar_cb(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition marco-window-demo.c:768
static void modal_dialog_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:318
static void utility_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:346
static void no_parent_dialog_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:338
static void splashscreen_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:521
static void toggle_aspect_ratio(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition marco-window-demo.c:725
static void dock_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:630
static void menu_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:405
static void do_appwindow(GSimpleAction *action, GVariant *parameter, gpointer user_data)
Definition marco-window-demo.c:973
static void desktop_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:686
static void toolbar_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:380
static void toggle_decorated_cb(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition marco-window-demo.c:756
static void dialog_cb(GSimpleAction *action, GVariant *parameter, gpointer callback_data)
Definition marco-window-demo.c:310
static void sleep_cb(GSimpleAction *action, GVariant *parameter, gpointer data)
Definition marco-window-demo.c:717

Referenced by do_appwindow().

◆ window_count

int window_count = 0
static

Referenced by destroy_cb(), and do_appwindow().

◆ xml

const gchar* xml
static

Referenced by do_appwindow().