wip: threading, window, etc.
parent
b960a591cb
commit
661867e0ba
@ -0,0 +1,7 @@
|
||||
[Desktop Entry]
|
||||
Name=SSB-GTK+
|
||||
Exec=ssb-gtk
|
||||
Terminal=false
|
||||
Type=Application
|
||||
Categories=GTK;
|
||||
StartupNotify=true
|
@ -0,0 +1,19 @@
|
||||
ssb_resources = gnome.compile_resources(
|
||||
'ssb-resources',
|
||||
join_paths('resources', 'eu.polonkai.gergely.SsbGtk.gresource.xml'),
|
||||
source_dir: 'resources',
|
||||
c_name: 'ssb')
|
||||
|
||||
desktop_file = i18n.merge_file(
|
||||
input: 'eu.polonkai.gergely.SsbGtk.desktop.in',
|
||||
output: 'eu.polonkai.gergely.SsbGtk.desktop',
|
||||
type: 'desktop',
|
||||
po_dir: '../po',
|
||||
install: true,
|
||||
install_dir: join_paths(get_option('datadir'), 'applications'))
|
||||
|
||||
desktop_utils = find_program('desktop-file-validate', required: false)
|
||||
if desktop_utils.found()
|
||||
test('Validate desktop file', desktop_utils,
|
||||
args: [desktop_file])
|
||||
endif
|
@ -0,0 +1,6 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<gresources>
|
||||
<gresource prefix="/eu/polonkai/gergely/SsbGtk">
|
||||
<file>ui/ssb-window.ui</file>
|
||||
</gresource>
|
||||
</gresources>
|
@ -0,0 +1,42 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<!-- Generated with glade 3.22.1 -->
|
||||
<interface>
|
||||
<requires lib="gtk+" version="3.20"/>
|
||||
<template class="SsbWindow" parent="GtkApplicationWindow">
|
||||
<property name="can_focus">False</property>
|
||||
<child type="titlebar">
|
||||
<object class="GtkHeaderBar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="title" translatable="yes">Secure Scuttlebutt</property>
|
||||
<property name="show_close_button">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkGrid">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">0</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkListBox">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="top_attach">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</template>
|
||||
</interface>
|
@ -1,9 +1,13 @@
|
||||
project('ssb-gtk', 'c', version: '0.0.1')
|
||||
|
||||
gnome = import('gnome')
|
||||
i18n = import('i18n')
|
||||
|
||||
glib_required = '>= 2.40'
|
||||
gtk_required = '>= 3.20'
|
||||
|
||||
glib = dependency('glib-2.0', version: glib_required)
|
||||
gtk = dependency('gtk+-3.0', version: gtk_required)
|
||||
|
||||
subdir('data')
|
||||
subdir('ssb-gtk')
|
||||
|
@ -1,8 +1,10 @@
|
||||
sources = [
|
||||
'main.c',
|
||||
'ssb-app.c',
|
||||
'ssb-window.c',
|
||||
'sbot.c',
|
||||
]
|
||||
|
||||
executable('ssb-gtk', sources,
|
||||
executable('ssb-gtk', sources, ssb_resources,
|
||||
dependencies: [glib, gtk],
|
||||
install: true)
|
||||
|
@ -0,0 +1,22 @@
|
||||
#include <glib.h>
|
||||
|
||||
gboolean do_scuttling = TRUE;
|
||||
|
||||
gpointer
|
||||
scuttle(gchar *ssb_dir)
|
||||
{
|
||||
gchar *config_file = g_strdup_printf("%s/config", ssb_dir);
|
||||
g_print("Read config file %s\n", config_file);
|
||||
g_free(config_file);
|
||||
|
||||
g_print("Starting scuttle\n");
|
||||
|
||||
while (do_scuttling) {
|
||||
g_usleep(G_USEC_PER_SEC);
|
||||
g_print("Scuttle…\n");
|
||||
}
|
||||
|
||||
g_print("Scuttling stopped\n");
|
||||
|
||||
return NULL;
|
||||
}
|
@ -0,0 +1,10 @@
|
||||
#ifndef __SBOT_H__
|
||||
# define __SBOT_H__
|
||||
|
||||
# include <glib.h>
|
||||
|
||||
extern gboolean do_scuttling;
|
||||
|
||||
gpointer scuttle(gchar *ssb_dir);
|
||||
|
||||
#endif /* __SBOT_H__ */
|
@ -0,0 +1,32 @@
|
||||
#include "ssb-window.h"\
|
||||
|
||||
struct _SsbWindow {
|
||||
GtkApplicationWindow parent_instance;
|
||||
};
|
||||
|
||||
G_DEFINE_TYPE(SsbWindow, ssb_window, GTK_TYPE_APPLICATION_WINDOW);
|
||||
|
||||
SsbWindow *
|
||||
ssb_window_new(SsbApp *app)
|
||||
{
|
||||
SsbWindow *window = g_object_new(SSB_TYPE_WINDOW, NULL);
|
||||
|
||||
gtk_window_set_application(GTK_WINDOW(window), GTK_APPLICATION(app));
|
||||
gtk_window_set_icon_name(GTK_WINDOW(window), "ssb-gtk");
|
||||
|
||||
return window;
|
||||
}
|
||||
|
||||
static void
|
||||
ssb_window_init(SsbWindow *window)
|
||||
{
|
||||
gtk_widget_init_template(GTK_WIDGET(window));
|
||||
}
|
||||
|
||||
static void
|
||||
ssb_window_class_init(SsbWindowClass *klass)
|
||||
{
|
||||
GtkWidgetClass *widget_class = GTK_WIDGET_CLASS(klass);
|
||||
|
||||
gtk_widget_class_set_template_from_resource(widget_class, "/eu/polonkai/gergely/SsbGtk/ui/ssb-window.ui");
|
||||
}
|
@ -0,0 +1,19 @@
|
||||
#ifndef __SSB_WINDOW_H__
|
||||
# define __SSB_WINDOW_H__
|
||||
|
||||
# include <glib-object.h>
|
||||
# include <gtk/gtk.h>
|
||||
|
||||
# include "ssb-app.h"
|
||||
|
||||
#define SSB_TYPE_WINDOW ssb_window_get_type()
|
||||
G_DECLARE_FINAL_TYPE(SsbWindow, ssb_window, SSB, WINDOW, GtkApplicationWindow)
|
||||
|
||||
G_BEGIN_DECLS
|
||||
|
||||
SsbWindow *ssb_window_new(SsbApp *app);
|
||||
|
||||
G_END_DECLS
|
||||
|
||||
|
||||
#endif /* __SSB_WINDOW_H__ */
|
Loading…
Reference in New Issue