From e5d4423045cf3683c7ba55cf49540de297b004d6 Mon Sep 17 00:00:00 2001 From: Dominic Radermacher Date: Sun, 17 Jul 2016 09:30:06 +0200 Subject: [PATCH] removed (nonfunctional) ptouch-gtk --- Makefile.am | 8 ++-- configure | 45 ------------------ configure.ac | 1 - src/ptouch-gtk.c | 119 ----------------------------------------------- 4 files changed, 3 insertions(+), 170 deletions(-) delete mode 100644 src/ptouch-gtk.c diff --git a/Makefile.am b/Makefile.am index e6f56fa..23e8539 100644 --- a/Makefile.am +++ b/Makefile.am @@ -1,12 +1,10 @@ AUTOMAKE_OPTIONS = subdir-objects AM_CPPFLAGS= -DLOCALEDIR='"$(localedir)"' -AM_CFLAGS=-g -std=c11 -Wall -O3 -I$(top_srcdir)/include `pkg-config --cflags gtk+-3.0` +AM_CFLAGS=-g -std=c11 -Wall -O3 -I$(top_srcdir)/include SUBDIRS = po ACLOCAL_AMFLAGS = -I m4 -EXTRA_DIST = config.rpath m4/ChangeLog Makefile.old data/ptouch.ui -bin_PROGRAMS=ptouch-print ptouch-gtk +EXTRA_DIST = config.rpath m4/ChangeLog Makefile.old +bin_PROGRAMS=ptouch-print noinst_HEADERS=include/ptouch.h include/gettext.h ptouch_print_SOURCES=src/ptouch-print.c src/libptouch.c include/ptouch.h include/gettext.h ptouch_print_LDFLAGS=-lusb-1.0 -lgd -ptouch_gtk_SOURCES=src/ptouch-gtk.c src/libptouch.c include/ptouch.h include/gettext.h -ptouch_gtk_LDFLAGS=-lusb-1.0 -lgd `pkg-config --libs gtk+-3.0` -rdynamic diff --git a/configure b/configure index dba1fa2..fd2c9af 100755 --- a/configure +++ b/configure @@ -6522,51 +6522,6 @@ _ACEOF fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for gtk_init in -lgtk-3" >&5 -$as_echo_n "checking for gtk_init in -lgtk-3... " >&6; } -if ${ac_cv_lib_gtk_3_gtk_init+:} false; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lgtk-3 $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char gtk_init (); -int -main () -{ -return gtk_init (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_gtk_3_gtk_init=yes -else - ac_cv_lib_gtk_3_gtk_init=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_gtk_3_gtk_init" >&5 -$as_echo "$ac_cv_lib_gtk_3_gtk_init" >&6; } -if test "x$ac_cv_lib_gtk_3_gtk_init" = xyes; then : - cat >>confdefs.h <<_ACEOF -#define HAVE_LIBGTK_3 1 -_ACEOF - - LIBS="-lgtk-3 $LIBS" - -fi - # Checks for header files. { $as_echo "$as_me:${as_lineno-$LINENO}: checking for ANSI C header files" >&5 diff --git a/configure.ac b/configure.ac index cbd9077..6c25ac4 100644 --- a/configure.ac +++ b/configure.ac @@ -34,7 +34,6 @@ AM_GNU_GETTEXT_VERSION(0.19) # Checks for libraries. AC_CHECK_LIB([gd], [gdImageStringFT]) AC_CHECK_LIB([usb-1.0], [libusb_init]) -AC_CHECK_LIB([gtk-3], [gtk_init]) # Checks for header files. AC_CHECK_HEADERS([fcntl.h libintl.h stdint.h stdlib.h string.h]) diff --git a/src/ptouch-gtk.c b/src/ptouch-gtk.c deleted file mode 100644 index 91a24d1..0000000 --- a/src/ptouch-gtk.c +++ /dev/null @@ -1,119 +0,0 @@ -/* - ptouch-gtk - Simple GTK+ UI to print labels on a Brother P-Touch - - Copyright (C) 2015 Dominic Radermacher - - This program is free software; you can redistribute it and/or modify it - under the terms of the GNU General Public License version 3 as - published by the Free Software Foundation - - This program is distributed in the hope that it will be useful, but - WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. - See the GNU General Public License for more details. - - You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software Foundation, - Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA -*/ - -#include - -#define BUILDER_XML_FILE "data/ptouch.ui" - -typedef struct -{ - GtkWidget *window; - GtkWidget *statusbar; - GtkWidget *text_view; - guint statusbar_context_id; -} PTouchEditor; - -/* prototypes */ -void error_message(const gchar *message); -void on_window_destroy(GtkWidget *object, PTouchEditor *editor); -gboolean on_window_delete_event(GtkWidget *widget, GdkEvent *event, - PTouchEditor *editor); -gboolean init_app(PTouchEditor *editor); - -void error_message(const gchar *message) -{ - GtkWidget *dialog; - g_warning(message); /* log to terminal window */ - /* create an error message dialog and display modally to the user */ - dialog = gtk_message_dialog_new(NULL, - GTK_DIALOG_MODAL | GTK_DIALOG_DESTROY_WITH_PARENT, - GTK_MESSAGE_ERROR, GTK_BUTTONS_OK, message); - gtk_window_set_title(GTK_WINDOW(dialog), "Error!"); - gtk_dialog_run(GTK_DIALOG(dialog)); - gtk_widget_destroy(dialog); -} - -void on_window_destroy(GtkWidget *object, PTouchEditor *editor) -{ - gtk_main_quit(); -} - -gboolean on_window_delete_event(GtkWidget *widget, GdkEvent *event, PTouchEditor *editor) -{ - return FALSE; /* propogate event */ -} - -void show_about(PTouchEditor *editor) -{ - static const gchar * const authors[] = { - "Dominic Radermacher ", - NULL - }; - static const gchar copyright[] = "Copyright \xc2\xa9 2015 Dominic Radermacher"; - static const gchar comments[] = "PTouch Print"; - - gtk_show_about_dialog(GTK_WINDOW(editor->window), "authors", authors, - "comments", comments, "copyright", copyright, - "version", "0.1", - "website", "http://mockmoon-cybernetics.ch/", - "program-name", "ptouch-gtk", - "logo-icon-name", GTK_STOCK_EDIT, NULL); -} - -gboolean init_app(PTouchEditor *editor) -{ - GtkBuilder *builder; - GError *err=NULL; - guint id; - - /* use GtkBuilder to build our interface from the XML file */ - builder = gtk_builder_new(); - if (gtk_builder_add_from_file(builder, BUILDER_XML_FILE, &err) == 0) { - error_message(err->message); - g_error_free(err); - return FALSE; - } - /* get the widgets which will be referenced in callbacks */ - editor->window = GTK_WIDGET(gtk_builder_get_object(builder, "window")); - editor->statusbar = GTK_WIDGET(gtk_builder_get_object(builder, "statusbar")); - editor->text_view = GTK_WIDGET(gtk_builder_get_object(builder, "text_view")); - gtk_builder_connect_signals(builder, editor); - /* free memory used by GtkBuilder object */ - g_object_unref(G_OBJECT(builder)); - gtk_window_set_default_icon_name(GTK_STOCK_EDIT); - /* setup and initialize our statusbar */ - id = gtk_statusbar_get_context_id(GTK_STATUSBAR(editor->statusbar), - "PTouch Print GTK+"); - editor->statusbar_context_id = id; - return TRUE; -} - -int main(int argc, char *argv[]) -{ - PTouchEditor *editor; - - editor = g_slice_new(PTouchEditor); - gtk_init(&argc, &argv); - if (init_app(editor) == FALSE) { - return 1; /* error loading UI */ - } - gtk_widget_show(editor->window); - gtk_main(); - g_slice_free(PTouchEditor, editor); -} -- 2.39.2