You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
ublexec/source/ublexec.h

127 lines
3.2 KiB

#include <gtk/gtk.h>
#include <gtk/gtkx.h>
#include <gtk/gtkspinbutton.h>
#include "ubl-utils.h"
#include <locale.h>
#include <stdio.h>
#include <unistd.h>
#include <stdlib.h>
#include <libintl.h>
#include <getopt.h>
#include "../compile/ubl-cmake.h"
#ifdef WEBKIT_FOUND
#include <webkit2/webkit2.h>
#endif
#include "ubl-strings.h"
#define WIKI_LINK "https://wiki.ublinux.ru/software/programs_and_utilities/all/ublexec"
#define _(String) gettext(String)
#define glade_path "/com/ublinux/ui/ublexec.glade"
#define banner_path "/com/ublinux/images/ublexec-banner.png"
#define CssPath "/com/ublinux/css/ublexec.css"
#define icon_path "com.ublinux.ublexec"
#define config_path yon_char_unite(yon_ubl_user_get_home_directory(),"/.config/",LocaleName,"/",LocaleName,".conf",NULL)
#define get_user_id_min_command "grep \"^UID_MIN\" /etc/login.defs |grep -vE '(nologin|false)$' | sed -e 's/\t/ /g' -e 's/ */ /g'|grep -oE \"[0-9]{1,}\""
#define get_user_id_max_command "grep \"^UID_MAX\" /etc/login.defs | sed -e 's/\t/ /g' -e 's/ */ /g'|grep -oE \"[0-9]{1,}\""
#define get_users_command "getent passwd |cut -d: -f1,3"
#define get_terminals_info_command "ublexec-cli -l|sed -e 's/\t/ /g' -e 's/^ *//g' -e 's/ */:/g'|cut -d':' -f1,2,3"
#define get_run_command_command "ublexec-cli -q"
#define LocalePath "/usr/share/locale"
#define LocaleName "ublexec"
typedef char* string;
string version_application;
char *local;
typedef struct {
int always_open_documentation;
int win_pos_x;
int win_pos_y;
int win_width;
int win_height;
int socket_id;
int load_socket_id;
int save_socket_id;
int lock_help;
int lock_save_local;
int lock_save_global;
int lock_load_global;
int user_id_min;
int user_id_max;
dictionary *terminals;
} config;
typedef struct {
char *name;
char *name_simple;
char *exec;
} terminal_info;
typedef struct {
//Standard
GtkWidget *Window;
GtkWidget *HatLabel;
GtkWidget *PlugBox;
GtkWidget *HeadOverlay;
GtkWidget *HeadImage;
GtkWidget *HeadBox;
GtkWidget *HeadTitleLabel;
GtkWidget *HeadInfoLabel;
GtkWidget *StatusBox;
GtkWidget *StatusIcon;
GtkWidget *StatusLabel;
GtkWidget *TargetNameEntry;
GtkWidget *AboutMenuItem;
GtkWidget *DocumentationMenuItem;
GtkWidget *targetNameEntry;
GtkWidget *chooseFileButton;
GtkWidget *chooseDesktopButton;
GtkWidget *runWithTerminalCheck;
GtkWidget *runWithTerminalCombo;
GtkWidget *runWithUserCheck;
GtkWidget *runWithUserPkexecCheck;
GtkWidget *runWithUserSuCheck;
GtkWidget *runWithUserSudoCheck;
GtkWidget *runWithUserCombo;
GtkWidget *priorityCheck;
GtkWidget *priorityScale;
GtkWidget *prioritySpinEntry;
GtkWidget *prioritySpinIncreaseButton;
GtkWidget *prioritySpinDecreaseButton;
GtkWidget *highestPriorityLabel;
GtkWidget *commandCheck;
GtkWidget *commandEntry;
GtkWidget *runButton;
// Custom
} main_window;
typedef struct {
GtkWidget *Window;
GtkWidget *HatText;
GtkWidget *HeaderText;
GtkWidget *InfoText;
GtkWidget *AlwaysOpenCheck;
GtkWidget *CloseButton;
GtkWidget *AcceptButton;
} documentation_confirmation_window;
main_window *setup_window();