of smyrna data directories gui, icons, etc.
icondir = $(pkgdatadir)/icons
AM_CPPFLAGS = \
+ -DSMYRNA_PATH=\""$(pkgdatadir)"\" \
-DSMYRNA_GLADE=\""$(guidir)/smyrna.glade"\" \
-DSMYRNA_ATTRS=\""$(guidir)/attrs.txt"\" \
-DSMYRNA_FONT=\""$(guidir)/arial.tga"\" \
GLfloat lmodel_ambient[] = { 0.2f, 0.2f, 0.2f, 1.0f };
GLfloat local_view[] = { 0.0 };
+ char* smyrna_font;
#ifdef WIN32
#define SMYRNA_FONT "c:/arial.tga"
// using -DSMYRNA_FONT from Makefile.am and configure.ac
#endif
- g_print("loading font....%i\n", fontLoad(SMYRNA_FONT));
+ if ((smyrna_font = smyrnaPath ("gui/arial.tga"))) {
+ g_print("loading font....%i\n", fontLoad(smyrna_font));
+ free (smyrna_font);
+ }
+ else g_print("loading font....%i\n", fontLoad(SMYRNA_FONT));
/*** OpenGL BEGIN ***/
if (!gdk_gl_drawable_gl_begin(gldrawable, glcontext))
#endif
GladeXML *xml;
GtkWidget *widget;
- xml = glade_xml_new(SMYRNA_GLADE, NULL, NULL);
+ xml = glade_xml_new(smyrnaGlade, NULL, NULL);
widget = glade_xml_get_widget(xml, "listPoints");
gtk_clist_set_column_title((GtkCList *) widget, 0, "Def");
gint result = 0;
- xml = glade_xml_new(SMYRNA_GLADE, NULL, NULL);
+ xml = glade_xml_new(smyrnaGlade, NULL, NULL);
gladewidget = glade_xml_get_widget(xml, "entryGraphFileName");
//signals
char *pch;
int ind = 0;
int attrcount = 0;
+ static char* smyrna_attrs;
+
+ if (!smyrna_attrs) {
+ if (!(smyrna_attrs = smyrnaPath ("gui/attrs.txt")))
+ smyrna_attrs = SMYRNA_ATTRS;
+ }
+
//loads attributes from a text file
- file = fopen(SMYRNA_ATTRS, "r");
+ file = fopen(smyrna_attrs, "r");
if (file != NULL) {
while (fgets(line, sizeof line, file) != NULL) {
pch = strtok(line, ",");
#include "viewport.h"
#include "menucallbacks.h"
#include "gltemplate.h"
+#include "memory.h"
#ifdef ENABLE_NLS
#include "libintl.h"
#endif
+#ifdef G_OS_WIN32
gchar *package_prefix;
gchar *package_data_dir;
+#endif
gchar *package_locale_dir;
+static char* smyrnaDir;
+char* smyrnaGlade;
+
+char*
+smyrnaPath (char* suffix)
+{
+ char* buf;
+ if (!smyrnaDir) return NULL;
+ buf = N_NEW(strlen(smyrnaDir)+strlen(suffix)+2,char);
+ sprintf (buf, "%s/%s", smyrnaDir, suffix);
+ return buf;
+}
int main(int argc, char *argv[])
{
GdkGLConfig *glconfig;
+ char* smyrnaDir;
load_attributes();
+ smyrnaDir = getenv ("SMYRNA_PATH");
+
#ifdef G_OS_WIN32
package_prefix =
g_win32_get_package_installation_directory(NULL, NULL);
package_data_dir = g_build_filename(package_prefix, "share", NULL);
package_locale_dir =
g_build_filename(package_prefix, "share", "locale", NULL);
+#else
+ if (smyrnaDir)
+ package_locale_dir = g_build_filename(smyrnaDir, "locale", NULL);
+ else
+ package_locale_dir = g_build_filename(SMYRNA_PATH, "locale", NULL);
#endif /* # */
#ifdef ENABLE_NLS
bindtextdomain(GETTEXT_PACKAGE, package_locale_dir);
#ifdef _WIN32
#define GTKTOPVIEW_ICONSDIR "C:\\Projects\\ATT\\GTK\\GTKTest2\\GUI\\images\\"
#endif
- xml = glade_xml_new(SMYRNA_GLADE, NULL, NULL);
+ if (!(smyrnaGlade = smyrnaPath ("gui/smyrna.glade"))) {
+ smyrnaGlade = SMYRNA_GLADE;
+ }
+ xml = glade_xml_new(smyrnaGlade, NULL, NULL);
gladewidget = glade_xml_get_widget(xml, "frmMain");
gtk_widget_show(gladewidget);
g_signal_connect((gpointer) gladewidget, "destroy",
#ifdef G_OS_WIN32
g_free(package_prefix);
g_free(package_data_dir);
- g_free(package_locale_dir);
#endif
+ g_free(package_locale_dir);
clear_viewport(view);
return 0;
}
extern ViewInfo *view;
extern GtkMessageDialog *Dlg;
extern int respond;
+extern char* smyrnaPath (char* suffix);
+extern char* smyrnaGlade;
extern void glexpose();
#define SMYRNA_ICON_FISHEYE "c:/fisheye.raw"
#endif
+static char* smyrna_icon_pan;
+static char* smyrna_icon_zoom;
+static char* smyrna_icon_zoomplus;
+static char* smyrna_icon_zoomminus;
+static char* smyrna_icon_fisheye;
+
+#define SET_PATH(var,sfx,dflt) if (!(var=smyrnaPath(sfx))) var = dflt
glCompSet *glcreate_gl_topview_menu()
{
glCompPanel *p;
glCompButton *b;
glCompLabel *l;
+
+ if (!smyrna_icon_pan) {
+ SET_PATH(smyrna_icon_pan,"icons/pan.raw",SMYRNA_ICON_PAN);
+ SET_PATH(smyrna_icon_zoom,"icons/zoom.raw",SMYRNA_ICON_ZOOM);
+ SET_PATH(smyrna_icon_zoomplus,"icons/zoomplus.raw",SMYRNA_ICON_ZOOMPLUS);
+ SET_PATH(smyrna_icon_zoomminus,"icons/zoomminus.raw",SMYRNA_ICON_ZOOMMINUS);
+ SET_PATH(smyrna_icon_fisheye,"icons/fisheye.raw",SMYRNA_ICON_FISHEYE);
+ }
+
s->panelcount = 0;
s->panels = '\0';
s->buttoncount = 0;
void local_zoom(topview * t);
void originate_distorded_coordinates(topview * t);
_BB void on_host_alpha_change(GtkWidget * widget, gpointer user_data);
-double dist(double x1, double y1, double x2, double y2);
-double G(double x);
+/* double dist(double x1, double y1, double x2, double y2); */
+/* double G(double x); */
glCompSet *glcreate_gl_topview_menu();
void fisheye_polar(double x_focus, double y_focus, topview * t);
void prepare_topological_fisheye(topview * t);