GDS-Render v1.2.1
main.c File Reference

main.c More...

#include <stdio.h>
#include <gtk/gtk.h>
#include <glib.h>
#include <glib/gi18n.h>
#include <locale.h>
#include <gds-render/gds-render-gui.h>
#include <gds-render/command-line.h>
#include <gds-render/output-renderers/external-renderer.h>
#include <gds-render/version.h>
Include dependency graph for main.c:

Go to the source code of this file.

Data Structures

struct  application_data
 Structure containing The GtkApplication and a list containing the GdsRenderGui objects. More...
 

Functions

static void app_quit (GSimpleAction *action, GVariant *parameter, gpointer user_data)
 Callback for the menu entry 'Quit'. More...
 
static void app_about (GSimpleAction *action, GVariant *parameter, gpointer user_data)
 Callback for the 'About' menu entry. More...
 
static void gui_window_closed_callback (GdsRenderGui *gui, gpointer user_data)
 Called when a GUI main window is closed. More...
 
static void gapp_activate (GApplication *app, gpointer user_data)
 Activation of the GUI. More...
 
static int start_gui (int argc, char **argv)
 Start the graphical interface. More...
 
static void print_version (void)
 Print the application version string to stdout. More...
 
int main (int argc, char **argv)
 The "entry point" of the application. More...
 

Variables

static const GActionEntry app_actions []
 Contains the application menu entries. More...
 

Detailed Description

main.c

Author
Mario Hüttel mario.nosp@m..hue.nosp@m.ttel@.nosp@m.gmx..nosp@m.net

Definition in file main.c.

Function Documentation

◆ app_about()

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

Callback for the 'About' menu entry.

This function shows the about dialog.

Parameters
actionGSimpleAction, unused
parameterUnused.
user_dataUnused

Definition at line 85 of file main.c.

◆ app_quit()

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

Callback for the menu entry 'Quit'.

Destroys all GUIs contained in the application_data structure provided by user_data.

The complete suspension of all main windows leads to the termination of the GApplication.

Parameters
actionunused
parameterunused
user_dataapplication_data structure

Definition at line 58 of file main.c.

◆ gapp_activate()

static void gapp_activate ( GApplication *  app,
gpointer  user_data 
)
static

Activation of the GUI.

Parameters
appThe GApplication reference
user_dataUsed to store the individual GUI instances.

Definition at line 157 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ gui_window_closed_callback()

static void gui_window_closed_callback ( GdsRenderGui *  gui,
gpointer  user_data 
)
static

Called when a GUI main window is closed.

The GdsRenderGui object associated with the closed main window is removed from the list of open GUIs (user_data) and dereferenced.

Parameters
guiThe GUI instance the closed main window belongs to
user_dataList of GUIs

Definition at line 143 of file main.c.

Here is the caller graph for this function:

◆ main()

int main ( int  argc,
char **  argv 
)

The "entry point" of the application.

Parameters
argcNumber of command line parameters
argvCommand line parameters
Returns
Execution status of the application

Definition at line 254 of file main.c.

Here is the call graph for this function:

◆ print_version()

static void print_version ( void  )
static

Print the application version string to stdout.

Definition at line 242 of file main.c.

Here is the caller graph for this function:

◆ start_gui()

static int start_gui ( int  argc,
char **  argv 
)
static

Start the graphical interface.

This function starts the GUI. If there's already a running instance of this program, a second window will be created in that instance and the second one is terminated.

Parameters
argc
argv
Returns

Definition at line 185 of file main.c.

Here is the call graph for this function:
Here is the caller graph for this function:

Variable Documentation

◆ app_actions

const GActionEntry app_actions[]
static
Initial value:
= {
{ "quit", app_quit, NULL, NULL, NULL, {0} },
{ "about", app_about, NULL, NULL, NULL, {0} },
}
static void app_quit(GSimpleAction *action, GVariant *parameter, gpointer user_data)
Callback for the menu entry 'Quit'.
Definition: main.c:58
static void app_about(GSimpleAction *action, GVariant *parameter, gpointer user_data)
Callback for the 'About' menu entry.
Definition: main.c:85

Contains the application menu entries.

Definition at line 129 of file main.c.