Mercurial > hg > octave-jordi
comparison src/graphics.h.in @ 8061:f819e8992367
Auto-generate base_properties
author | John W. Eaton <jwe@octave.org> |
---|---|
date | Tue, 26 Aug 2008 13:32:52 -0400 |
parents | 75c99d3f97d7 |
children | 41bc700ff642 |
comparison
equal
deleted
inserted
replaced
8060:09f32aac8fbc | 8061:f819e8992367 |
---|---|
1514 class OCTINTERP_API base_properties | 1514 class OCTINTERP_API base_properties |
1515 { | 1515 { |
1516 public: | 1516 public: |
1517 base_properties (const std::string& ty = "unknown", | 1517 base_properties (const std::string& ty = "unknown", |
1518 const graphics_handle& mh = graphics_handle (), | 1518 const graphics_handle& mh = graphics_handle (), |
1519 const graphics_handle& p = graphics_handle ()) | 1519 const graphics_handle& p = graphics_handle ()); |
1520 : beingdeleted ("beingdeleted", mh, false), | |
1521 busyaction ("parent", mh, "{queue}|cancel"), | |
1522 buttondownfcn ("buttondownfcn", mh, Matrix ()), | |
1523 children (), | |
1524 clipping ("clipping", mh, true), | |
1525 createfcn ("createfcn", mh, Matrix ()), | |
1526 deletefcn ("deletefcn", mh, Matrix ()), | |
1527 handlevisibility ("handlevisibility", mh, "{on}|callback|off"), | |
1528 hittest ("hittest", mh, true), | |
1529 interruptible ("interruptible", mh, true), | |
1530 parent ("parent", mh, p), | |
1531 selected ("selected", mh, false), | |
1532 selectionhighlight ("selectionhighlight", mh, true), | |
1533 tag ("tag", mh), | |
1534 type ("type", mh, ty), | |
1535 userdata ("userdata", mh, Matrix ()), | |
1536 visible ("visible", mh, true), | |
1537 __modified__ ("__modified__", mh, true), | |
1538 __myhandle__ (mh), | |
1539 uicontextmenu ("uicontextmenu", mh, graphics_handle ()) | |
1540 { | |
1541 beingdeleted.set_id (BEINGDELETED); | |
1542 busyaction.set_id (BUSYACTION); | |
1543 buttondownfcn.set_id (BUTTONDOWNFCN); | |
1544 clipping.set_id (CLIPPING); | |
1545 createfcn.set_id (CREATEFCN); | |
1546 deletefcn.set_id (DELETEFCN); | |
1547 handlevisibility.set_id (HANDLEVISIBILITY); | |
1548 hittest.set_id (HITTEST); | |
1549 interruptible.set_id (INTERRUPTIBLE); | |
1550 parent.set_id (PARENT); | |
1551 selected.set_id (SELECTED); | |
1552 selectionhighlight.set_id (SELECTIONHIGHLIGHT); | |
1553 tag.set_id (TAG); | |
1554 userdata.set_id (USERDATA); | |
1555 visible.set_id (VISIBLE); | |
1556 } | |
1557 | 1520 |
1558 virtual ~base_properties (void) { } | 1521 virtual ~base_properties (void) { } |
1559 | 1522 |
1560 virtual std::string graphics_object_name (void) const { return "unknonwn"; } | 1523 virtual std::string graphics_object_name (void) const { return "unknonwn"; } |
1561 | 1524 |
1583 | 1546 |
1584 virtual property get_property (const caseless_str&); | 1547 virtual property get_property (const caseless_str&); |
1585 | 1548 |
1586 bool has_property (const caseless_str&); | 1549 bool has_property (const caseless_str&); |
1587 | 1550 |
1588 std::string get_tag (void) const { return tag.string_value (); } | 1551 bool is_modified (void) const { return is___modified__ (); } |
1589 | |
1590 graphics_handle get_parent (void) const { return parent.handle_value (); } | |
1591 | |
1592 std::string get_type (void) const { return type.string_value (); } | |
1593 | |
1594 bool is_modified (void) const { return __modified__.is_on (); } | |
1595 | 1552 |
1596 graphics_handle get___myhandle__ (void) const { return __myhandle__; } | |
1597 | |
1598 std::string get_busyaction (void) const { return busyaction.current_value (); } | |
1599 | |
1600 octave_value get_buttondownfcn (void) const { return buttondownfcn.get (); } | |
1601 | |
1602 bool is_clipping (void) const { return clipping.is_on (); } | |
1603 std::string get_clipping (void) const { return clipping.current_value (); } | |
1604 | |
1605 void execute_createfcn (const octave_value& data = octave_value ()) const | |
1606 { createfcn.execute (data); } | |
1607 | |
1608 octave_value get_createfcn (void) const { return createfcn.get (); } | |
1609 | |
1610 void execute_deletefcn (const octave_value& data = octave_value ()) const | |
1611 { deletefcn.execute (data); } | |
1612 | |
1613 octave_value get_deletefcn (void) const { return deletefcn.get (); } | |
1614 | |
1615 std::string get_handlevisibility (void) const { return handlevisibility.current_value (); } | |
1616 | |
1617 bool is_hittest (void) const { return hittest.is_on (); } | |
1618 std::string get_hittest (void) const { return hittest.current_value (); } | |
1619 | |
1620 bool is_interruptible (void) const { return interruptible.is_on (); } | |
1621 std::string get_interruptible (void) const { return interruptible.current_value (); } | |
1622 | |
1623 bool is_selected (void) const { return selected.is_on (); } | |
1624 std::string get_selected (void) const { return selected.current_value (); } | |
1625 | |
1626 bool is_selectionhighlight (void) const { return selectionhighlight.is_on (); } | |
1627 std::string get_selectionhighlight (void) const { return selectionhighlight.current_value (); } | |
1628 | |
1629 octave_value get_uicontextmenu (void) const { return uicontextmenu.get (); } | |
1630 | |
1631 octave_value get_userdata (void) const { return userdata.get (); } | |
1632 | |
1633 bool is_visible (void) const { return visible.is_on (); } | |
1634 std::string get_visible (void) const { return visible.current_value (); } | |
1635 | |
1636 bool is_beingdeleted (void) const { return beingdeleted.is_on (); } | |
1637 std::string get_beingdeleted (void) const { return beingdeleted.current_value (); } | |
1638 | |
1639 virtual void remove_child (const graphics_handle& h); | 1553 virtual void remove_child (const graphics_handle& h); |
1640 | 1554 |
1641 virtual void adopt (const graphics_handle& h) | 1555 virtual void adopt (const graphics_handle& h) |
1642 { | 1556 { |
1643 octave_idx_type n = children.numel (); | 1557 octave_idx_type n = children.numel (); |
1658 | 1572 |
1659 void set_tag (const octave_value& val) { tag = val; } | 1573 void set_tag (const octave_value& val) { tag = val; } |
1660 | 1574 |
1661 void set_parent (const octave_value& val); | 1575 void set_parent (const octave_value& val); |
1662 | 1576 |
1663 void set_modified (const octave_value& val) { __modified__ = val; } | 1577 void set_children (const octave_value& val); |
1664 | 1578 |
1665 void set_busyaction (const octave_value& val) | 1579 void set_modified (const octave_value& val) { set___modified__ (val); } |
1666 { | 1580 |
1667 if (! error_state) | 1581 void set___modified__ (const octave_value& val) { __modified__ = val; } |
1668 { | |
1669 busyaction = val; | |
1670 mark_modified (); | |
1671 } | |
1672 } | |
1673 | |
1674 void set_buttondownfcn (const octave_value& val) | |
1675 { | |
1676 if (! error_state) | |
1677 { | |
1678 buttondownfcn = val; | |
1679 mark_modified (); | |
1680 } | |
1681 } | |
1682 | |
1683 void set_clipping (const octave_value& val) | |
1684 { | |
1685 if (! error_state) | |
1686 { | |
1687 clipping = val; | |
1688 mark_modified (); | |
1689 } | |
1690 } | |
1691 | |
1692 void set_createfcn (const octave_value& val) | |
1693 { | |
1694 if (! error_state) | |
1695 { | |
1696 createfcn = val; | |
1697 mark_modified (); | |
1698 } | |
1699 } | |
1700 | |
1701 void set_deletefcn (const octave_value& val) | |
1702 { | |
1703 if (! error_state) | |
1704 { | |
1705 deletefcn = val; | |
1706 mark_modified (); | |
1707 } | |
1708 } | |
1709 | |
1710 void set_handlevisibility (const octave_value& val) | |
1711 { | |
1712 if (! error_state) | |
1713 { | |
1714 handlevisibility = val; | |
1715 mark_modified (); | |
1716 } | |
1717 } | |
1718 | |
1719 void set_hittest (const octave_value& val) | |
1720 { | |
1721 if (! error_state) | |
1722 { | |
1723 hittest = val; | |
1724 mark_modified (); | |
1725 } | |
1726 } | |
1727 | |
1728 void set_interruptible (const octave_value& val) | |
1729 { | |
1730 if (! error_state) | |
1731 { | |
1732 interruptible = val; | |
1733 mark_modified (); | |
1734 } | |
1735 } | |
1736 | |
1737 void set_selected (const octave_value& val) | |
1738 { | |
1739 if (! error_state) | |
1740 { | |
1741 selected = val; | |
1742 mark_modified (); | |
1743 } | |
1744 } | |
1745 | |
1746 void set_selectionhighlight (const octave_value& val) | |
1747 { | |
1748 if (! error_state) | |
1749 { | |
1750 selectionhighlight = val; | |
1751 mark_modified (); | |
1752 } | |
1753 } | |
1754 | |
1755 void set_uicontextmenu (const octave_value& val) | |
1756 { | |
1757 if (! error_state) | |
1758 { | |
1759 uicontextmenu = val; | |
1760 mark_modified (); | |
1761 } | |
1762 } | |
1763 | |
1764 void set_userdata (const octave_value& val) | |
1765 { | |
1766 if (! error_state) | |
1767 { | |
1768 userdata = val; | |
1769 mark_modified (); | |
1770 } | |
1771 } | |
1772 | |
1773 virtual void set_visible (const octave_value& val) | |
1774 { | |
1775 if (! error_state) | |
1776 { | |
1777 visible = val; | |
1778 mark_modified (); | |
1779 } | |
1780 } | |
1781 | |
1782 void set_beingdeleted (const octave_value& val) | |
1783 { | |
1784 if (! error_state) | |
1785 { | |
1786 beingdeleted = val; | |
1787 mark_modified (); | |
1788 } | |
1789 } | |
1790 | |
1791 | |
1792 | 1582 |
1793 void reparent (const graphics_handle& new_parent) { parent = new_parent; } | 1583 void reparent (const graphics_handle& new_parent) { parent = new_parent; } |
1794 | 1584 |
1795 // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent | 1585 // Update data limits for AXIS_TYPE (xdata, ydata, etc.) in the parent |
1796 // axes object. | 1586 // axes object. |
1797 | 1587 |
1798 virtual void update_axis_limits (const std::string& axis_type) const; | 1588 virtual void update_axis_limits (const std::string& axis_type) const; |
1799 | 1589 |
1800 virtual void delete_children (void); | 1590 virtual void delete_children (void); |
1801 | 1591 |
1802 Matrix get_children (void) const { return children; } | 1592 static property_list::pval_map_type factory_defaults (void); |
1803 | 1593 |
1804 // FIXME -- these functions should be generated automatically by the | 1594 // FIXME -- these functions should be generated automatically by the |
1805 // genprops.awk script. | 1595 // genprops.awk script. |
1806 // | 1596 // |
1807 // EMIT_BASE_PROPERTIES_GET_FUNCTIONS | 1597 // EMIT_BASE_PROPERTIES_GET_FUNCTIONS |
1816 virtual bool is_yliminclude (void) const { return false; } | 1606 virtual bool is_yliminclude (void) const { return false; } |
1817 virtual bool is_zliminclude (void) const { return false; } | 1607 virtual bool is_zliminclude (void) const { return false; } |
1818 virtual bool is_climinclude (void) const { return false; } | 1608 virtual bool is_climinclude (void) const { return false; } |
1819 virtual bool is_aliminclude (void) const { return false; } | 1609 virtual bool is_aliminclude (void) const { return false; } |
1820 | 1610 |
1821 enum | |
1822 { | |
1823 BEINGDELETED = 0, | |
1824 BUSYACTION, | |
1825 BUTTONDOWNFCN, | |
1826 // CHILDREN, | |
1827 CLIPPING, | |
1828 CREATEFCN, | |
1829 DELETEFCN, | |
1830 HANDLEVISIBILITY, | |
1831 HITTEST, | |
1832 INTERRUPTIBLE, | |
1833 PARENT, | |
1834 SELECTED, | |
1835 SELECTIONHIGHLIGHT, | |
1836 TAG, | |
1837 USERDATA, | |
1838 VISIBLE | |
1839 }; | |
1840 | |
1841 protected: | 1611 protected: |
1842 // properties common to all objects | 1612 void set_dynamic (const caseless_str&, const octave_value&); |
1843 bool_property beingdeleted; | 1613 |
1844 radio_property busyaction; | 1614 octave_value get_dynamic (const caseless_str&) const; |
1845 callback_property buttondownfcn; | 1615 |
1846 // FIXME: use a property class for children | 1616 octave_value get_dynamic (bool all = false) const; |
1847 Matrix children; | 1617 |
1848 bool_property clipping; | 1618 property get_property_dynamic (const caseless_str&); |
1849 callback_property createfcn; | 1619 |
1850 callback_property deletefcn; | 1620 BEGIN_BASE_PROPERTIES |
1851 radio_property handlevisibility; | 1621 // properties common to all objects |
1852 bool_property hittest; | 1622 bool_property beingdeleted , "off" |
1853 bool_property interruptible; | 1623 radio_property busyaction , "{queue}|cancel" |
1854 handle_property parent; | 1624 callback_property buttondownfcn , Matrix () |
1855 bool_property selected; | 1625 // FIXME: use a property class for children |
1856 bool_property selectionhighlight; | 1626 Matrix children fs , Matrix () |
1857 string_property tag; | 1627 bool_property clipping , "on" |
1858 string_property type; | 1628 callback_property createfcn , Matrix () |
1859 any_property userdata; | 1629 callback_property deletefcn , Matrix () |
1860 bool_property visible; | 1630 radio_property handlevisibility , "{on}|callback|off" |
1861 // additional (octave-specific) properties | 1631 bool_property hittest , "on" |
1862 bool_property __modified__; | 1632 bool_property interruptible , "on" |
1863 graphics_handle __myhandle__; | 1633 handle_property parent fs , p |
1864 // FIXME: should this really be here? | 1634 bool_property selected , "off" |
1865 handle_property uicontextmenu; | 1635 bool_property selectionhighlight , "on" |
1636 string_property tag s , "" | |
1637 string_property type frs , ty | |
1638 any_property userdata , Matrix () | |
1639 bool_property visible , "on" | |
1640 // additional (octave-specific) properties | |
1641 bool_property __modified__ s , "on" | |
1642 graphics_handle __myhandle__ fhrs , mh | |
1643 // FIXME: should this really be here? | |
1644 handle_property uicontextmenu , graphics_handle () | |
1645 END_PROPERTIES | |
1866 | 1646 |
1867 protected: | 1647 protected: |
1868 struct cmp_caseless_str | 1648 struct cmp_caseless_str |
1869 { | 1649 { |
1870 bool operator () (const caseless_str &a, const caseless_str &b) const | 1650 bool operator () (const caseless_str &a, const caseless_str &b) const |