Add GTK test client, rework API with callbacks, make library
This commit is contained in:
parent
59068bbd13
commit
36bbcbe182
9 changed files with 1161 additions and 132 deletions
35
gtk-gui/Makefile
Normal file
35
gtk-gui/Makefile
Normal file
|
@ -0,0 +1,35 @@
|
|||
# Copyright (C) 2011 Nils Faerber <nils.faerber@kernelconcepts.de>
|
||||
|
||||
$(pkg-config --libs --cflags glib-2.0) $(pkg-config --libs --cflags dbus-glib-1) $(pkg-config --libs --cflags dbus-1)
|
||||
|
||||
# prefix for installation and search path (like icons)
|
||||
PREFIX = /usr/local/
|
||||
CFLAGS = -DDEBUG -Wall -O2 -Wl,--export-dynamic $(CCFLAGS) -I.. `pkg-config --cflags glib-2.0` `pkg-config --cflags dbus-glib-1` `pkg-config --cflags dbus-1` `pkg-config --cflags gtk+-2.0`
|
||||
#CFLAGS = -Wall -O2 $(CCFLAGS)
|
||||
|
||||
LDFLAGS = `pkg-config --libs glib-2.0` `pkg-config --libs dbus-glib-1` `pkg-config --libs dbus-1` `pkg-config --libs gtk+-2.0` `pkg-config --libs gmodule-export-2.0` -L.. -lmetawatch
|
||||
|
||||
PRGNAME = mw-client
|
||||
|
||||
MEMBERS = mw-client
|
||||
|
||||
# no need to change anything below this line
|
||||
# ------------------------------------------
|
||||
.SUFFIXES: .d .c
|
||||
|
||||
CFLAGS += -MD -DPREFIX=\"$(PREFIX)\" $(OPTIONS)
|
||||
LDFLAGS += $(CLDFLAGS)
|
||||
|
||||
SOURCES = $(patsubst %,%.c,$(MEMBERS))
|
||||
OBJS = $(patsubst %,%.o,$(MEMBERS))
|
||||
DEPS = $(patsubst %,%.d,$(MEMBERS))
|
||||
|
||||
all: $(PRGNAME)
|
||||
|
||||
$(PRGNAME): $(OBJS)
|
||||
$(CC) -o $@ $^ $(LDFLAGS)
|
||||
|
||||
clean:
|
||||
rm -f *.o *.d $(PRGNAME)
|
||||
|
||||
-include $(DEPS)
|
395
gtk-gui/mw-client.c
Normal file
395
gtk-gui/mw-client.c
Normal file
|
@ -0,0 +1,395 @@
|
|||
#include <stdio.h>
|
||||
#include <sys/types.h>
|
||||
#include <sys/stat.h>
|
||||
#include <fcntl.h>
|
||||
#include <unistd.h>
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include <time.h>
|
||||
#include <termios.h>
|
||||
#include <ctype.h>
|
||||
|
||||
#include <errno.h>
|
||||
|
||||
#include <bluetooth/bluetooth.h>
|
||||
#include <bluetooth/rfcomm.h>
|
||||
|
||||
#include <glib.h>
|
||||
#include <dbus/dbus.h>
|
||||
#include <dbus/dbus-glib.h>
|
||||
#include <dbus/dbus-glib-lowlevel.h>
|
||||
|
||||
#include <gtk/gtk.h>
|
||||
|
||||
#include <metawatch.h>
|
||||
#include <crc16ccitt.h>
|
||||
#include <mw_utility.h>
|
||||
|
||||
typedef struct {
|
||||
// GMainLoop *mloop;
|
||||
GtkBuilder *builder;
|
||||
mwdevice_t mwdevice;
|
||||
unsigned char rcvbuf[128];
|
||||
int rcvbuf_pos;
|
||||
int con_fd; /* console input fd */
|
||||
char cmdline[128];
|
||||
int cmdline_pos;
|
||||
int bat_timeout_id;
|
||||
} mwdata_t;
|
||||
|
||||
|
||||
gboolean battery_level_get_timeout(gpointer user_data)
|
||||
{
|
||||
mwdata_t *mdata = (mwdata_t *)user_data;
|
||||
|
||||
mw_send_frame(&mdata->mwdevice, MW_READ_BATTERY_VOLTAGE_MSG, 0, NULL, 0);
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void mw_get_battery_voltage_response_cb(mwdevice_t *mwdevice, unsigned short *voltage, unsigned char *pgood, unsigned char *charging, void *user_data)
|
||||
{
|
||||
mwdata_t *mdata = (mwdata_t *)user_data;
|
||||
gdouble volt = *voltage;
|
||||
GtkAdjustment *batadjust;
|
||||
GtkProgressBar *batbar;
|
||||
gchar batstr[32];
|
||||
|
||||
batadjust = GTK_ADJUSTMENT(gtk_builder_get_object (mdata->builder, "bat_adjust"));
|
||||
gtk_adjustment_set_value(batadjust, volt);
|
||||
batbar = GTK_PROGRESS_BAR(gtk_builder_get_object (mdata->builder, "battery_status_bar"));
|
||||
snprintf(batstr, 32, "%4.0fmV", volt);
|
||||
gtk_progress_bar_set_text(batbar, batstr);
|
||||
}
|
||||
|
||||
void on_rtc_button_clicked (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
mwdata_t *mdata = (mwdata_t *)user_data;
|
||||
|
||||
mw_send_frame(&mdata->mwdevice, MW_GET_REAL_TIME_CLOCK, 0, NULL, 0);
|
||||
}
|
||||
|
||||
void on_notify_button_clicked (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
mwdata_t *mdata = (mwdata_t *)user_data;
|
||||
|
||||
}
|
||||
|
||||
void bitmap_read(mwdevice_t *mwdevice, char *filename)
|
||||
{
|
||||
int ffd, ret;
|
||||
char rbuf[256];
|
||||
unsigned int width, height, i;
|
||||
#ifdef DEBUG
|
||||
unsigned int x, y;
|
||||
#endif
|
||||
unsigned int rowlength;
|
||||
unsigned char *bmapbuf;
|
||||
// unsigned char mw_buf[24];
|
||||
|
||||
ffd = open(filename, O_RDONLY);
|
||||
if (ffd < 0) {
|
||||
perror("open");
|
||||
return;
|
||||
};
|
||||
ret = read(ffd, rbuf, 3);
|
||||
if (rbuf[0] != 'P' || rbuf[1] != '4') {
|
||||
fprintf(stderr, "not a PBM file\n");
|
||||
return;
|
||||
}
|
||||
memset(rbuf, 0, 256);
|
||||
i = 0;
|
||||
do {
|
||||
ret = read(ffd, (rbuf+i), 1);
|
||||
} while (!isspace(rbuf[i++]));
|
||||
width = atoi(rbuf);
|
||||
|
||||
memset(rbuf, 0, 256);
|
||||
i = 0;
|
||||
do {
|
||||
ret = read(ffd, (rbuf+i), 1);
|
||||
} while (!isspace(rbuf[i++]));
|
||||
height = atoi(rbuf);
|
||||
|
||||
rowlength = ((width / 8) + 1);
|
||||
|
||||
bmapbuf = malloc(rowlength * height);
|
||||
|
||||
ret = read(ffd, bmapbuf, rowlength * height);
|
||||
close(ffd);
|
||||
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "row length = %d bytes\n", rowlength);
|
||||
fprintf(stderr, "bitmap resolution is %d x %d\n", width, height);
|
||||
fprintf(stderr, "read %d of %d bytes\n", ret, rowlength * height);
|
||||
fprintf(stderr, "\n");
|
||||
for (y=0; y<height; y++) {
|
||||
for (x=0; x<rowlength; x++) {
|
||||
for (i=0; i<8; i++)
|
||||
fprintf(stderr, "%c", (bmapbuf[(y*rowlength)+x] & (1<<(7-i))) ? '.' : ' ');
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
}
|
||||
fprintf(stderr, "\n");
|
||||
#endif
|
||||
|
||||
/* reverse bits and invert the bmap */
|
||||
bmap_buffer_flipinvert(1, 1, bmapbuf, rowlength * height);
|
||||
/* send the buffer to the watch */
|
||||
mw_send_bitmap(mwdevice, MW_SCREEN_MODE_IDLE, width, height, 31, bmapbuf, rowlength * height);
|
||||
/* update the display */
|
||||
mw_update_display(mwdevice, MW_SCREEN_MODE_IDLE, 1);
|
||||
|
||||
free(bmapbuf);
|
||||
}
|
||||
|
||||
void on_bitmap_button_clicked (GtkButton *button, gpointer user_data)
|
||||
{
|
||||
mwdata_t *mdata = (mwdata_t *)user_data;
|
||||
GtkWindow *mwin;
|
||||
GtkWidget *dialog;
|
||||
|
||||
mwin = GTK_WINDOW (gtk_builder_get_object (mdata->builder, "main_win"));
|
||||
dialog = gtk_file_chooser_dialog_new("Bitmap File", mwin, GTK_FILE_CHOOSER_ACTION_OPEN,
|
||||
GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
|
||||
GTK_STOCK_OPEN, GTK_RESPONSE_ACCEPT,
|
||||
NULL);
|
||||
if (gtk_dialog_run(GTK_DIALOG(dialog)) == GTK_RESPONSE_ACCEPT) {
|
||||
gchar *filename;
|
||||
filename = gtk_file_chooser_get_filename(GTK_FILE_CHOOSER(dialog));
|
||||
/* send bitmap file */
|
||||
bitmap_read(&mdata->mwdevice, filename);
|
||||
}
|
||||
gtk_widget_destroy(dialog);
|
||||
}
|
||||
|
||||
void mw_get_real_time_clock_response_cb(mwdevice_t *mwdevice, struct tm *mw_tm, void *user_data)
|
||||
{
|
||||
mwdata_t *mdata = (mwdata_t *)user_data;
|
||||
GtkButton *rtc_button;
|
||||
gchar label_str[256];
|
||||
|
||||
//g_print("watch RTC is %s\n", asctime(mw_tm));
|
||||
rtc_button = GTK_BUTTON (gtk_builder_get_object (mdata->builder, "rtc_button"));
|
||||
snprintf(label_str, 256, "RTC\n%s", asctime(mw_tm));
|
||||
label_str[strlen(label_str)-1] = 0;
|
||||
gtk_button_set_label(rtc_button, label_str);
|
||||
}
|
||||
|
||||
int open_socket(bdaddr_t *bdaddr, uint8_t channel)
|
||||
{
|
||||
struct sockaddr_rc addr;
|
||||
int sk, opt;
|
||||
|
||||
sk = socket(PF_BLUETOOTH, SOCK_STREAM, BTPROTO_RFCOMM);
|
||||
if (sk < 0) {
|
||||
fprintf(stderr, "Can't create socket: %s (%d)\n",
|
||||
strerror(errno), errno);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/*
|
||||
f = 1;
|
||||
if (setsockopt(sk, SOL_BLUETOOTH, BT_FLUSHABLE, &f, sizeof(f)) < 0) {
|
||||
fprintf(stderr, "Can't set flushable: %s (%d)\n",
|
||||
strerror(errno), errno);
|
||||
return -1;
|
||||
}
|
||||
*/
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.rc_family = AF_BLUETOOTH;
|
||||
bacpy(&addr.rc_bdaddr, BDADDR_ANY);
|
||||
|
||||
if (bind(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
|
||||
fprintf(stderr, "Can't bind socket: %s (%d)\n",
|
||||
strerror(errno), errno);
|
||||
close(sk);
|
||||
return -1;
|
||||
}
|
||||
|
||||
/* Set link mode */
|
||||
opt = 0;
|
||||
opt |= RFCOMM_LM_MASTER;
|
||||
opt |= RFCOMM_LM_AUTH;
|
||||
/*
|
||||
opt |= RFCOMM_LM_ENCRYPT;
|
||||
opt |= RFCOMM_LM_SECURE;
|
||||
*/
|
||||
if (opt && setsockopt(sk, SOL_RFCOMM, RFCOMM_LM, &opt, sizeof(opt)) < 0) {
|
||||
fprintf(stderr, "Can't set RFCOMM link mode: %s (%d)",
|
||||
strerror(errno), errno);
|
||||
close(sk);
|
||||
return -1;
|
||||
}
|
||||
|
||||
memset(&addr, 0, sizeof(addr));
|
||||
addr.rc_family = AF_BLUETOOTH;
|
||||
bacpy(&addr.rc_bdaddr, bdaddr);
|
||||
addr.rc_channel = channel;
|
||||
|
||||
if (connect(sk, (struct sockaddr *) &addr, sizeof(addr)) < 0) {
|
||||
fprintf(stderr, "Can't connect: %s (%d)\n",
|
||||
strerror(errno), errno);
|
||||
close(sk);
|
||||
return -1;
|
||||
}
|
||||
|
||||
return sk;
|
||||
}
|
||||
|
||||
void baswap(bdaddr_t *dst, const bdaddr_t *src)
|
||||
{
|
||||
register unsigned char *d = (unsigned char *) dst;
|
||||
register const unsigned char *s = (const unsigned char *) src;
|
||||
register int i;
|
||||
|
||||
for (i = 0; i < 6; i++)
|
||||
d[i] = s[5-i];
|
||||
}
|
||||
|
||||
int bachk(const char *str)
|
||||
{
|
||||
if (!str)
|
||||
return -1;
|
||||
|
||||
if (strlen(str) != 17)
|
||||
return -1;
|
||||
|
||||
while (*str) {
|
||||
if (!isxdigit(*str++))
|
||||
return -1;
|
||||
|
||||
if (!isxdigit(*str++))
|
||||
return -1;
|
||||
|
||||
if (*str == 0)
|
||||
break;
|
||||
|
||||
if (*str++ != ':')
|
||||
return -1;
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
int str2ba(const char *str, bdaddr_t *ba)
|
||||
{
|
||||
bdaddr_t b;
|
||||
int i;
|
||||
|
||||
if (bachk(str) < 0) {
|
||||
memset(ba, 0, sizeof(*ba));
|
||||
return -1;
|
||||
}
|
||||
|
||||
for (i = 0; i < 6; i++, str += 3)
|
||||
b.b[i] = strtol(str, NULL, 16);
|
||||
|
||||
baswap(ba, &b);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
gboolean handle_mw_io(GIOChannel *mw_io, GIOCondition condition, gpointer udata)
|
||||
{
|
||||
mwdata_t *mdata = (mwdata_t *)udata;
|
||||
int rcvd;
|
||||
int processed;
|
||||
|
||||
rcvd = read(mdata->mwdevice.mw_fd, mdata->rcvbuf+mdata->rcvbuf_pos, 64);
|
||||
#ifdef DEBUG
|
||||
fprintf(stderr, "read %d bytes:\n", rcvd);
|
||||
#endif
|
||||
if (rcvd > 0) {
|
||||
#ifdef DEBUG
|
||||
dump_frame(mdata->rcvbuf, rcvd);
|
||||
#endif
|
||||
processed = decode_frame(&mdata->mwdevice, mdata->rcvbuf, rcvd);
|
||||
if (processed > 0) {
|
||||
mdata->rcvbuf_pos -= processed;
|
||||
if (mdata->rcvbuf_pos > 0)
|
||||
g_print("Warning: RCV buffer not yet empty\n");
|
||||
} else {
|
||||
/* we should rather seek forward for a next potential frame start */
|
||||
mdata->rcvbuf_pos = 0;
|
||||
}
|
||||
}
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
void
|
||||
on_window_destroy (GtkObject *object, gpointer user_data)
|
||||
{
|
||||
gtk_main_quit ();
|
||||
}
|
||||
|
||||
|
||||
|
||||
int
|
||||
main (int argc, char *argv[])
|
||||
{
|
||||
GtkBuilder *builder;
|
||||
GtkWidget *window;
|
||||
GIOChannel *mw_io;
|
||||
bdaddr_t btaddr;
|
||||
int mw_fd;
|
||||
struct termios tmwfd;
|
||||
mwdata_t mdata;
|
||||
|
||||
|
||||
if (argc != 2) {
|
||||
fprintf(stderr, "Usage:\n\t%s <devicename>\n", argv[0]);
|
||||
return 1;
|
||||
};
|
||||
|
||||
crc16ccitt_init();
|
||||
|
||||
if (str2ba(argv[1], &btaddr))
|
||||
return 1;
|
||||
mw_fd = open_socket(&btaddr, 1);
|
||||
if (mw_fd < 0) {
|
||||
return 1;
|
||||
} else {
|
||||
fprintf(stderr, "connected to %s\n", argv[1]);
|
||||
};
|
||||
|
||||
/* we have a connection, RFCOMM socket is on mw_fd */
|
||||
/* make the tty raw */
|
||||
tcgetattr(mw_fd, &tmwfd);
|
||||
cfmakeraw(&tmwfd);
|
||||
tmwfd.c_oflag |= ONLCR | OPOST;
|
||||
tmwfd.c_lflag |= ISIG;
|
||||
tcsetattr(mw_fd, TCSANOW, &tmwfd);
|
||||
|
||||
mdata.mwdevice.mw_fd = mw_fd;
|
||||
mdata.rcvbuf_pos = 0;
|
||||
memset(mdata.rcvbuf, 0, 128);
|
||||
|
||||
gtk_init (&argc, &argv);
|
||||
|
||||
builder = gtk_builder_new ();
|
||||
gtk_builder_add_from_file (builder, "mw-client.glade", NULL);
|
||||
mdata.builder = builder;
|
||||
window = GTK_WIDGET (gtk_builder_get_object (builder, "main_win"));
|
||||
gtk_builder_connect_signals (builder, &mdata);
|
||||
|
||||
//g_object_unref (G_OBJECT (builder));
|
||||
|
||||
gtk_widget_show (window);
|
||||
|
||||
mw_io = g_io_channel_unix_new(mw_fd);
|
||||
g_io_add_watch(mw_io, G_IO_IN | G_IO_PRI | G_IO_ERR | G_IO_HUP, handle_mw_io, &mdata);
|
||||
|
||||
mw_init(&mdata.mwdevice, mw_fd);
|
||||
|
||||
mw_set_get_real_time_clock_response_cb(&mdata.mwdevice, mw_get_real_time_clock_response_cb, &mdata);
|
||||
mw_set_get_battery_voltage_response_cb(&mdata.mwdevice, mw_get_battery_voltage_response_cb, &mdata);
|
||||
|
||||
// mw_send_frame(&mdata.mwdevice, MW_READ_BATTERY_VOLTAGE_MSG, 0, NULL, 0);
|
||||
|
||||
mdata.bat_timeout_id = g_timeout_add_seconds(10, battery_level_get_timeout, &mdata);
|
||||
|
||||
gtk_main ();
|
||||
|
||||
return 0;
|
||||
}
|
433
gtk-gui/mw-client.glade
Normal file
433
gtk-gui/mw-client.glade
Normal file
|
@ -0,0 +1,433 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<interface>
|
||||
<requires lib="gtk+" version="2.24"/>
|
||||
<!-- interface-naming-policy project-wide -->
|
||||
<object class="GtkAdjustment" id="bat_adjust">
|
||||
<property name="lower">3500</property>
|
||||
<property name="upper">4200</property>
|
||||
<property name="value">3700</property>
|
||||
<property name="step_increment">1</property>
|
||||
<property name="page_increment">10</property>
|
||||
</object>
|
||||
<object class="GtkWindow" id="main_win">
|
||||
<property name="can_focus">False</property>
|
||||
<signal name="destroy-event" handler="gtk_main_quit" swapped="no"/>
|
||||
<signal name="delete-event" handler="gtk_main_quit" swapped="no"/>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuBar" id="menubar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="label" translatable="yes">_Datei</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem1">
|
||||
<property name="label">gtk-new</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem2">
|
||||
<property name="label">gtk-open</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem3">
|
||||
<property name="label">gtk-save</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem4">
|
||||
<property name="label">gtk-save-as</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkSeparatorMenuItem" id="separatormenuitem1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem5">
|
||||
<property name="label">gtk-quit</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
<signal name="activate" handler="gtk_main_quit" swapped="no"/>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="label" translatable="yes">_Bearbeiten</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem6">
|
||||
<property name="label">gtk-cut</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem7">
|
||||
<property name="label">gtk-copy</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem8">
|
||||
<property name="label">gtk-paste</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem9">
|
||||
<property name="label">gtk-delete</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="label" translatable="yes">_Ansicht</property>
|
||||
<property name="use_underline">True</property>
|
||||
</object>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkMenuItem" id="menuitem4">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="label" translatable="yes">_Hilfe</property>
|
||||
<property name="use_underline">True</property>
|
||||
<child type="submenu">
|
||||
<object class="GtkMenu" id="menu3">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkImageMenuItem" id="imagemenuitem10">
|
||||
<property name="label">gtk-about</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<property name="use_underline">True</property>
|
||||
<property name="use_stock">True</property>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkTable" id="table1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="n_rows">3</property>
|
||||
<property name="n_columns">3</property>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="F_button_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>F</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="E_button_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>E</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="D_button_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>D</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVButtonBox" id="vbuttonbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkLabel" id="A_button_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>A</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="B_button_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>B</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="C_button_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes"><b>C</b></property>
|
||||
<property name="use_markup">True</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">False</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="notify_button">
|
||||
<property name="label" translatable="yes">Notification</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="on_notify_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="bitmap_button">
|
||||
<property name="label" translatable="yes">Bitmap</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="on_bitmap_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="vibrate_button">
|
||||
<property name="label" translatable="yes">Vibration</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="on_vibrate_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
<property name="top_attach">2</property>
|
||||
<property name="bottom_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkButton" id="rtc_button">
|
||||
<property name="label" translatable="yes">RTC</property>
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">True</property>
|
||||
<property name="receives_default">True</property>
|
||||
<property name="use_action_appearance">False</property>
|
||||
<signal name="clicked" handler="on_rtc_button_clicked" swapped="no"/>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<placeholder/>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkVBox" id="vbox2">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<child>
|
||||
<object class="GtkProgressBar" id="battery_status_bar">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="show_text">True</property>
|
||||
<property name="fraction">0.28571428571428592</property>
|
||||
<property name="text" translatable="yes">Battery</property>
|
||||
<property name="adjustment">bat_adjust</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">0</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkLabel" id="power_status_label">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="label" translatable="yes">unknown</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">2</property>
|
||||
<property name="right_attach">3</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkDrawingArea" id="drawingarea1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="left_attach">1</property>
|
||||
<property name="right_attach">2</property>
|
||||
<property name="top_attach">1</property>
|
||||
<property name="bottom_attach">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">True</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">1</property>
|
||||
</packing>
|
||||
</child>
|
||||
<child>
|
||||
<object class="GtkStatusbar" id="statusbar1">
|
||||
<property name="visible">True</property>
|
||||
<property name="can_focus">False</property>
|
||||
<property name="spacing">2</property>
|
||||
</object>
|
||||
<packing>
|
||||
<property name="expand">False</property>
|
||||
<property name="fill">True</property>
|
||||
<property name="position">2</property>
|
||||
</packing>
|
||||
</child>
|
||||
</object>
|
||||
</child>
|
||||
</object>
|
||||
</interface>
|
Loading…
Add table
Add a link
Reference in a new issue