diff --git a/Makefile.in b/Makefile.in
index b5077d1..1d4b42b 100644
--- a/Makefile.in
+++ b/Makefile.in
@@ -1,3 +1,4 @@
+
#
# "Software pw3270, desenvolvido com base nos códigos fontes do WC3270 e X3270
# (Paul Mattes Paul.Mattes@usa.net), de emulação de terminal 3270 para acesso a
@@ -51,6 +52,7 @@ DBGLIB=-L../../$(BINDIR)/Debug/lib -l3270
RLSLIB=-L../../$(BINDIR)/Release/lib -l3270
TMPDIR=$(PWD)/.tmp
GLOBAL_DEPS=$(PWD)/include/*.h $(PWD)/include/lib3270/*.h
+
#---[ Tools ]------------------------------------------------------------------
VALGRIND=@VALGRIND@
@@ -59,6 +61,14 @@ INSTALL=@INSTALL@
INSTALL_PROGRAM=@INSTALL_PROGRAM@
INSTALL_DATA=@INSTALL_DATA@
RPMBUILD=@RPMBUILD@
+CONVERT=@CONVERT@
+
+#---[ Rules ]------------------------------------------------------------------
+
+%.png: pixmaps/%.svg
+ifneq ($(CONVERT),no)
+ @$(CONVERT) $< --format=png > $@
+endif
#---[ Release targets ]--------------------------------------------------------
@@ -104,10 +114,11 @@ ifneq ($(RPMBUILD),no)
@rpmbuild -ts $(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz
endif
-
-$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz: clean
+$(PACKAGE_TARNAME)-$(PACKAGE_VERSION).tar.gz: clean $(PACKAGE_NAME).png $(PACKAGE_NAME)-logo.png
@rm -fr $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
@$(MKDIR) $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
+ @cp $(PACKAGE_NAME).png $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
+ @cp $(PACKAGE_NAME)-logo.png $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
@cp *.m4 $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
@./autogen.sh $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
@cp configure.ac $(TMPDIR)/$(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
diff --git a/configure.ac b/configure.ac
index 494fcfe..dd7e680 100644
--- a/configure.ac
+++ b/configure.ac
@@ -68,6 +68,17 @@ AC_SUBST(REXXC)
AC_PATH_TOOL([VALGRIND], [valgrind], [no])
AC_PATH_TOOL([REXXCONFIG], [oorexx-config], [no])
+AC_CHECK_PROGS(GZIP,[gzip],no)
+export GZIP;
+if test $GZIP = "no" ; then
+ AC_MSG_ERROR([Unable to find the gzip application]);
+fi
+AC_SUBST(GZIP)
+
+AC_CHECK_PROGS(CONVERT,[rsvg-convert],no)
+AC_SUBST(CONVERT)
+
+
#--[ Version & Revision ]-------------------------------------------------------------------------------------------------------------------------------------
AC_DEFINE(PACKAGE_REVISION,"SVN_REVISION")
diff --git a/pixmaps/pw3270-logo.svg b/pixmaps/pw3270-logo.svg
new file mode 100644
index 0000000..e18f0c8
--- /dev/null
+++ b/pixmaps/pw3270-logo.svg
@@ -0,0 +1,155 @@
+
+
+
+
diff --git a/pixmaps/pw3270.svg b/pixmaps/pw3270.svg
new file mode 100644
index 0000000..ebd2f7c
--- /dev/null
+++ b/pixmaps/pw3270.svg
@@ -0,0 +1,155 @@
+
+
+
+
diff --git a/pw3270.svg b/pw3270.svg
deleted file mode 100644
index ebd2f7c..0000000
--- a/pw3270.svg
+++ /dev/null
@@ -1,155 +0,0 @@
-
-
-
-
diff --git a/src/gtk/dialog.c b/src/gtk/dialog.c
index d8cc575..209c077 100644
--- a/src/gtk/dialog.c
+++ b/src/gtk/dialog.c
@@ -536,7 +536,26 @@
"Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02111-1307 "
"USA" );
- GtkAboutDialog *dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());
+ GtkAboutDialog * dialog = GTK_ABOUT_DIALOG(gtk_about_dialog_new());
+ gchar * filename = g_strdup_printf("%s-logo.png",g_get_application_name());
+ gchar * logo = build_data_filename(filename,NULL);
+
+ if(logo && g_file_test(filename,G_FILE_TEST_EXISTS))
+ {
+ GError *error = NULL;
+ GdkPixbuf * pix = gdk_pixbuf_new_from_file(filename,&error);
+
+ gtk_about_dialog_set_logo(dialog,pix);
+
+ if(!pix)
+ {
+ g_warning("Can't load %s: %s",filename,error->message);
+ g_error_free(error);
+ }
+ }
+
+ g_free(logo);
+ g_free(filename);
gtk_about_dialog_set_version(dialog, PACKAGE_VERSION );
gtk_about_dialog_set_copyright(dialog, "Copyright © 2008 Banco do Brasil S.A." );
diff --git a/src/gtk/v3270/accessible.c b/src/gtk/v3270/accessible.c
index 3f513c0..a2d7bab 100644
--- a/src/gtk/v3270/accessible.c
+++ b/src/gtk/v3270/accessible.c
@@ -66,10 +66,7 @@ G_DEFINE_TYPE_WITH_CODE (v3270Accessible, v3270_accessible, GTK_TYPE_ACCESSIBLE,
G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
)
-// G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init) )
-// G_IMPLEMENT_INTERFACE (ATK_TYPE_ACTION, atk_action_interface_init)
// G_IMPLEMENT_INTERFACE (ATK_TYPE_EDITABLE_TEXT, atk_editable_text_interface_init)
-// G_IMPLEMENT_INTERFACE (ATK_TYPE_TEXT, atk_text_interface_init)
/*--[ Implement ]------------------------------------------------------------------------------------*/
@@ -560,13 +557,44 @@ static AtkAttributeSet * v3270_accessible_get_default_attributes (AtkText *text)
return attributes;
}
+/**
+ * Creates an AtkAttributeSet which consists of the attributes explicitly
+ * set at the position offset in the text. start_offset and end_offset are set
+ * to the start and end of the range around offset where the attributes are invariant.
+ * Note that end_offset is the offset of the first character after the range.
+ * See the enum AtkTextAttribute for types of text attributes that can be returned.
+ * Note that other attributes may also be returned.
+ *
+ * @param text an AtkText
+ * @param offset the offset at which to get the attributes, -1 means the offset of the character to be inserted at the caret location.
+ * @param start_offset the address to put the start offset of the range
+ * @param end_offset the address to put the end offset of the range
+ *
+ * @return an AtkAttributeSet which contains the attributes explicitly set at offset.
+ */
static AtkAttributeSet * v3270_accessible_get_run_attributes(AtkText *text, gint offset, gint * start_offset, gint * end_offset)
{
GtkWidget * widget = gtk_accessible_get_widget (GTK_ACCESSIBLE (text));
+ H3270 * host;
AtkAttributeSet * attributes = NULL;
+ int start, end;
- if(!widget)
+ if(!(widget && GTK_IS_V3270(widget)))
+ {
+ trace("%s called with invalid widget %p ***************************",__FUNCTION__,widget);
return NULL;
+ }
+
+ host = v3270_get_session(widget);
+
+ if(offset == -1)
+ offset = lib3270_get_cursor_address(host);
+
+ if(!lib3270_get_field_bounds(host,offset,&start,&end))
+ {
+ *start_offset = start;
+ *end_offset = end;
+ }
trace("%s is incomplete ***********************",__FUNCTION__);
@@ -575,7 +603,6 @@ static AtkAttributeSet * v3270_accessible_get_run_attributes(AtkText *text, gint
// The direction of the text, if set. Values are "none", "ltr" or "rtl"
attributes = add_attribute(attributes, ATK_TEXT_ATTR_DIRECTION,atk_text_attribute_get_value(ATK_TEXT_ATTR_DIRECTION,gtk_widget_get_direction(widget)));
-
// ATK_TEXT_ATTR_LEFT_MARGIN
// The pixel width of the left margin
@@ -586,7 +613,9 @@ static AtkAttributeSet * v3270_accessible_get_run_attributes(AtkText *text, gint
// Either "true" or "false" indicating whether text is visible or not
// Either "true" or "false" indicating whether text is editable or not
- // ATK_TEXT_ATTR_EDITABLE
+ attributes = add_attribute( attributes,
+ ATK_TEXT_ATTR_EDITABLE,
+ lib3270_is_protected(host,offset) ? "false" : "true" );
// The background color. The value is an RGB value of the format "u,u,u"
// ATK_TEXT_ATTR_BG_COLOR
@@ -595,11 +624,31 @@ static AtkAttributeSet * v3270_accessible_get_run_attributes(AtkText *text, gint
// ATK_TEXT_ATTR_FG_COLOR
// The font family name
- // ATK_TEXT_ATTR_FAMILY_NAME
+ attributes = add_attribute( attributes,
+ ATK_TEXT_ATTR_FAMILY_NAME,
+ GTK_V3270(widget)->font_family );
return attributes;
}
+/*
+static gchar * v3270_accessible_get_text_after_offset(AtkText *text, gint offset, AtkTextBoundary boundary_type, gint *start_offset, gint *end_offset)
+{
+ // http://developer.gnome.org/atk/stable/AtkText.html#atk-text-get-text-after-offset
+ trace("WARNING: %s is incomplete",__FUNCTION__);
+
+}
+*/
+
+/*
+static gchar * v3270_accessible_get_text_before_offset(AtkText *text,gint offset,AtkTextBoundary boundary_type,gint *start_offset,gint *end_offset)
+{
+ // http://developer.gnome.org/atk/stable/AtkText.html#atk-text-get-text-before-offset
+ trace("WARNING: %s is incomplete",__FUNCTION__);
+
+}
+*/
+
static void atk_text_interface_init(AtkTextIface *iface)
{
iface->get_text = v3270_accessible_get_text;
@@ -621,17 +670,9 @@ static void atk_text_interface_init(AtkTextIface *iface)
iface->get_selection = v3270_accessible_get_selection;
iface->get_run_attributes = v3270_accessible_get_run_attributes;
iface->get_default_attributes = v3270_accessible_get_default_attributes;
+// iface->get_text_after_offset = v3270_accessible_get_text_after_offset;
+// iface->get_text_before_offset = v3270_accessible_get_text_before_offset;
-
-/*
-http://git.gnome.org/browse/gtk+/tree/gtk/a11y/gtklabelaccessible.c
-
- iface->get_text_before_offset = gtk_label_accessible_get_text_before_offset;
-
- iface->get_text_after_offset = gtk_label_accessible_get_text_after_offset;
-
-
-*/
}
static void v3270_accessible_init(v3270Accessible *widget)
@@ -740,11 +781,6 @@ static void atk_component_interface_init(AtkComponentIface *iface)
iface->grab_focus = v3270_accessible_grab_focus;
iface->get_layer = v3270_accessible_get_layer;
iface->set_size = v3270_accessible_set_size;
-
-/*
- iface->set_extents = gtk_widget_accessible_set_extents;
- iface->set_position = gtk_widget_accessible_set_position;
-*/
}
void v3270_acessible_set_state(GtkAccessible *obj, LIB3270_MESSAGE id)
diff --git a/src/gtk/v3270/private.h b/src/gtk/v3270/private.h
index 2a46500..49024ff 100644
--- a/src/gtk/v3270/private.h
+++ b/src/gtk/v3270/private.h
@@ -145,7 +145,7 @@ G_BEGIN_DECLS
int selection_addr; /** Selection addr */
// Font info
- gchar * font_family;
+ gchar * font_family;
cairo_font_weight_t font_weight;
cairo_scaled_font_t * font_scaled;
cairo_surface_t * surface;
--
libgit2 0.21.2