AffinityApp is a GObject which manages the entire Affinity application, hence the name. It owns the window and starts the plugins. The AffinityApp and AffinityAppClass structs are defined in aff-app.h in libaff, along with some functions. No functions are currently defined in aff-app.c. Functions that only Affinity will internally use are defined in affinity.h in Affinity's main src, which includes aff-app.h. All the functions are coded in affinity.c. This is done because some functions used by plugins, such as registering widgets, require access to variables which should be kept private, in AffinityAppPrivate.

Currently, aff-app.h is only used to define the AffinityApp type, functions for registering certain widgets, and functions for showing/hiding the window.

AffinityApp struct

typedef struct AffinityApp
  GObject parent;

  AffSettings *settings;//Struct for setting and getting settings

  gboolean visible;//Whether or not the window is visible. See aff_app_set_shown()
  gboolean lock_focus;//TRUE if the window should not hide when focus is lost, such as when a GtkMenu is popped up
  gboolean searching;//TRUE if a search is displayed and the center plugins are not

  GtkWidget *window;//The main AffWindow

  GtkWidget *entry;//The main entry into which the search queries are typed
  GtkWidget *scroll;//The GtkScrolledWindow for the search GtkTreeView
  GtkWidget *treeview;//The GtkTreeView for the search results
} AffinityApp;


affinity-shown: Affinity is shown. No arguments
affinity-hidden: Affinity is hidden. No arguments
search-done: Search results are shown. Only argument is the search query.
search-undone: Search results are shown. No arguments
app-launched: An application was started from the search results. Only argument is the path to the app's .desktop file.


void aff_register_button(AffinityApp *app, GtkWidget *button);
Connects to signals from the button so a border and background can be drawn around it when hovered (if enabled).


void aff_register_entry(AffinityApp *app, GtkWidget *entry);
Adds the entry to a list of entries in app so a border and background can be drawn around the entry.


void aff_register_frame(AffinityApp *app, GtkWidget *frame);
Adds the frame to a list of frames in app so a border and background can be drawn around the frame.

Unless otherwise stated, the content of this page is licensed under Creative Commons Attribution-ShareAlike 3.0 License