aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-14 02:47:49 +0000
committerHans-Christoph Steiner <eighthave@users.sourceforge.net>2007-11-14 02:47:49 +0000
commit869a0b602e1c02dc6384534b2399976617b99b90 (patch)
tree91a4f2c4b8c62e09634a4b8333a053e219a7ce65
parent939636fa8ee51551013ef91cc86820747f69eb42 (diff)
added tkwidgets build targets from template; made target to build shared library, but it's not used yet
svn path=/trunk/externals/tkwidgets/; revision=8998
-rw-r--r--Makefile17
-rw-r--r--shared/tkwidgets.c52
-rw-r--r--shared/tkwidgets.h55
3 files changed, 124 insertions, 0 deletions
diff --git a/Makefile b/Makefile
new file mode 100644
index 0000000..b8e8987
--- /dev/null
+++ b/Makefile
@@ -0,0 +1,17 @@
+TARGET := $(shell pwd | sed 's|.*/\(.*\)$$|\1|')
+EXTERNALS_ROOT := $(shell pwd | sed 's|^\(/.*externals\).*|\1|')
+
+default:
+ make -C $(EXTERNALS_ROOT) $(TARGET)
+
+install:
+ make -C $(EXTERNALS_ROOT) $(TARGET)_install
+
+clean:
+ make -C $(EXTERNALS_ROOT) $(TARGET)_clean
+
+test_locations:
+ make -C $(EXTERNALS_ROOT) test_locations
+
+etags:
+ etags *.[ch] ../../pd/src/*.[ch] /usr/include/*.h /usr/include/sys/*.h
diff --git a/shared/tkwidgets.c b/shared/tkwidgets.c
new file mode 100644
index 0000000..13fe311
--- /dev/null
+++ b/shared/tkwidgets.c
@@ -0,0 +1,52 @@
+/*
+ Copyright (C) 2007 Free Software Foundation
+ written by Hans-Christoph Steiner <hans@at.or.at>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ This is the shared library for the tkwidgets library for Pd.
+
+*/
+
+#include "tkwidgets.h"
+#include <stdio.h>
+
+/* this should be part of the Pd API */
+t_symbol *canvas_getname(t_canvas *canvas)
+{
+ char buf[MAXPDSTRING];
+ snprintf(buf, MAXPDSTRING, ".x%lx", (unsigned long)glist_getcanvas(canvas));
+ return gensym(buf);
+}
+
+
+void draw_inlets(t_object *x, t_glist *glist, int firsttime,
+ int total_inlets, int total_outlets)
+{
+ // TODO perhaps I should try to use glist_drawiofor() from g_text.c
+}
+
+
+
+void draw_handle()
+{
+ // TODO draw resize handle when selected in editmode
+}
+
+
+void draw_resize_window()
+{
+ // TODO draw the resize window while resizing
+}
diff --git a/shared/tkwidgets.h b/shared/tkwidgets.h
new file mode 100644
index 0000000..7ecd521
--- /dev/null
+++ b/shared/tkwidgets.h
@@ -0,0 +1,55 @@
+/*
+ Copyright (C) 2007 Free Software Foundation
+ written by Hans-Christoph Steiner <hans@at.or.at>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ 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., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+ This is the shared library for the tkwidgets library for Pd.
+
+*/
+
+#ifndef __TKWIDGETS_H
+#define __TKWIDGETS_H
+
+#include "m_pd.h"
+#include "m_imp.h"
+#include "g_canvas.h"
+
+#ifdef _MSC_VER
+#pragma warning( disable : 4244 )
+#pragma warning( disable : 4305 )
+#endif
+
+/* size and offset for the resizing handle */
+#define TKW_HANDLE_HEIGHT 15
+#define TKW_HANDLE_WIDTH 15
+#define TKW_HANDLE_INSET -2
+
+
+/* this should be part of the Pd API */
+t_symbol *canvas_getname(t_canvas *canvas);
+// TODO perhaps I should try to use glist_drawiofor() from g_text.c
+void draw_inlets(t_object *x, t_glist *glist, int firsttime,
+ int total_inlets, int total_outlets);
+void draw_handle(); // TODO draw resize handle when selected in editmode
+void draw_resize_window(); // TODO draw the resize window while resizing
+
+
+
+
+
+
+
+#endif /* NOT g_TK_WIDGETS_H */