python-efl: Copy over the experimental work on py-elm from my github repo:
- split modules, cuts down development time - Sphinx documentation - new work flow for list type widgets while keeping compatibility with the old one - input events now have functional propagation and support for mouse wheel events - assorted fixes SVN revision: 84027
This commit is contained in:
parent
43f9b5f319
commit
37aba43fb1
|
@ -0,0 +1,526 @@
|
|||
# Copyright (c) 2008 Simon Busch
|
||||
# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
|
||||
#
|
||||
# This file is part of python-elementary.
|
||||
#
|
||||
# python-elementary is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# python-elementary 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 Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with python-elementary. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from actionslider import Actionslider
|
||||
from background import Background
|
||||
from box import Box
|
||||
from bubble import Bubble
|
||||
from button import Button
|
||||
from calendar_elm import Calendar, CalendarMark
|
||||
from check import Check
|
||||
from clock import Clock
|
||||
from colorselector import Colorselector, ColorselectorPaletteItem
|
||||
from configuration import Configuration, \
|
||||
config_finger_size_get, config_finger_size_set, \
|
||||
config_tooltip_delay_get, config_tooltip_delay_set, \
|
||||
focus_highlight_animate_get, focus_highlight_animate_set, \
|
||||
focus_highlight_enabled_get, focus_highlight_enabled_set, \
|
||||
preferred_engine_get, preferred_engine_set, \
|
||||
engine_get, engine_set, scale_get, scale_set, \
|
||||
cursor_engine_only_get, cursor_engine_only_set
|
||||
from conformant import Conformant
|
||||
from ctxpopup import Ctxpopup, CtxpopupItem
|
||||
from datetime_elm import Datetime
|
||||
from dayselector import Dayselector
|
||||
from diskselector import Diskselector, DiskselectorItem
|
||||
from entry import Entry
|
||||
from fileselector import Fileselector
|
||||
from fileselector_button import FileselectorButton
|
||||
from fileselector_entry import FileselectorEntry
|
||||
from flip import Flip
|
||||
from flipselector import FlipSelector, FlipSelectorItem
|
||||
from frame import Frame
|
||||
from general import init, shutdown, run, exit, coords_finger_size_adjust, policy_set, policy_get
|
||||
from gengrid import Gengrid, GengridItem, GengridItemClass
|
||||
from genlist import Genlist, GenlistItem, GenlistItemClass
|
||||
from gesture_layer import GestureLayer
|
||||
from grid import Grid
|
||||
from hover import Hover
|
||||
from hoversel import Hoversel, HoverselItem
|
||||
from icon import Icon
|
||||
from image import Image
|
||||
from index import Index, IndexItem
|
||||
from innerwindow import InnerWindow
|
||||
from label import Label
|
||||
from layout import Layout
|
||||
from layout_class import LayoutClass
|
||||
from list import List, ListItem
|
||||
from map import Map, MapName, MapOverlay, MapOverlayBubble, MapOverlayCircle, MapOverlayClass, MapOverlayLine, MapOverlayPolygon, MapOverlayRoute, MapOverlayScale
|
||||
from mapbuf import Mapbuf
|
||||
from menu import Menu, MenuItem, MenuSeparatorItem
|
||||
from multibuttonentry import MultiButtonEntry, MultiButtonEntryItem
|
||||
from naviframe import Naviframe, NaviframeItem
|
||||
from need import *
|
||||
from notify import Notify
|
||||
from object import Object
|
||||
from object_item import ObjectItem
|
||||
from panel import Panel
|
||||
from panes import Panes
|
||||
from photo import Photo
|
||||
from photocam import Photocam
|
||||
from plug import Plug
|
||||
from popup import Popup, PopupItem
|
||||
from progressbar import Progressbar
|
||||
from radio import Radio
|
||||
from scroller import Scroller
|
||||
from segment_control import SegmentControl, SegmentControlItem
|
||||
from separator import Separator
|
||||
from slider import Slider
|
||||
from slideshow import Slideshow, SlideshowItem, SlideshowItemClass
|
||||
from spinner import Spinner
|
||||
from table import Table
|
||||
from theme import Theme, theme_overlay_add, theme_extension_add
|
||||
from thumb import Thumb
|
||||
from toolbar import Toolbar, ToolbarItem
|
||||
from transit import Transit
|
||||
from video import Video, Player
|
||||
from web import Web
|
||||
from window import Window, StandardWindow
|
||||
|
||||
from actionslider import \
|
||||
ELM_ACTIONSLIDER_NONE, \
|
||||
ELM_ACTIONSLIDER_LEFT, \
|
||||
ELM_ACTIONSLIDER_CENTER, \
|
||||
ELM_ACTIONSLIDER_RIGHT, \
|
||||
ELM_ACTIONSLIDER_ALL
|
||||
|
||||
from background import \
|
||||
ELM_BG_OPTION_CENTER, \
|
||||
ELM_BG_OPTION_SCALE, \
|
||||
ELM_BG_OPTION_STRETCH, \
|
||||
ELM_BG_OPTION_TILE, \
|
||||
ELM_BG_OPTION_LAST
|
||||
|
||||
from box import \
|
||||
ELM_BOX_LAYOUT_HORIZONTAL, \
|
||||
ELM_BOX_LAYOUT_VERTICAL, \
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL, \
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL, \
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL, \
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL, \
|
||||
ELM_BOX_LAYOUT_FLOW_HORIZONTAL, \
|
||||
ELM_BOX_LAYOUT_FLOW_VERTICAL, \
|
||||
ELM_BOX_LAYOUT_STACK
|
||||
|
||||
from bubble import \
|
||||
ELM_BUBBLE_POS_TOP_LEFT, \
|
||||
ELM_BUBBLE_POS_TOP_RIGHT, \
|
||||
ELM_BUBBLE_POS_BOTTOM_LEFT, \
|
||||
ELM_BUBBLE_POS_BOTTOM_RIGHT
|
||||
|
||||
from calendar_elm import \
|
||||
ELM_CALENDAR_UNIQUE, \
|
||||
ELM_CALENDAR_DAILY, \
|
||||
ELM_CALENDAR_WEEKLY, \
|
||||
ELM_CALENDAR_MONTHLY, \
|
||||
ELM_CALENDAR_ANNUALLY, \
|
||||
ELM_CALENDAR_LAST_DAY_OF_MONTH, \
|
||||
ELM_CALENDAR_SELECT_MODE_DEFAULT, \
|
||||
ELM_CALENDAR_SELECT_MODE_ALWAYS, \
|
||||
ELM_CALENDAR_SELECT_MODE_NONE, \
|
||||
ELM_CALENDAR_SELECT_MODE_ONDEMAND
|
||||
|
||||
from clock import \
|
||||
ELM_CLOCK_EDIT_DEFAULT, \
|
||||
ELM_CLOCK_EDIT_HOUR_DECIMAL, \
|
||||
ELM_CLOCK_EDIT_HOUR_UNIT, \
|
||||
ELM_CLOCK_EDIT_MIN_DECIMAL, \
|
||||
ELM_CLOCK_EDIT_MIN_UNIT, \
|
||||
ELM_CLOCK_EDIT_SEC_DECIMAL, \
|
||||
ELM_CLOCK_EDIT_SEC_UNIT, \
|
||||
ELM_CLOCK_EDIT_ALL
|
||||
|
||||
from entry import \
|
||||
ELM_CNP_MODE_MARKUP, \
|
||||
ELM_CNP_MODE_NO_IMAGE, \
|
||||
ELM_CNP_MODE_PLAINTEXT
|
||||
|
||||
from colorselector import \
|
||||
ELM_COLORSELECTOR_PALETTE, \
|
||||
ELM_COLORSELECTOR_COMPONENTS, \
|
||||
ELM_COLORSELECTOR_BOTH
|
||||
|
||||
from ctxpopup import \
|
||||
ELM_CTXPOPUP_DIRECTION_DOWN, \
|
||||
ELM_CTXPOPUP_DIRECTION_RIGHT, \
|
||||
ELM_CTXPOPUP_DIRECTION_LEFT, \
|
||||
ELM_CTXPOPUP_DIRECTION_UP, \
|
||||
ELM_CTXPOPUP_DIRECTION_UNKNOWN
|
||||
|
||||
from datetime_elm import \
|
||||
ELM_DATETIME_YEAR, \
|
||||
ELM_DATETIME_MONTH, \
|
||||
ELM_DATETIME_DATE, \
|
||||
ELM_DATETIME_HOUR, \
|
||||
ELM_DATETIME_MINUTE, \
|
||||
ELM_DATETIME_AMPM
|
||||
|
||||
from calendar_elm import \
|
||||
ELM_DAY_SUNDAY, \
|
||||
ELM_DAY_MONDAY, \
|
||||
ELM_DAY_TUESDAY, \
|
||||
ELM_DAY_WEDNESDAY, \
|
||||
ELM_DAY_THURSDAY, \
|
||||
ELM_DAY_FRIDAY, \
|
||||
ELM_DAY_SATURDAY, \
|
||||
ELM_DAY_LAST
|
||||
|
||||
from dayselector import \
|
||||
ELM_DAYSELECTOR_SUN, \
|
||||
ELM_DAYSELECTOR_MON, \
|
||||
ELM_DAYSELECTOR_TUE, \
|
||||
ELM_DAYSELECTOR_WED, \
|
||||
ELM_DAYSELECTOR_THU, \
|
||||
ELM_DAYSELECTOR_FRI, \
|
||||
ELM_DAYSELECTOR_SAT
|
||||
|
||||
from fileselector import \
|
||||
ELM_FILESELECTOR_LIST, \
|
||||
ELM_FILESELECTOR_GRID
|
||||
|
||||
from flip import \
|
||||
ELM_FLIP_DIRECTION_UP, \
|
||||
ELM_FLIP_DIRECTION_DOWN, \
|
||||
ELM_FLIP_DIRECTION_LEFT, \
|
||||
ELM_FLIP_DIRECTION_RIGHT, \
|
||||
ELM_FLIP_INTERACTION_NONE, \
|
||||
ELM_FLIP_INTERACTION_ROTATE, \
|
||||
ELM_FLIP_INTERACTION_CUBE, \
|
||||
ELM_FLIP_INTERACTION_PAGE, \
|
||||
ELM_FLIP_ROTATE_Y_CENTER_AXIS, \
|
||||
ELM_FLIP_ROTATE_X_CENTER_AXIS, \
|
||||
ELM_FLIP_ROTATE_XZ_CENTER_AXIS, \
|
||||
ELM_FLIP_ROTATE_YZ_CENTER_AXIS, \
|
||||
ELM_FLIP_CUBE_LEFT, \
|
||||
ELM_FLIP_CUBE_RIGHT, \
|
||||
ELM_FLIP_CUBE_UP, \
|
||||
ELM_FLIP_CUBE_DOWN, \
|
||||
ELM_FLIP_PAGE_LEFT, \
|
||||
ELM_FLIP_PAGE_RIGHT, \
|
||||
ELM_FLIP_PAGE_UP, \
|
||||
ELM_FLIP_PAGE_DOWN
|
||||
|
||||
from object import \
|
||||
ELM_FOCUS_PREVIOUS, \
|
||||
ELM_FOCUS_NEXT
|
||||
|
||||
from genlist import \
|
||||
ELM_GENLIST_ITEM_NONE, \
|
||||
ELM_GENLIST_ITEM_TREE, \
|
||||
ELM_GENLIST_ITEM_GROUP, \
|
||||
ELM_GENLIST_ITEM_MAX, \
|
||||
ELM_GENLIST_ITEM_FIELD_ALL, \
|
||||
ELM_GENLIST_ITEM_FIELD_TEXT, \
|
||||
ELM_GENLIST_ITEM_FIELD_CONTENT, \
|
||||
ELM_GENLIST_ITEM_FIELD_STATE
|
||||
|
||||
from gesture_layer import \
|
||||
ELM_GESTURE_STATE_UNDEFINED, \
|
||||
ELM_GESTURE_STATE_START, \
|
||||
ELM_GESTURE_STATE_MOVE, \
|
||||
ELM_GESTURE_STATE_END, \
|
||||
ELM_GESTURE_STATE_ABORT, \
|
||||
ELM_GESTURE_FIRST, \
|
||||
ELM_GESTURE_N_TAPS, \
|
||||
ELM_GESTURE_N_LONG_TAPS, \
|
||||
ELM_GESTURE_N_DOUBLE_TAPS, \
|
||||
ELM_GESTURE_N_TRIPLE_TAPS, \
|
||||
ELM_GESTURE_MOMENTUM, \
|
||||
ELM_GESTURE_N_LINES, \
|
||||
ELM_GESTURE_N_FLICKS, \
|
||||
ELM_GESTURE_ZOOM, \
|
||||
ELM_GESTURE_ROTATE
|
||||
|
||||
from hover import \
|
||||
ELM_HOVER_AXIS_NONE, \
|
||||
ELM_HOVER_AXIS_HORIZONTAL, \
|
||||
ELM_HOVER_AXIS_VERTICAL, \
|
||||
ELM_HOVER_AXIS_BOTH
|
||||
|
||||
from icon import \
|
||||
ELM_ICON_NONE, \
|
||||
ELM_ICON_FILE, \
|
||||
ELM_ICON_STANDARD
|
||||
|
||||
#~ from object import \
|
||||
#~ ELM_ILLUME_COMMAND_FOCUS_BACK, \
|
||||
#~ ELM_ILLUME_COMMAND_FOCUS_FORWARD, \
|
||||
#~ ELM_ILLUME_COMMAND_FOCUS_HOME, \
|
||||
#~ ELM_ILLUME_COMMAND_CLOSE
|
||||
|
||||
from image import \
|
||||
ELM_IMAGE_ORIENT_NONE, \
|
||||
ELM_IMAGE_ROTATE_90, \
|
||||
ELM_IMAGE_ROTATE_180, \
|
||||
ELM_IMAGE_ROTATE_270, \
|
||||
ELM_IMAGE_FLIP_HORIZONTAL, \
|
||||
ELM_IMAGE_FLIP_VERTICAL, \
|
||||
ELM_IMAGE_FLIP_TRANSPOSE, \
|
||||
ELM_IMAGE_FLIP_TRANSVERSE
|
||||
|
||||
from entry import \
|
||||
ELM_INPUT_PANEL_LANG_AUTOMATIC, \
|
||||
ELM_INPUT_PANEL_LANG_ALPHABET, \
|
||||
ELM_INPUT_PANEL_LAYOUT_NORMAL, \
|
||||
ELM_INPUT_PANEL_LAYOUT_NUMBER, \
|
||||
ELM_INPUT_PANEL_LAYOUT_EMAIL, \
|
||||
ELM_INPUT_PANEL_LAYOUT_URL, \
|
||||
ELM_INPUT_PANEL_LAYOUT_PHONENUMBER, \
|
||||
ELM_INPUT_PANEL_LAYOUT_IP, \
|
||||
ELM_INPUT_PANEL_LAYOUT_MONTH, \
|
||||
ELM_INPUT_PANEL_LAYOUT_NUMBERONLY, \
|
||||
ELM_INPUT_PANEL_LAYOUT_INVALID, \
|
||||
ELM_INPUT_PANEL_LAYOUT_HEX, \
|
||||
ELM_INPUT_PANEL_LAYOUT_TERMINAL, \
|
||||
ELM_INPUT_PANEL_LAYOUT_PASSWORD, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH, \
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND
|
||||
|
||||
from list import \
|
||||
ELM_LIST_COMPRESS, \
|
||||
ELM_LIST_SCROLL, \
|
||||
ELM_LIST_LIMIT
|
||||
|
||||
from map import \
|
||||
ELM_MAP_OVERLAY_TYPE_NONE, \
|
||||
ELM_MAP_OVERLAY_TYPE_DEFAULT, \
|
||||
ELM_MAP_OVERLAY_TYPE_CLASS, \
|
||||
ELM_MAP_OVERLAY_TYPE_GROUP, \
|
||||
ELM_MAP_OVERLAY_TYPE_BUBBLE, \
|
||||
ELM_MAP_OVERLAY_TYPE_ROUTE, \
|
||||
ELM_MAP_OVERLAY_TYPE_LINE, \
|
||||
ELM_MAP_OVERLAY_TYPE_POLYGON, \
|
||||
ELM_MAP_OVERLAY_TYPE_CIRCLE, \
|
||||
ELM_MAP_OVERLAY_TYPE_SCALE, \
|
||||
ELM_MAP_ROUTE_METHOD_FASTEST, \
|
||||
ELM_MAP_ROUTE_METHOD_SHORTEST, \
|
||||
ELM_MAP_ROUTE_METHOD_LAST, \
|
||||
ELM_MAP_ROUTE_TYPE_MOTOCAR, \
|
||||
ELM_MAP_ROUTE_TYPE_BICYCLE, \
|
||||
ELM_MAP_ROUTE_TYPE_FOOT, \
|
||||
ELM_MAP_ROUTE_TYPE_LAST, \
|
||||
ELM_MAP_SOURCE_TYPE_TILE, \
|
||||
ELM_MAP_SOURCE_TYPE_ROUTE, \
|
||||
ELM_MAP_SOURCE_TYPE_NAME, \
|
||||
ELM_MAP_SOURCE_TYPE_LAST, \
|
||||
ELM_MAP_ZOOM_MODE_MANUAL, \
|
||||
ELM_MAP_ZOOM_MODE_AUTO_FIT, \
|
||||
ELM_MAP_ZOOM_MODE_AUTO_FILL, \
|
||||
ELM_MAP_ZOOM_MODE_LAST
|
||||
|
||||
from notify import \
|
||||
ELM_NOTIFY_ORIENT_TOP, \
|
||||
ELM_NOTIFY_ORIENT_CENTER, \
|
||||
ELM_NOTIFY_ORIENT_BOTTOM, \
|
||||
ELM_NOTIFY_ORIENT_LEFT, \
|
||||
ELM_NOTIFY_ORIENT_RIGHT, \
|
||||
ELM_NOTIFY_ORIENT_TOP_LEFT, \
|
||||
ELM_NOTIFY_ORIENT_TOP_RIGHT, \
|
||||
ELM_NOTIFY_ORIENT_BOTTOM_LEFT, \
|
||||
ELM_NOTIFY_ORIENT_BOTTOM_RIGHT
|
||||
|
||||
from list import \
|
||||
ELM_OBJECT_SELECT_MODE_DEFAULT, \
|
||||
ELM_OBJECT_SELECT_MODE_ALWAYS, \
|
||||
ELM_OBJECT_SELECT_MODE_NONE, \
|
||||
ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY, \
|
||||
ELM_OBJECT_SELECT_MODE_MAX
|
||||
|
||||
from panel import \
|
||||
ELM_PANEL_ORIENT_TOP, \
|
||||
ELM_PANEL_ORIENT_BOTTOM, \
|
||||
ELM_PANEL_ORIENT_LEFT, \
|
||||
ELM_PANEL_ORIENT_RIGHT
|
||||
|
||||
from photocam import \
|
||||
ELM_PHOTOCAM_ZOOM_MODE_MANUAL, \
|
||||
ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT, \
|
||||
ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL, \
|
||||
ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN
|
||||
|
||||
from general import \
|
||||
ELM_POLICY_QUIT, \
|
||||
ELM_POLICY_QUIT_NONE, \
|
||||
ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
|
||||
|
||||
from popup import \
|
||||
ELM_POPUP_ORIENT_TOP, \
|
||||
ELM_POPUP_ORIENT_CENTER, \
|
||||
ELM_POPUP_ORIENT_BOTTOM, \
|
||||
ELM_POPUP_ORIENT_LEFT, \
|
||||
ELM_POPUP_ORIENT_RIGHT, \
|
||||
ELM_POPUP_ORIENT_TOP_LEFT, \
|
||||
ELM_POPUP_ORIENT_TOP_RIGHT, \
|
||||
ELM_POPUP_ORIENT_BOTTOM_LEFT, \
|
||||
ELM_POPUP_ORIENT_BOTTOM_RIGHT
|
||||
|
||||
from scroller import \
|
||||
ELM_SCROLLER_POLICY_AUTO, \
|
||||
ELM_SCROLLER_POLICY_ON, \
|
||||
ELM_SCROLLER_POLICY_OFF
|
||||
|
||||
from entry import \
|
||||
ELM_TEXT_FORMAT_PLAIN_UTF8, \
|
||||
ELM_TEXT_FORMAT_MARKUP_UTF8
|
||||
|
||||
from toolbar import \
|
||||
ELM_TOOLBAR_SHRINK_NONE, \
|
||||
ELM_TOOLBAR_SHRINK_HIDE, \
|
||||
ELM_TOOLBAR_SHRINK_SCROLL, \
|
||||
ELM_TOOLBAR_SHRINK_MENU, \
|
||||
ELM_TOOLBAR_SHRINK_EXPAND, \
|
||||
ELM_TOOLBAR_SHRINK_LAST
|
||||
|
||||
from web import \
|
||||
ELM_WEB_WINDOW_FEATURE_TOOLBAR, \
|
||||
ELM_WEB_WINDOW_FEATURE_STATUSBAR, \
|
||||
ELM_WEB_WINDOW_FEATURE_SCROLLBARS, \
|
||||
ELM_WEB_WINDOW_FEATURE_MENUBAR, \
|
||||
ELM_WEB_WINDOW_FEATURE_LOCATIONBAR, \
|
||||
ELM_WEB_WINDOW_FEATURE_FULLSCREEN, \
|
||||
ELM_WEB_ZOOM_MODE_MANUAL, \
|
||||
ELM_WEB_ZOOM_MODE_AUTO_FIT, \
|
||||
ELM_WEB_ZOOM_MODE_AUTO_FILL
|
||||
|
||||
from window import \
|
||||
ELM_WIN_BASIC, \
|
||||
ELM_WIN_DIALOG_BASIC, \
|
||||
ELM_WIN_DESKTOP, \
|
||||
ELM_WIN_DOCK, \
|
||||
ELM_WIN_TOOLBAR, \
|
||||
ELM_WIN_MENU, \
|
||||
ELM_WIN_UTILITY, \
|
||||
ELM_WIN_SPLASH, \
|
||||
ELM_WIN_DROPDOWN_MENU, \
|
||||
ELM_WIN_POPUP_MENU, \
|
||||
ELM_WIN_TOOLTIP, \
|
||||
ELM_WIN_NOTIFICATION, \
|
||||
ELM_WIN_COMBO, \
|
||||
ELM_WIN_DND, \
|
||||
ELM_WIN_INLINED_IMAGE, \
|
||||
ELM_WIN_SOCKET_IMAGE, \
|
||||
ELM_WIN_INDICATOR_UNKNOWN, \
|
||||
ELM_WIN_INDICATOR_HIDE, \
|
||||
ELM_WIN_INDICATOR_SHOW, \
|
||||
ELM_WIN_INDICATOR_OPACITY_UNKNOWN, \
|
||||
ELM_WIN_INDICATOR_OPAQUE, \
|
||||
ELM_WIN_INDICATOR_TRANSLUCENT, \
|
||||
ELM_WIN_INDICATOR_TRANSPARENT, \
|
||||
ELM_WIN_KEYBOARD_UNKNOWN, \
|
||||
ELM_WIN_KEYBOARD_OFF, \
|
||||
ELM_WIN_KEYBOARD_ON, \
|
||||
ELM_WIN_KEYBOARD_ALPHA, \
|
||||
ELM_WIN_KEYBOARD_NUMERIC, \
|
||||
ELM_WIN_KEYBOARD_PIN, \
|
||||
ELM_WIN_KEYBOARD_PHONE_NUMBER, \
|
||||
ELM_WIN_KEYBOARD_HEX, \
|
||||
ELM_WIN_KEYBOARD_TERMINAL, \
|
||||
ELM_WIN_KEYBOARD_PASSWORD, \
|
||||
ELM_WIN_KEYBOARD_IP, \
|
||||
ELM_WIN_KEYBOARD_HOST, \
|
||||
ELM_WIN_KEYBOARD_FILE, \
|
||||
ELM_WIN_KEYBOARD_URL, \
|
||||
ELM_WIN_KEYBOARD_KEYPAD, \
|
||||
ELM_WIN_KEYBOARD_J2ME
|
||||
|
||||
from label import \
|
||||
ELM_WRAP_NONE, \
|
||||
ELM_WRAP_CHAR, \
|
||||
ELM_WRAP_WORD, \
|
||||
ELM_WRAP_MIXED
|
||||
|
||||
#init()
|
||||
|
||||
"""
|
||||
__all__ = [
|
||||
"actionslider",
|
||||
"background",
|
||||
"box",
|
||||
"bubble",
|
||||
"button",
|
||||
"calendar",
|
||||
"check",
|
||||
"clock",
|
||||
"colorselector",
|
||||
"configuration",
|
||||
"conformant",
|
||||
"ctxpopup",
|
||||
"datetime_elm",
|
||||
"dayselector",
|
||||
"diskselector",
|
||||
"entry",
|
||||
"fileselector",
|
||||
"fileselector_button",
|
||||
"fileselector_entry",
|
||||
"flip",
|
||||
"frame",
|
||||
"general",
|
||||
"gengrid",
|
||||
"genlist",
|
||||
"gesture_layer",
|
||||
"grid",
|
||||
"hover",
|
||||
"hoversel",
|
||||
"icon",
|
||||
"image",
|
||||
"index",
|
||||
"innerwindow",
|
||||
"label",
|
||||
"layout_class",
|
||||
"layout",
|
||||
"list",
|
||||
"map",
|
||||
"mapbuf",
|
||||
"menu",
|
||||
"multibuttonentry",
|
||||
"naviframe",
|
||||
"need",
|
||||
"notify",
|
||||
"object",
|
||||
"object_item",
|
||||
"panel",
|
||||
"panes",
|
||||
"photo",
|
||||
"photocam",
|
||||
"plug",
|
||||
"popup",
|
||||
"progressbar",
|
||||
"radio",
|
||||
"scroller",
|
||||
"segment_control",
|
||||
"separator",
|
||||
"slider",
|
||||
"slideshow",
|
||||
"spinner",
|
||||
"table",
|
||||
"theme",
|
||||
"thumb",
|
||||
"toolbar",
|
||||
"transit",
|
||||
"video",
|
||||
"web",
|
||||
"window",
|
||||
]
|
||||
"""
|
|
@ -0,0 +1,12 @@
|
|||
from efl.evas cimport Evas_Object
|
||||
from enums cimport Elm_Actionslider_Pos
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_actionslider_add(Evas_Object *parent)
|
||||
char *elm_actionslider_selected_label_get(Evas_Object *obj)
|
||||
void elm_actionslider_indicator_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
|
||||
Elm_Actionslider_Pos elm_actionslider_indicator_pos_get(Evas_Object *obj)
|
||||
void elm_actionslider_magnet_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
|
||||
Elm_Actionslider_Pos elm_actionslider_magnet_pos_get(Evas_Object *obj)
|
||||
void elm_actionslider_enabled_pos_set(Evas_Object *obj, Elm_Actionslider_Pos pos)
|
||||
Elm_Actionslider_Pos elm_actionslider_enabled_pos_get(Evas_Object *obj)
|
|
@ -14,63 +14,167 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Actionslider positions
|
||||
|
||||
.. data:: ELM_ACTIONSLIDER_NONE
|
||||
|
||||
No position
|
||||
|
||||
.. data:: ELM_ACTIONSLIDER_LEFT
|
||||
|
||||
Left position
|
||||
|
||||
.. data:: ELM_ACTIONSLIDER_CENTER
|
||||
|
||||
Center position
|
||||
.. data:: ELM_ACTIONSLIDER_RIGHT
|
||||
|
||||
Right position
|
||||
|
||||
.. data:: ELM_ACTIONSLIDER_ALL
|
||||
|
||||
All positions
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
include "callbacks.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_ACTIONSLIDER_NONE = enums.ELM_ACTIONSLIDER_NONE
|
||||
ELM_ACTIONSLIDER_LEFT = enums.ELM_ACTIONSLIDER_LEFT
|
||||
ELM_ACTIONSLIDER_CENTER = enums.ELM_ACTIONSLIDER_CENTER
|
||||
ELM_ACTIONSLIDER_RIGHT = enums.ELM_ACTIONSLIDER_RIGHT
|
||||
ELM_ACTIONSLIDER_ALL = enums.ELM_ACTIONSLIDER_ALL
|
||||
|
||||
cdef class Actionslider(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
An actionslider is a switcher for two or three labels with
|
||||
customizable magnet properties.
|
||||
|
||||
The user drags and releases the indicator, to choose a label.
|
||||
|
||||
Labels can occupy the following positions.
|
||||
|
||||
- Left
|
||||
- Right
|
||||
- Center
|
||||
|
||||
Positions can be enabled or disabled.
|
||||
|
||||
Magnets can be set on the above positions.
|
||||
|
||||
When the indicator is released, it will move to its nearest "enabled and
|
||||
magnetized" position.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- **selected** - when user selects an enabled position (the label is
|
||||
passed as event info)".
|
||||
- **pos_changed** - when the indicator reaches any of the
|
||||
positions("left", "right" or "center").
|
||||
|
||||
Default text parts of the actionslider widget that you can use for are:
|
||||
|
||||
- **indicator** - An indicator label of the actionslider
|
||||
- **left** - A left label of the actionslider
|
||||
- **right** - A right label of the actionslider
|
||||
- **center** - A center label of the actionslider
|
||||
|
||||
.. note:: By default all positions are set as enabled.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_actionslider_add(parent.obj))
|
||||
|
||||
def selected_label_get(self):
|
||||
return elm_actionslider_selected_label_get(self.obj)
|
||||
|
||||
property selected_label:
|
||||
"""Selected label.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_actionslider_selected_label_get(self.obj)
|
||||
|
||||
def indicator_pos_set(self, pos):
|
||||
elm_actionslider_indicator_pos_set(self.obj, pos)
|
||||
|
||||
def indicator_pos_get(self):
|
||||
return elm_actionslider_indicator_pos_get(self.obj)
|
||||
def selected_label_get(self):
|
||||
return elm_actionslider_selected_label_get(self.obj)
|
||||
|
||||
property indicator_pos:
|
||||
"""Indicator position.
|
||||
|
||||
:type: Elm_Actionslider_Pos
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_actionslider_indicator_pos_get(self.obj)
|
||||
def __set__(self, pos):
|
||||
elm_actionslider_indicator_pos_set(self.obj, pos)
|
||||
|
||||
def magnet_pos_set(self, pos):
|
||||
elm_actionslider_magnet_pos_set(self.obj, pos)
|
||||
|
||||
def magnet_pos_get(self):
|
||||
return elm_actionslider_magnet_pos_get(self.obj)
|
||||
def indicator_pos_set(self, pos):
|
||||
elm_actionslider_indicator_pos_set(self.obj, pos)
|
||||
def indicator_pos_get(self):
|
||||
return elm_actionslider_indicator_pos_get(self.obj)
|
||||
|
||||
property magnet_pos:
|
||||
"""The actionslider magnet position. To make multiple positions
|
||||
magnets ``or`` them together(e.g.: ``ELM_ACTIONSLIDER_LEFT |
|
||||
ELM_ACTIONSLIDER_RIGHT``)
|
||||
|
||||
:type: Elm_Actionslider_Pos
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return self.magnet_pos_get()
|
||||
def __set__(self, pos):
|
||||
self.magnet_pos_set(pos)
|
||||
|
||||
def enabled_pos_set(self, pos):
|
||||
elm_actionslider_enabled_pos_set(self.obj, pos)
|
||||
|
||||
def enabled_pos_get(self):
|
||||
return elm_actionslider_enabled_pos_get(self.obj)
|
||||
def magnet_pos_set(self, pos):
|
||||
elm_actionslider_magnet_pos_set(self.obj, pos)
|
||||
def magnet_pos_get(self):
|
||||
return elm_actionslider_magnet_pos_get(self.obj)
|
||||
|
||||
property enabled_pos:
|
||||
"""The actionslider enabled position. To set multiple positions as
|
||||
enabled ``or`` them together(e.g.: ``ELM_ACTIONSLIDER_LEFT |
|
||||
ELM_ACTIONSLIDER_RIGHT``).
|
||||
|
||||
.. note:: All the positions are enabled by default.
|
||||
|
||||
:type: Elm_Actionslider_Pos
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_actionslider_enabled_pos_get(self.obj)
|
||||
def __set__(self, pos):
|
||||
elm_actionslider_enabled_pos_set(self.obj, pos)
|
||||
|
||||
def enabled_pos_set(self, pos):
|
||||
elm_actionslider_enabled_pos_set(self.obj, pos)
|
||||
def enabled_pos_get(self):
|
||||
return elm_actionslider_enabled_pos_get(self.obj)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
"""Called when user selects an enabled position. The label is passed
|
||||
as event info."""
|
||||
self._callback_add_full("selected", _cb_string_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_string_conv, func)
|
||||
|
||||
def callback_pos_changed_add(self, func, *args, **kwargs):
|
||||
"""Called when the indicator reaches any of the positions **left**,
|
||||
**right** or **center**. The label is passed as event info."""
|
||||
self._callback_add_full("pos_changed", _cb_string_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_pos_changed_del(self, func):
|
|
@ -0,0 +1,13 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord
|
||||
from enums cimport Elm_Bg_Option
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_bg_add(Evas_Object *parent)
|
||||
Eina_Bool elm_bg_file_set(Evas_Object *obj, const_char *file, const_char *group)
|
||||
void elm_bg_file_get(Evas_Object *obj, const_char **file, const_char **group)
|
||||
void elm_bg_option_set(Evas_Object *obj, Elm_Bg_Option option)
|
||||
Elm_Bg_Option elm_bg_option_get(Evas_Object *obj)
|
||||
void elm_bg_color_set(Evas_Object *obj, int r, int g, int b)
|
||||
void elm_bg_color_get(Evas_Object *obj, int *r, int *g, int *b)
|
||||
void elm_bg_load_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
|
@ -0,0 +1,206 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Background tiling modes
|
||||
|
||||
.. data:: ELM_BG_OPTION_CENTER
|
||||
|
||||
Center
|
||||
|
||||
.. data:: ELM_BG_OPTION_SCALE
|
||||
|
||||
Scale
|
||||
|
||||
.. data:: ELM_BG_OPTION_STRETCH
|
||||
|
||||
Stretch
|
||||
|
||||
.. data:: ELM_BG_OPTION_TILE
|
||||
|
||||
Tile
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_BG_OPTION_CENTER = enums.ELM_BG_OPTION_CENTER
|
||||
ELM_BG_OPTION_SCALE = enums.ELM_BG_OPTION_SCALE
|
||||
ELM_BG_OPTION_STRETCH = enums.ELM_BG_OPTION_STRETCH
|
||||
ELM_BG_OPTION_TILE = enums.ELM_BG_OPTION_TILE
|
||||
ELM_BG_OPTION_LAST = enums.ELM_BG_OPTION_LAST
|
||||
|
||||
cdef class Background(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
Background widget object
|
||||
|
||||
Used for setting a solid color, image or Edje group as a background to a
|
||||
window or any container object.
|
||||
|
||||
The background widget is used for setting (solid) background decorations
|
||||
to a window (unless it has transparency enabled) or to any container
|
||||
object. It works just like an image, but has some properties useful to a
|
||||
background, like setting it to tiled, centered, scaled or stretched.
|
||||
|
||||
Default content parts of the bg widget that you can use for are:
|
||||
|
||||
- **overlay** - overlay of the bg
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_bg_add(parent.obj))
|
||||
|
||||
property file:
|
||||
"""The file (image or edje collection) giving life for the background.
|
||||
|
||||
This property contains the image file name (and edje group) used in
|
||||
the background object. If the image comes from an Edje group, it
|
||||
will be stretched to completely fill the background object. If it
|
||||
comes from a traditional image file, it will by default be centered
|
||||
in this widget's are (thus retaining its aspect), what could lead to
|
||||
some parts being not visible. You may change the mode of exhibition
|
||||
for a real image file with :py:attr:`option`.
|
||||
|
||||
.. note:: Once the image is set, a previously set one will be deleted,
|
||||
even if **file** is *None*.
|
||||
|
||||
.. note:: This will only affect the contents of one of the background's
|
||||
swallow spots, namely *"elm.swallow.background"*. If you want to
|
||||
achieve the :py:class:`elementary.layout.Layout`'s file setting
|
||||
behavior, you'll have to call that method on this object.
|
||||
|
||||
:type: string file, optional string group
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef const_char *filename, *group
|
||||
elm_bg_file_get(self.obj, &filename, &group)
|
||||
if filename == NULL:
|
||||
filename = ""
|
||||
if group == NULL:
|
||||
group = ""
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
def __set__(self, value):
|
||||
if isinstance(value, tuple) or isinstance(value, list):
|
||||
filename, group = value
|
||||
else:
|
||||
filename = value
|
||||
group = ""
|
||||
elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
|
||||
def file_set(self, filename, group = ""):
|
||||
return bool(elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group)))
|
||||
def file_get(self):
|
||||
cdef const_char *filename, *group
|
||||
elm_bg_file_get(self.obj, &filename, &group)
|
||||
if filename == NULL:
|
||||
filename = ""
|
||||
if group == NULL:
|
||||
group = ""
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
property option:
|
||||
"""The mode of display for a given background widget's image.
|
||||
|
||||
This property reflects how the background widget will display its
|
||||
image. This will only work if :py:attr:`file` was previously set with an
|
||||
image file. The image can be displayed tiled, scaled, centered or
|
||||
stretched.
|
||||
|
||||
:type: Elm_Bg_Option
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_bg_option_get(self.obj)
|
||||
|
||||
def __set__(self, value):
|
||||
elm_bg_option_set(self.obj, value)
|
||||
|
||||
def option_set(self, option):
|
||||
elm_bg_option_set(self.obj, option)
|
||||
def option_get(self):
|
||||
return elm_bg_option_get(self.obj)
|
||||
|
||||
property color:
|
||||
"""The color on a given background widget.
|
||||
|
||||
This property reflects the color used for the background rectangle,
|
||||
in RGB format. Each color component's range is from 0 to 255.
|
||||
|
||||
.. note:: You probably only want to use this property if you haven't
|
||||
previously set :py:attr:`file`, so that you just want a solid color
|
||||
background.
|
||||
|
||||
:type: (int r, int g, int b)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef int r, g, b
|
||||
elm_bg_color_get(self.obj, &r, &g, &b)
|
||||
return (r, g, b)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int r, g, b
|
||||
r, g, b = value
|
||||
elm_bg_color_set(self.obj, r, g, b)
|
||||
|
||||
def color_set(self, r, g, b):
|
||||
elm_bg_color_set(self.obj, r, g, b)
|
||||
def color_get(self):
|
||||
cdef int r, g, b
|
||||
elm_bg_color_get(self.obj, &r, &g, &b)
|
||||
return (r, g, b)
|
||||
|
||||
property load_size:
|
||||
"""The size of the pixmap representation of the image set on a given
|
||||
background widget.
|
||||
|
||||
This property sets a new size for pixmap representation of the
|
||||
given bg image. It allows for the image to be loaded already in the
|
||||
specified size, reducing the memory usage and load time (for
|
||||
example, when loading a big image file with its load size set to a
|
||||
smaller size)
|
||||
|
||||
.. note:: This is just a hint for the underlying system. The real size
|
||||
of the pixmap may differ depending on the type of image being
|
||||
loaded, being bigger than requested.
|
||||
|
||||
.. warning:: This function just makes sense if an image file was set
|
||||
with :py:attr:`file`.
|
||||
|
||||
:type: (Evas_Coord w, Evas_Coord h)
|
||||
|
||||
"""
|
||||
def __set__(self, value):
|
||||
cdef Evas_Coord w, h
|
||||
w, h = value
|
||||
elm_bg_load_size_set(self.obj, w, h)
|
||||
|
||||
def load_size_set(self, w, h):
|
||||
elm_bg_load_size_set(self.obj, w, h)
|
||||
|
||||
_object_mapping_register("elm_bg", Background)
|
|
@ -0,0 +1,43 @@
|
|||
from efl.evas cimport Eina_Bool, Eina_List, const_Eina_List, Evas_Object, Evas_Coord
|
||||
from enums cimport Elm_Box_CLayout
|
||||
|
||||
cdef extern from "Ecore.h":
|
||||
ctypedef void (*Ecore_Cb)(void *data)
|
||||
|
||||
cdef extern from "Evas.h":
|
||||
ctypedef void *Evas_Object_Box_Data
|
||||
ctypedef void *Elm_Box_Transition
|
||||
ctypedef void (*Evas_Object_Box_Layout)(Evas_Object *o, Evas_Object_Box_Data *priv, void *user_data)
|
||||
void evas_object_box_layout_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_homogeneous_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_homogeneous_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_homogeneous_max_size_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_homogeneous_max_size_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_flow_horizontal(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_flow_vertical(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void evas_object_box_layout_stack(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
void elm_box_layout_transition(Evas_Object *o, Evas_Object_Box_Data *priv, void *data)
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_box_add(Evas_Object *parent)
|
||||
void elm_box_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
||||
Eina_Bool elm_box_horizontal_get(Evas_Object *obj)
|
||||
void elm_box_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous)
|
||||
Eina_Bool elm_box_homogeneous_get(Evas_Object *obj)
|
||||
void elm_box_pack_start(Evas_Object *obj, Evas_Object *subobj)
|
||||
void elm_box_pack_end(Evas_Object *obj, Evas_Object *subobj)
|
||||
void elm_box_pack_before(Evas_Object *obj, Evas_Object *subobj, Evas_Object *before)
|
||||
void elm_box_pack_after(Evas_Object *obj, Evas_Object *subobj, Evas_Object *after)
|
||||
void elm_box_clear(Evas_Object *obj)
|
||||
void elm_box_unpack(Evas_Object *obj, Evas_Object *subobj)
|
||||
void elm_box_unpack_all(Evas_Object *obj)
|
||||
void elm_box_recalculate(Evas_Object *obj)
|
||||
Eina_List *elm_box_children_get(Evas_Object *obj)
|
||||
void elm_box_padding_set(Evas_Object *obj, Evas_Coord horizontal, Evas_Coord vertical)
|
||||
void elm_box_padding_get(Evas_Object *obj, Evas_Coord *horizontal, Evas_Coord *vertical)
|
||||
void elm_box_align_set(Evas_Object *obj, double horizontal, double vertical)
|
||||
void elm_box_align_get(Evas_Object *obj, double *horizontal, double *vertical)
|
||||
void elm_box_layout_set(Evas_Object *obj, Evas_Object_Box_Layout cb, void *data, Ecore_Cb free_data)
|
||||
Elm_Box_Transition *elm_box_transition_new(double duration, Evas_Object_Box_Layout start_layout, void *start_layout_data, Ecore_Cb start_layout_free_data, Evas_Object_Box_Layout end_layout, void *end_layout_data, Ecore_Cb end_layout_free_data, Ecore_Cb transition_end_cb, void *transition_end_data)
|
||||
void elm_box_transition_free(void *data)
|
|
@ -0,0 +1,549 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Box layout modes
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_HORIZONTAL
|
||||
|
||||
Horizontal layout
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_VERTICAL
|
||||
|
||||
Vertical layout
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL
|
||||
|
||||
Homogeneous vertical layout
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL
|
||||
|
||||
Homogeneous horizontal layout
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL
|
||||
|
||||
Homogeneous layout, maximum size on the horizontal axis
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL
|
||||
|
||||
Homogeneous layout, maximum size on the horizontal axis
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_FLOW_HORIZONTAL
|
||||
|
||||
Horizontally flowing layout
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_FLOW_VERTICAL
|
||||
|
||||
Vertically flowing layout
|
||||
|
||||
.. data:: ELM_BOX_LAYOUT_STACK
|
||||
|
||||
Stacking layout
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from object cimport Object
|
||||
|
||||
from efl.evas cimport evas_object_data_get
|
||||
|
||||
#~ ctypedef enum Elm_Box_CLayout:
|
||||
#~ ELM_BOX_LAYOUT_HORIZONTAL
|
||||
#~ ELM_BOX_LAYOUT_VERTICAL
|
||||
#~ ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL
|
||||
#~ ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL
|
||||
#~ ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL
|
||||
#~ ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL
|
||||
#~ ELM_BOX_LAYOUT_FLOW_HORIZONTAL
|
||||
#~ ELM_BOX_LAYOUT_FLOW_VERTICAL
|
||||
#~ ELM_BOX_LAYOUT_STACK
|
||||
|
||||
ELM_BOX_LAYOUT_HORIZONTAL = 0
|
||||
ELM_BOX_LAYOUT_VERTICAL = 1
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL = 2
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL = 3
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL = 4
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL = 5
|
||||
ELM_BOX_LAYOUT_FLOW_HORIZONTAL = 6
|
||||
ELM_BOX_LAYOUT_FLOW_VERTICAL = 7
|
||||
ELM_BOX_LAYOUT_STACK = 8
|
||||
|
||||
cdef Evas_Object_Box_Layout _py_elm_box_layout_resolv(int layout) with gil:
|
||||
if layout == ELM_BOX_LAYOUT_HORIZONTAL:
|
||||
return evas_object_box_layout_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_VERTICAL:
|
||||
return evas_object_box_layout_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL:
|
||||
return evas_object_box_layout_homogeneous_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL:
|
||||
return evas_object_box_layout_homogeneous_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL:
|
||||
return evas_object_box_layout_homogeneous_max_size_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL:
|
||||
return evas_object_box_layout_homogeneous_max_size_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_FLOW_HORIZONTAL:
|
||||
return evas_object_box_layout_flow_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_FLOW_VERTICAL:
|
||||
return evas_object_box_layout_flow_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_STACK:
|
||||
return evas_object_box_layout_stack
|
||||
return evas_object_box_layout_vertical
|
||||
|
||||
cdef class Box(Object):
|
||||
|
||||
"""
|
||||
|
||||
A box arranges objects in a linear fashion, governed by a layout function
|
||||
that defines the details of this arrangement.
|
||||
|
||||
By default, the box will use an internal function to set the layout to
|
||||
a single row, either vertical or horizontal. This layout is affected
|
||||
by a number of parameters, such as the homogeneous flag set by
|
||||
:py:attr:`homogeneous`, the values given by :py:attr:`padding` and
|
||||
:py:attr:`align` and the hints set to each object in the box.
|
||||
|
||||
For this default layout, it's possible to change the orientation with
|
||||
:py:attr:`horizontal`. The box will start in the vertical orientation,
|
||||
placing its elements ordered from top to bottom. When horizontal is set,
|
||||
the order will go from left to right. If the box is set to be
|
||||
homogeneous, every object in it will be assigned the same space, that
|
||||
of the largest object. Padding can be used to set some spacing between
|
||||
the cell given to each object. The alignment of the box, set with
|
||||
:py:attr:`align`, determines how the bounding box of all the elements
|
||||
will be placed within the space given to the box widget itself.
|
||||
|
||||
The size hints of each object also affect how they are placed and sized
|
||||
within the box. :py:attr:`size_hint_min` will give the minimum
|
||||
size the object can have, and the box will use it as the basis for all
|
||||
latter calculations. Elementary widgets set their own minimum size as
|
||||
needed, so there's rarely any need to use it manually.
|
||||
|
||||
:py:attr:`size_hint_weight`, when not in homogeneous mode, is
|
||||
used to tell whether the object will be allocated the minimum size it
|
||||
needs or if the space given to it should be expanded. It's important
|
||||
to realize that expanding the size given to the object is not the same
|
||||
thing as resizing the object. It could very well end being a small
|
||||
widget floating in a much larger empty space. If not set, the weight
|
||||
for objects will normally be 0.0 for both axis, meaning the widget will
|
||||
not be expanded. To take as much space possible, set the weight to
|
||||
``EVAS_HINT_EXPAND`` (defined to 1.0) for the desired axis to expand.
|
||||
|
||||
Besides how much space each object is allocated, it's possible to control
|
||||
how the widget will be placed within that space using
|
||||
:py:attr:`size_hint_align`. By default, this value will be 0.5
|
||||
for both axis, meaning the object will be centered, but any value from
|
||||
0.0 (left or top, for the ``x`` and ``y`` axis, respectively) to 1.0
|
||||
(right or bottom) can be used. The special value *EVAS_HINT_FILL*, which
|
||||
is -1.0, means the object will be resized to fill the entire space it
|
||||
was allocated.
|
||||
|
||||
In addition, customized functions to define the layout can be set, which
|
||||
allow the application developer to organize the objects within the box
|
||||
in any number of ways.
|
||||
|
||||
The special :py:func:`layout_transition()` function can be used
|
||||
to switch from one layout to another, animating the motion of the
|
||||
children of the box.
|
||||
|
||||
.. note:: Objects should not be added to box objects using _add() calls.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
"""Add a new box to the parent
|
||||
|
||||
By default, the box will be in vertical mode and non-homogeneous.
|
||||
|
||||
:param parent: The parent object
|
||||
:type parent: :py:class:`elementary.object.Object`
|
||||
:return: The new object or None if it cannot be created
|
||||
:rtype: :py:class:`elementary.object.Object`
|
||||
|
||||
"""
|
||||
self._set_obj(elm_box_add(parent.obj))
|
||||
|
||||
property horizontal:
|
||||
"""The horizontal orientation.
|
||||
|
||||
By default, box object arranges their contents vertically from top to
|
||||
bottom. By setting this property as *True*, the box will become
|
||||
horizontal, arranging contents from left to right.
|
||||
|
||||
.. note:: This flag is ignored if a custom layout function is set.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_box_horizontal_get(self.obj)
|
||||
def __set__(self, value):
|
||||
elm_box_horizontal_set(self.obj, value)
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_box_horizontal_set(self.obj, horizontal)
|
||||
def horizontal_get(self):
|
||||
return elm_box_horizontal_get(self.obj)
|
||||
|
||||
property homogeneous:
|
||||
"""Whether the box is using homogeneous mode or not
|
||||
|
||||
If enabled, homogeneous layout makes all items the same size, according
|
||||
to the size of the largest of its children.
|
||||
|
||||
.. note:: This flag is ignored if a custom layout function is set.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_box_homogeneous_get(self.obj))
|
||||
|
||||
def __set__(self, value):
|
||||
elm_box_homogeneous_set(self.obj, value)
|
||||
|
||||
def homogeneous_set(self, homogeneous):
|
||||
elm_box_homogeneous_set(self.obj, homogeneous)
|
||||
def homogeneous_get(self):
|
||||
return bool(elm_box_homogeneous_get(self.obj))
|
||||
|
||||
def pack_start(self, evasObject obj):
|
||||
"""pack_start(evas.Object obj)
|
||||
|
||||
Add an object to the beginning of the pack list.
|
||||
|
||||
Pack ``subobj`` into the box, placing it first in the list of
|
||||
children objects. The actual position the object will get on screen
|
||||
depends on the layout used. If no custom layout is set, it will be at
|
||||
the top or left, depending if the box is vertical or horizontal,
|
||||
respectively.
|
||||
|
||||
:param subobj: The object to add to the box
|
||||
:type subobj: :py:class:`evas.object.Object`
|
||||
|
||||
.. seealso::
|
||||
:py:func:`pack_end()`
|
||||
:py:func:`pack_before()`
|
||||
:py:func:`pack_after()`
|
||||
:py:func:`unpack()`
|
||||
:py:func:`unpack_all()`
|
||||
:py:func:`clear()`
|
||||
|
||||
"""
|
||||
elm_box_pack_start(self.obj, obj.obj)
|
||||
|
||||
def pack_end(self, evasObject obj):
|
||||
"""pack_end(evas.Object obj)
|
||||
|
||||
Add an object at the end of the pack list.
|
||||
|
||||
Pack ``subobj`` into the box, placing it last in the list of
|
||||
children objects. The actual position the object will get on screen
|
||||
depends on the layout used. If no custom layout is set, it will be at
|
||||
the bottom or right, depending if the box is vertical or horizontal,
|
||||
respectively.
|
||||
|
||||
:param subobj: The object to add to the box
|
||||
:type subobj: :py:class:`evas.object.Object`
|
||||
|
||||
.. seealso::
|
||||
:py:func:`pack_start()`
|
||||
:py:func:`pack_before()`
|
||||
:py:func:`pack_after()`
|
||||
:py:func:`unpack()`
|
||||
:py:func:`unpack_all()`
|
||||
:py:func:`clear()`
|
||||
|
||||
"""
|
||||
elm_box_pack_end(self.obj, obj.obj)
|
||||
|
||||
def pack_before(self, evasObject obj, evasObject before):
|
||||
"""pack_before(evas.Object obj, evas.Object before)
|
||||
|
||||
Adds an object to the box before the indicated object.
|
||||
|
||||
This will add the ``subobj`` to the box indicated before the object
|
||||
indicated with ``before``. If ``before`` is not already in the box, results
|
||||
are undefined. Before means either to the left of the indicated object or
|
||||
above it depending on orientation.
|
||||
|
||||
:param subobj: The object to add to the box
|
||||
:type subobj: :py:class:`evas.object.Object`
|
||||
:param before: The object before which to add it
|
||||
:type before: :py:class:`evas.object.Object`
|
||||
|
||||
.. seealso::
|
||||
:py:func:`pack_start()`
|
||||
:py:func:`pack_end()`
|
||||
:py:func:`pack_after()`
|
||||
:py:func:`unpack()`
|
||||
:py:func:`unpack_all()`
|
||||
:py:func:`clear()`
|
||||
|
||||
"""
|
||||
elm_box_pack_before(self.obj, obj.obj, before.obj)
|
||||
|
||||
def pack_after(self, evasObject obj, evasObject after):
|
||||
"""pack_after(evas.Object obj, evas.Object)
|
||||
|
||||
Adds an object to the box after the indicated object.
|
||||
|
||||
This will add the ``subobj`` to the box indicated after the object
|
||||
indicated with *after*. If ``after`` is not already in the box, results
|
||||
are undefined. After means either to the right of the indicated object or
|
||||
below it depending on orientation.
|
||||
|
||||
:param subobj: The object to add to the box
|
||||
:type subobj: :py:class:`evas.object.Object`
|
||||
:param after: The object after which to add it
|
||||
:type after: :py:class:`evas.object.Object`
|
||||
|
||||
.. seealso::
|
||||
:py:func:`pack_start()`
|
||||
:py:func:`pack_end()`
|
||||
:py:func:`pack_before()`
|
||||
:py:func:`unpack()`
|
||||
:py:func:`unpack_all()`
|
||||
:py:func:`clear()`
|
||||
|
||||
"""
|
||||
elm_box_pack_after(self.obj, obj.obj, after.obj)
|
||||
|
||||
def clear(self):
|
||||
"""clear()
|
||||
|
||||
Clear the box of all children
|
||||
|
||||
Remove all the elements contained by the box, deleting the respective
|
||||
objects.
|
||||
|
||||
.. seealso:: :py:func:`unpack()`, :py:func:`unpack_all()`
|
||||
|
||||
"""
|
||||
elm_box_clear(self.obj)
|
||||
|
||||
def unpack(self, evasObject obj):
|
||||
"""unpack(evas.Object obj)
|
||||
|
||||
Unpack a box item.
|
||||
|
||||
Remove the object given by ``subobj`` from the box without
|
||||
deleting it.
|
||||
|
||||
:param subobj: The object to unpack
|
||||
:type subobj: :py:class:`evas.object.Object`
|
||||
|
||||
.. seealso:: :py:func:`unpack_all()`, :py:func:`clear()`
|
||||
|
||||
"""
|
||||
elm_box_unpack(self.obj, obj.obj)
|
||||
|
||||
def unpack_all(self):
|
||||
"""unpack_all()
|
||||
|
||||
Remove all items from the box, without deleting them.
|
||||
|
||||
Clear the box from all children, but don't delete the respective objects.
|
||||
If no other references of the box children exist, the objects will never
|
||||
be deleted, and thus the application will leak the memory. Make sure
|
||||
when using this function that you hold a reference to all the objects
|
||||
in the box.
|
||||
|
||||
.. seealso:: :py:func:`clear()`, :py:func:`unpack()`
|
||||
|
||||
"""
|
||||
elm_box_unpack_all(self.obj)
|
||||
|
||||
property children:
|
||||
"""Retrieve a list of the objects packed into the box
|
||||
|
||||
Returns a ``tuple`` with the child :py:class:`evas.object.Object`.
|
||||
The order of the list corresponds to the packing order the box uses.
|
||||
|
||||
:type: tuple of :py:class:`evas.object.Object`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Evas_Object *o
|
||||
cdef Object obj
|
||||
cdef const_Eina_List *lst
|
||||
|
||||
ret = []
|
||||
lst = elm_box_children_get(self.obj)
|
||||
while lst:
|
||||
o = <Evas_Object *> lst.data
|
||||
obj = <Object>evas_object_data_get(o, "python-evas")
|
||||
ret.append(obj)
|
||||
lst = lst.next
|
||||
return ret
|
||||
|
||||
#def __set__(self, value):
|
||||
#TODO: unpack_all() and then get the objects from value and pack_end() them.
|
||||
|
||||
def __del__(self):
|
||||
elm_box_clear(self.obj)
|
||||
|
||||
def children_get(self):
|
||||
cdef Evas_Object *o
|
||||
cdef Object obj
|
||||
cdef const_Eina_List *lst
|
||||
|
||||
ret = []
|
||||
lst = elm_box_children_get(self.obj)
|
||||
while lst:
|
||||
o = <Evas_Object *> lst.data
|
||||
obj = <Object>evas_object_data_get(o, "python-evas")
|
||||
ret.append(obj)
|
||||
lst = lst.next
|
||||
return ret
|
||||
|
||||
property padding:
|
||||
"""The space (padding) between the box's elements.
|
||||
|
||||
Extra space in pixels that will be added between a box child and its
|
||||
neighbors after its containing cell has been calculated. This padding
|
||||
is set for all elements in the box, besides any possible padding that
|
||||
individual elements may have through their size hints.
|
||||
|
||||
:type: tuple of Evas_Coords (int)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef int horizontal, vertical
|
||||
elm_box_padding_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int horizontal, vertical
|
||||
horizontal, vertical = value
|
||||
elm_box_padding_set(self.obj, horizontal, vertical)
|
||||
|
||||
def padding_set(self, horizontal, vertical):
|
||||
elm_box_padding_set(self.obj, horizontal, vertical)
|
||||
def padding_get(self):
|
||||
cdef int horizontal, vertical
|
||||
elm_box_padding_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
property align:
|
||||
"""Set the alignment of the whole bounding box of contents.
|
||||
|
||||
Sets how the bounding box containing all the elements of the box, after
|
||||
their sizes and position has been calculated, will be aligned within
|
||||
the space given for the whole box widget.
|
||||
|
||||
:rtype: tuple of floats
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef double horizontal, vertical
|
||||
elm_box_align_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef double horizontal, vertical
|
||||
horizontal, vertical = value
|
||||
elm_box_align_set(self.obj, horizontal, vertical)
|
||||
|
||||
def align_set(self, horizontal, vertical):
|
||||
elm_box_align_set(self.obj, horizontal, vertical)
|
||||
def align_get(self):
|
||||
cdef double horizontal, vertical
|
||||
elm_box_align_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
def recalculate(self):
|
||||
"""recalculate()
|
||||
|
||||
Force the box to recalculate its children packing.
|
||||
|
||||
If any children was added or removed, box will not calculate the
|
||||
values immediately rather leaving it to the next main loop
|
||||
iteration. While this is great as it would save lots of
|
||||
recalculation, whenever you need to get the position of a just
|
||||
added item you must force recalculate before doing so.
|
||||
|
||||
"""
|
||||
elm_box_recalculate(self.obj)
|
||||
|
||||
property layout:
|
||||
"""Set the layout function for the box.
|
||||
|
||||
A box layout function affects how a box object displays child
|
||||
elements within its area. The list of pre-defined box layouts
|
||||
available in Evas is:
|
||||
|
||||
- elementary.ELM_BOX_LAYOUT_HORIZONTAL
|
||||
- elementary.ELM_BOX_LAYOUT_VERTICAL
|
||||
- elementary.ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL
|
||||
- elementary.ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL
|
||||
- elementary.ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL
|
||||
- elementary.ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL
|
||||
- elementary.ELM_BOX_LAYOUT_FLOW_HORIZONTAL
|
||||
- elementary.ELM_BOX_LAYOUT_FLOW_VERTICAL
|
||||
- elementary.ELM_BOX_LAYOUT_STACK
|
||||
|
||||
Note that you cannot set a custom layout function.
|
||||
|
||||
:type: Evas_Object_Box_Layout
|
||||
|
||||
"""
|
||||
def __set__(self, layout):
|
||||
cdef Evas_Object_Box_Layout ly
|
||||
ly = _py_elm_box_layout_resolv(layout)
|
||||
elm_box_layout_set(self.obj, ly, NULL, NULL)
|
||||
|
||||
def layout_set(self, layout):
|
||||
cdef Evas_Object_Box_Layout ly
|
||||
ly = _py_elm_box_layout_resolv(layout)
|
||||
elm_box_layout_set(self.obj, ly, NULL, NULL)
|
||||
|
||||
def layout_transition(self, duration, from_layout, to_layout):
|
||||
"""layout_transition(float duration, from_layout, to_layout)
|
||||
|
||||
Perform an animation between two given different layout.
|
||||
|
||||
If you want to animate the change from one layout to another, you
|
||||
just need to call this function with the starting layout and
|
||||
the final one.
|
||||
|
||||
.. seealso:: :py:attr:`layout` for the list of available layouts.
|
||||
|
||||
:param duration: the animation duration in seconds
|
||||
:type duration: float
|
||||
:param from_layout: one of elementary.ELM_BOX_LAYOUT
|
||||
:type from_layout: Evas_Object_Box_Layout
|
||||
:param to_layout: one of elementary.ELM_BOX_LAYOUT
|
||||
:type to_layout: Evas_Object_Box_Layout
|
||||
|
||||
"""
|
||||
cdef Elm_Box_Transition *t
|
||||
cdef Evas_Object_Box_Layout ly_from, ly_to
|
||||
|
||||
ly_from = _py_elm_box_layout_resolv(from_layout)
|
||||
ly_to = _py_elm_box_layout_resolv(to_layout)
|
||||
t = elm_box_transition_new(duration,
|
||||
ly_from, NULL, NULL,
|
||||
ly_to, NULL, NULL,
|
||||
NULL, NULL)
|
||||
elm_box_layout_set(self.obj, elm_box_layout_transition, t,
|
||||
elm_box_transition_free)
|
||||
|
||||
|
||||
_object_mapping_register("elm_box", Box)
|
|
@ -0,0 +1,7 @@
|
|||
from efl.evas cimport Evas_Object
|
||||
from enums cimport Elm_Bubble_Pos
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_bubble_add(Evas_Object *parent)
|
||||
void elm_bubble_pos_set(Evas_Object *obj, Elm_Bubble_Pos pos)
|
||||
Elm_Bubble_Pos elm_bubble_pos_get(Evas_Object *obj)
|
|
@ -0,0 +1,127 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Bubble arrow positions
|
||||
|
||||
.. data:: ELM_BUBBLE_POS_TOP_LEFT
|
||||
|
||||
Top left position
|
||||
|
||||
.. data:: ELM_BUBBLE_POS_TOP_RIGHT
|
||||
|
||||
Top right position
|
||||
|
||||
.. data:: ELM_BUBBLE_POS_BOTTOM_LEFT
|
||||
|
||||
Bottom left position
|
||||
|
||||
.. data:: ELM_BUBBLE_POS_BOTTOM_RIGHT
|
||||
|
||||
Bottom right position
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_BUBBLE_POS_TOP_LEFT = enums.ELM_BUBBLE_POS_TOP_LEFT
|
||||
ELM_BUBBLE_POS_TOP_RIGHT = enums.ELM_BUBBLE_POS_TOP_RIGHT
|
||||
ELM_BUBBLE_POS_BOTTOM_LEFT = enums.ELM_BUBBLE_POS_BOTTOM_LEFT
|
||||
ELM_BUBBLE_POS_BOTTOM_RIGHT = enums.ELM_BUBBLE_POS_BOTTOM_RIGHT
|
||||
|
||||
cdef class Bubble(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
The Bubble is a widget to show text similar to how speech is
|
||||
represented in comics.
|
||||
|
||||
The bubble widget contains 5 important visual elements:
|
||||
|
||||
- The frame is a rectangle with rounded edjes and an "arrow".
|
||||
- The ``icon`` is an image to which the frame's arrow points to.
|
||||
- The ``label`` is a text which appears to the right of the icon if the
|
||||
corner is **top_left** or **bottom_left** and is right aligned to
|
||||
the frame otherwise.
|
||||
- The ``info`` is a text which appears to the right of the label. Info's
|
||||
font is of a lighter color than label.
|
||||
- The ``content`` is an evas object that is shown inside the frame.
|
||||
|
||||
The position of the arrow, icon, label and info depends on which corner is
|
||||
selected. The four available corners are:
|
||||
|
||||
- **top_left** - Default
|
||||
- **top_right**
|
||||
- **bottom_left**
|
||||
- **bottom_right**
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``clicked`` - This is called when a user has clicked the bubble.
|
||||
|
||||
Default content parts of the bubble that you can use for are:
|
||||
|
||||
- **default** - A content of the bubble
|
||||
- **icon** - An icon of the bubble
|
||||
|
||||
Default text parts of the button widget that you can use for are:
|
||||
|
||||
- **default** - Label of the bubble
|
||||
- **info** - info of the bubble
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_bubble_add(parent.obj))
|
||||
|
||||
property pos:
|
||||
"""The corner of the bubble
|
||||
|
||||
This property reflects the corner of the bubble. The corner will be
|
||||
used to determine where the arrow in the frame points to and where
|
||||
label, icon and info are shown.
|
||||
|
||||
:type: Elm_Bubble_Pos
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_bubble_pos_get(self.obj)
|
||||
|
||||
def __set__(self, value):
|
||||
elm_bubble_pos_set(self.obj, value)
|
||||
|
||||
def pos_set(self, pos):
|
||||
elm_bubble_pos_set(self.obj, pos)
|
||||
def pos_get(self):
|
||||
return elm_bubble_pos_get(self.obj)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
"""This is called when a user has clicked the bubble."""
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_bubble", Bubble)
|
|
@ -0,0 +1,16 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
# Button (api:DONE cb:DONE test:DONE doc:DONE)
|
||||
Evas_Object *elm_button_add(Evas_Object *parent)
|
||||
void elm_button_autorepeat_set(Evas_Object *obj, Eina_Bool on)
|
||||
Eina_Bool elm_button_autorepeat_get(Evas_Object *obj)
|
||||
void elm_button_autorepeat_initial_timeout_set(Evas_Object *obj, double t)
|
||||
double elm_button_autorepeat_initial_timeout_get(Evas_Object *obj)
|
||||
void elm_button_autorepeat_gap_timeout_set(Evas_Object *obj, double t)
|
||||
double elm_button_autorepeat_gap_timeout_get(Evas_Object *obj)
|
||||
|
||||
cdef class Button(LayoutClass):
|
||||
pass
|
|
@ -0,0 +1,166 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cdef class Button(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
This is a push-button. Press it and run some function. It can contain
|
||||
a simple label and icon object and it also has an autorepeat feature.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- "clicked": the user clicked the button (press/release).
|
||||
- "repeated": the user pressed the button without releasing it.
|
||||
- "pressed": button was pressed.
|
||||
- "unpressed": button was released after being pressed.
|
||||
|
||||
Also, defined in the default theme, the button has the following styles
|
||||
available:
|
||||
|
||||
- default: a normal button.
|
||||
- anchor: Like default, but the button fades away when the mouse is not
|
||||
over it, leaving only the text or icon.
|
||||
- hoversel_vertical: Internally used by
|
||||
:py:class:`elementary.hoversel.Hoversel` to give a continuous look
|
||||
across its options.
|
||||
- hoversel_vertical_entry: Another internal for
|
||||
:py:class:`elementary.hoversel.Hoversel`.
|
||||
- naviframe: Internally used by
|
||||
:py:class:`elementary.naviframe.Naviframe` for its back button.
|
||||
- colorselector: Internally used by
|
||||
:py:class:`elementary.colorselector.Colorselector` for its left and
|
||||
right buttons.
|
||||
|
||||
Default content parts of the button widget that you can use for are:
|
||||
|
||||
- "icon" - An icon of the button
|
||||
|
||||
Default text parts of the button widget that you can use for are:
|
||||
|
||||
- "default" - Label of the button
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_button_add(parent.obj))
|
||||
|
||||
property autorepeat:
|
||||
"""Turn on/off the autorepeat event generated when the button is
|
||||
kept pressed
|
||||
|
||||
When off, no autorepeat is performed and buttons emit a normal
|
||||
``clicked`` signal when they are clicked.
|
||||
|
||||
When on, keeping a button pressed will continuously emit a
|
||||
``repeated`` signal until the button is released. The time it takes
|
||||
until it starts emitting the signal is given by
|
||||
:py:attr:`autorepeat_initial_timeout`, and the time between each new
|
||||
emission by :py:attr:`autorepeat_gap_timeout`.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_button_autorepeat_get(self.obj))
|
||||
def __set__(self, on):
|
||||
elm_button_autorepeat_set(self.obj, on)
|
||||
|
||||
def autorepeat_set(self, on):
|
||||
elm_button_autorepeat_set(self.obj, on)
|
||||
def autorepeat_get(self):
|
||||
return bool(elm_button_autorepeat_get(self.obj))
|
||||
|
||||
property autorepeat_initial_timeout:
|
||||
"""The initial timeout before the autorepeat event is generated
|
||||
|
||||
Reflects the timeout, in seconds, since the button is pressed until
|
||||
the first ``repeated`` signal is emitted. If ``t`` is 0.0 or less,
|
||||
there won't be any delay and the event will be fired the moment the
|
||||
button is pressed.
|
||||
|
||||
.. seealso:: :py:attr:`autorepeat`, :py:attr:`autorepeat_gap_timeout`
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_button_autorepeat_initial_timeout_get(self.obj)
|
||||
def __set__(self, t):
|
||||
elm_button_autorepeat_initial_timeout_set(self.obj, t)
|
||||
|
||||
def autorepeat_initial_timeout_set(self, t):
|
||||
elm_button_autorepeat_initial_timeout_set(self.obj, t)
|
||||
def autorepeat_initial_timeout_get(self):
|
||||
return elm_button_autorepeat_initial_timeout_get(self.obj)
|
||||
|
||||
property autorepeat_gap_timeout:
|
||||
"""The interval between each generated autorepeat event
|
||||
|
||||
After the first ``repeated`` event is fired, all subsequent ones will
|
||||
follow after a delay of ``t`` seconds for each.
|
||||
|
||||
.. seealso:: :py:attr:`autorepeat_initial_timeout`
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_button_autorepeat_gap_timeout_get(self.obj)
|
||||
def __set__(self, t):
|
||||
elm_button_autorepeat_gap_timeout_set(self.obj, t)
|
||||
|
||||
def autorepeat_gap_timeout_set(self, t):
|
||||
elm_button_autorepeat_gap_timeout_set(self.obj, t)
|
||||
def autorepeat_gap_timeout_get(self):
|
||||
return elm_button_autorepeat_gap_timeout_get(self.obj)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
"""The user clicked the button (press/release)."""
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_repeated_add(self, func, *args, **kwargs):
|
||||
"""The user pressed the button without releasing it."""
|
||||
self._callback_add("repeated", func, *args, **kwargs)
|
||||
|
||||
def callback_repeated_del(self, func):
|
||||
self._callback_del("repeated", func)
|
||||
|
||||
def callback_pressed_add(self, func, *args, **kwargs):
|
||||
"""The button was pressed."""
|
||||
self._callback_add("pressed", func, *args, **kwargs)
|
||||
|
||||
def callback_pressed_del(self, func):
|
||||
self._callback_del("pressed", func)
|
||||
|
||||
def callback_unpressed_add(self, func, *args, **kwargs):
|
||||
"""The button was released after being pressed."""
|
||||
self._callback_add("unpressed", func, *args, **kwargs)
|
||||
|
||||
def callback_unpressed_del(self, func):
|
||||
self._callback_del("unpressed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_button", Button)
|
|
@ -0,0 +1,56 @@
|
|||
from efl.evas cimport Eina_Bool, Eina_List, const_Eina_List, Evas_Object
|
||||
from enums cimport Elm_Calendar_Mark_Repeat_Type, Elm_Calendar_Select_Mode, \
|
||||
Elm_Calendar_Weekday
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "string.h":
|
||||
void *memcpy(void *dst, void *src, int n)
|
||||
char *strdup(char *str)
|
||||
|
||||
cdef extern from "time.h":
|
||||
struct tm:
|
||||
int tm_sec
|
||||
int tm_min
|
||||
int tm_hour
|
||||
int tm_mday
|
||||
int tm_mon
|
||||
int tm_year
|
||||
int tm_wday
|
||||
int tm_yday
|
||||
int tm_isdst
|
||||
|
||||
long int tm_gmtoff
|
||||
const_char *tm_zone
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
ctypedef char *(*Elm_Calendar_Format_Cb) (tm *stime)
|
||||
|
||||
ctypedef struct Elm_Calendar_Mark:
|
||||
Evas_Object *obj
|
||||
Eina_List *node
|
||||
tm *mark_time
|
||||
const_char *mark_type
|
||||
Elm_Calendar_Mark_Repeat_Type repeat
|
||||
|
||||
# Calendar (api:TODO cb:DONE test:TODO doc:DONE py3:DONE)
|
||||
Evas_Object * elm_calendar_add(Evas_Object *parent)
|
||||
const_char ** elm_calendar_weekdays_names_get(Evas_Object *obj)
|
||||
void elm_calendar_weekdays_names_set(Evas_Object *obj, const_char *weekdays[])
|
||||
void elm_calendar_min_max_year_set(Evas_Object *obj, int min, int max)
|
||||
void elm_calendar_min_max_year_get(Evas_Object *obj, int *min, int *max)
|
||||
void elm_calendar_select_mode_set(Evas_Object *obj, Elm_Calendar_Select_Mode mode)
|
||||
Elm_Calendar_Select_Mode elm_calendar_select_mode_get(Evas_Object *obj)
|
||||
void elm_calendar_selected_time_set(Evas_Object *obj, tm *selected_time)
|
||||
Eina_Bool elm_calendar_selected_time_get(Evas_Object *obj, tm *selected_time)
|
||||
void elm_calendar_format_function_set(Evas_Object *obj, Elm_Calendar_Format_Cb format_func)
|
||||
Elm_Calendar_Mark * elm_calendar_mark_add(Evas_Object *obj, const_char *mark_type, tm *mark_time, Elm_Calendar_Mark_Repeat_Type repeat)
|
||||
void elm_calendar_mark_del(Elm_Calendar_Mark *mark)
|
||||
void elm_calendar_marks_clear(Evas_Object *obj)
|
||||
const_Eina_List * elm_calendar_marks_get(Evas_Object *obj)
|
||||
void elm_calendar_marks_draw(Evas_Object *obj)
|
||||
void elm_calendar_interval_set(Evas_Object *obj, double interval)
|
||||
double elm_calendar_interval_get(Evas_Object *obj)
|
||||
void elm_calendar_first_day_of_week_set(Evas_Object *obj, Elm_Calendar_Weekday day)
|
||||
Elm_Calendar_Weekday elm_calendar_first_day_of_week_get(Evas_Object *obj)
|
||||
|
|
@ -0,0 +1,468 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Calendar mark types
|
||||
|
||||
.. data:: ELM_CALENDAR_UNIQUE
|
||||
|
||||
Default value.
|
||||
|
||||
Marks will be displayed only on event day.
|
||||
|
||||
.. data:: ELM_CALENDAR_DAILY
|
||||
|
||||
Marks will be displayed every day after event day (inclusive).
|
||||
|
||||
.. data:: ELM_CALENDAR_WEEKLY
|
||||
|
||||
Marks will be displayed every week after event day (inclusive) - i.e.
|
||||
each seven days.
|
||||
|
||||
.. data:: ELM_CALENDAR_MONTHLY
|
||||
|
||||
Marks will be displayed every month day that coincides to event day.
|
||||
|
||||
E.g.: if an event is set to 30th Jan, no marks will be displayed on Feb,
|
||||
but will be displayed on 30th Mar
|
||||
|
||||
.. data:: ELM_CALENDAR_ANNUALLY
|
||||
|
||||
Marks will be displayed every year that coincides to event day (and month).
|
||||
|
||||
E.g. an event added to 30th Jan 2012 will be repeated on 30th Jan 2013.
|
||||
|
||||
.. data:: ELM_CALENDAR_LAST_DAY_OF_MONTH
|
||||
|
||||
Marks will be displayed every last day of month after event day
|
||||
(inclusive).
|
||||
|
||||
|
||||
.. rubric:: Calendar selection modes
|
||||
|
||||
.. data:: ELM_CALENDAR_SELECT_MODE_DEFAULT
|
||||
|
||||
Default mode
|
||||
|
||||
.. data:: ELM_CALENDAR_SELECT_MODE_ALWAYS
|
||||
|
||||
Select always
|
||||
|
||||
.. data:: ELM_CALENDAR_SELECT_MODE_NONE
|
||||
|
||||
Don't select
|
||||
|
||||
.. data:: ELM_CALENDAR_SELECT_MODE_ONDEMAND
|
||||
|
||||
Select on demand
|
||||
|
||||
|
||||
.. rubric:: Days
|
||||
|
||||
.. data:: ELM_DAY_SUNDAY
|
||||
|
||||
Sunday
|
||||
|
||||
.. data:: ELM_DAY_MONDAY
|
||||
|
||||
Monday
|
||||
|
||||
.. data:: ELM_DAY_TUESDAY
|
||||
|
||||
Tuesday
|
||||
|
||||
.. data:: ELM_DAY_WEDNESDAY
|
||||
|
||||
Wednesday
|
||||
|
||||
.. data:: ELM_DAY_THURSDAY
|
||||
|
||||
Thursday
|
||||
|
||||
.. data:: ELM_DAY_FRIDAY
|
||||
|
||||
Friday
|
||||
|
||||
.. data:: ELM_DAY_SATURDAY
|
||||
|
||||
Saturday
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
from cpython cimport PyMem_Malloc, PyMem_Free
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
from datetime import date
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_CALENDAR_UNIQUE = enums.ELM_CALENDAR_UNIQUE
|
||||
ELM_CALENDAR_DAILY = enums.ELM_CALENDAR_DAILY
|
||||
ELM_CALENDAR_WEEKLY = enums.ELM_CALENDAR_WEEKLY
|
||||
ELM_CALENDAR_MONTHLY = enums.ELM_CALENDAR_MONTHLY
|
||||
ELM_CALENDAR_ANNUALLY = enums.ELM_CALENDAR_ANNUALLY
|
||||
ELM_CALENDAR_LAST_DAY_OF_MONTH = enums.ELM_CALENDAR_LAST_DAY_OF_MONTH
|
||||
|
||||
ELM_CALENDAR_SELECT_MODE_DEFAULT = enums.ELM_CALENDAR_SELECT_MODE_DEFAULT
|
||||
ELM_CALENDAR_SELECT_MODE_ALWAYS = enums.ELM_CALENDAR_SELECT_MODE_ALWAYS
|
||||
ELM_CALENDAR_SELECT_MODE_NONE = enums.ELM_CALENDAR_SELECT_MODE_NONE
|
||||
ELM_CALENDAR_SELECT_MODE_ONDEMAND = enums.ELM_CALENDAR_SELECT_MODE_ONDEMAND
|
||||
|
||||
ELM_DAY_SUNDAY = enums.ELM_DAY_SUNDAY
|
||||
ELM_DAY_MONDAY = enums.ELM_DAY_MONDAY
|
||||
ELM_DAY_TUESDAY = enums.ELM_DAY_TUESDAY
|
||||
ELM_DAY_WEDNESDAY = enums.ELM_DAY_WEDNESDAY
|
||||
ELM_DAY_THURSDAY = enums.ELM_DAY_THURSDAY
|
||||
ELM_DAY_FRIDAY = enums.ELM_DAY_FRIDAY
|
||||
ELM_DAY_SATURDAY = enums.ELM_DAY_SATURDAY
|
||||
ELM_DAY_LAST = enums.ELM_DAY_LAST
|
||||
|
||||
cdef class CalendarMark(object):
|
||||
|
||||
"""
|
||||
|
||||
An item for the Calendar widget.
|
||||
|
||||
"""
|
||||
|
||||
cdef Elm_Calendar_Mark *obj
|
||||
|
||||
def __init__(self, evasObject cal, mark_type, mark_time, repeat):
|
||||
""".. seealso:: :py:func:`Calendar.mark_add()`"""
|
||||
cdef tm time
|
||||
tmtup = mark_time.timetuple()
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
self.obj = elm_calendar_mark_add(cal.obj, _cfruni(mark_type), &time, repeat)
|
||||
|
||||
def delete(self):
|
||||
"""delete()
|
||||
|
||||
Delete a mark from the calendar.
|
||||
|
||||
If deleting all calendar marks is required, :py:func:`marks_clear()`
|
||||
should be used instead of getting marks list and deleting each one.
|
||||
|
||||
.. seealso:: :py:func:`mark_add()`
|
||||
|
||||
:param mark: The mark to be deleted.
|
||||
:type mark: :py:class:`CalendarMark`
|
||||
|
||||
"""
|
||||
elm_calendar_mark_del(self.obj)
|
||||
|
||||
cdef class Calendar(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
This is a calendar widget.
|
||||
|
||||
It helps applications to flexibly display a calender with day of the week,
|
||||
date, year and month. Applications are able to set specific dates to be
|
||||
reported back, when selected, in the smart callbacks of the calendar widget.
|
||||
The API of this widget lets the applications perform other functions, like:
|
||||
|
||||
- placing marks on specific dates
|
||||
- setting the bounds for the calendar (minimum and maximum years)
|
||||
- setting the day names of the week (e.g. "Thu" or "Thursday")
|
||||
- setting the year and month format.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``changed`` - emitted when the date in the calendar is changed.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_calendar_add(parent.obj))
|
||||
|
||||
property weekdays_names:
|
||||
"""The weekdays' names to be displayed by the calendar.
|
||||
|
||||
By default, weekdays abbreviations get from system are displayed:
|
||||
E.g. for an en_US locale: "Sun, Mon, Tue, Wed, Thu, Fri, Sat"
|
||||
|
||||
The first string should be related to Sunday, the second to Monday...
|
||||
|
||||
The usage should be like this::
|
||||
|
||||
weekdays =
|
||||
(
|
||||
"Sunday", "Monday", "Tuesday", "Wednesday",
|
||||
"Thursday", "Friday", "Saturday"
|
||||
)
|
||||
calendar.weekdays_names = weekdays
|
||||
|
||||
:type: tuple of strings
|
||||
|
||||
.. warning:: It must have 7 elements, or it will access invalid memory.
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef const_char **lst
|
||||
cdef const_char *weekday
|
||||
ret = []
|
||||
lst = elm_calendar_weekdays_names_get(self.obj)
|
||||
for i from 0 <= i < 7:
|
||||
weekday = lst[i]
|
||||
if weekday != NULL:
|
||||
ret.append(_ctouni(weekday))
|
||||
return ret
|
||||
|
||||
def __set__(self, weekdays):
|
||||
cdef int i, day_len
|
||||
cdef char **days, *weekday
|
||||
days = <char **>PyMem_Malloc(7 * sizeof(char*))
|
||||
for i from 0 <= i < 7:
|
||||
weekday = _fruni(weekdays[i])
|
||||
day_len = len(weekday)
|
||||
days[i] = <char *>PyMem_Malloc(day_len + 1)
|
||||
memcpy(days[i], weekday, day_len + 1)
|
||||
elm_calendar_weekdays_names_set(self.obj, <const_char **>days)
|
||||
|
||||
property min_max_year:
|
||||
"""The minimum and maximum values for the year
|
||||
|
||||
Maximum must be greater than minimum, except if you don't want to set
|
||||
maximum year.
|
||||
Default values are 1902 and -1.
|
||||
|
||||
If the maximum year is a negative value, it will be limited depending
|
||||
on the platform architecture (year 2037 for 32 bits)
|
||||
|
||||
:type: tuple of ints
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef int min, max
|
||||
elm_calendar_min_max_year_get(self.obj, &min, &max)
|
||||
return (min, max)
|
||||
def __set__(self, value):
|
||||
cdef int min, max
|
||||
min, max = value
|
||||
elm_calendar_min_max_year_set(self.obj, min, max)
|
||||
|
||||
property select_mode:
|
||||
"""The day selection mode used.
|
||||
|
||||
:type: Elm_Calendar_Select_Mode
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_calendar_select_mode_get(self.obj)
|
||||
def __set__(self, mode):
|
||||
elm_calendar_select_mode_set(self.obj, mode)
|
||||
|
||||
property selected_time:
|
||||
"""Selected date on the calendar.
|
||||
|
||||
Setting this changes the displayed month if needed.
|
||||
Selected date changes when the user goes to next/previous month or
|
||||
select a day pressing over it on calendar.
|
||||
|
||||
:type: datetime.date
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_calendar_selected_time_get(self.obj, &time)
|
||||
ret = date( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday)
|
||||
return ret
|
||||
|
||||
def __set__(self, selected_time):
|
||||
cdef tm time
|
||||
tmtup = selected_time.timetuple()
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_calendar_selected_time_set(self.obj, &time)
|
||||
|
||||
property format_function:
|
||||
"""Set a function to format the string that will be used to display
|
||||
month and year.
|
||||
|
||||
By default it uses strftime with "%B %Y" format string.
|
||||
It should allocate the memory that will be used by the string,
|
||||
that will be freed by the widget after usage.
|
||||
A pointer to the string and a pointer to the time struct will be provided.
|
||||
|
||||
Example::
|
||||
|
||||
static char *
|
||||
_format_month_year(struct tm selected_time)
|
||||
{
|
||||
char buf[32];
|
||||
if (!strftime(buf, sizeof(buf), "%B %Y", selected_time)) return NULL;
|
||||
return strdup(buf);
|
||||
}
|
||||
|
||||
elm_calendar_format_function_set(calendar, _format_month_year);
|
||||
|
||||
:param format_func: Function to set the month-year string given
|
||||
the selected date
|
||||
:type format_func: function
|
||||
|
||||
"""
|
||||
def __set__(self, format_func):
|
||||
pass
|
||||
#elm_calendar_format_function_set(self.obj, format_func)
|
||||
|
||||
def mark_add(self, mark_type, mark_time, repeat):
|
||||
"""mark_add(mark_type, mark_time, repeat) -> CalendarMark
|
||||
|
||||
Add a new mark to the calendar
|
||||
|
||||
Add a mark that will be drawn in the calendar respecting the insertion
|
||||
time and periodicity. It will emit the type as signal to the widget theme.
|
||||
Default theme supports "holiday" and "checked", but it can be extended.
|
||||
|
||||
It won't immediately update the calendar, drawing the marks.
|
||||
For this, call :py:func:`marks_draw()`. However, when user selects
|
||||
next or previous month calendar forces marks drawn.
|
||||
|
||||
Marks created with this method can be deleted with :py:func:`mark_del()`.
|
||||
|
||||
Example::
|
||||
|
||||
struct tm selected_time;
|
||||
time_t current_time;
|
||||
|
||||
current_time = time(NULL) + 5 84600;
|
||||
localtime_r(¤t_time, &selected_time);
|
||||
elm_calendar_mark_add(cal, "holiday", selected_time,
|
||||
ELM_CALENDAR_ANNUALLY);
|
||||
|
||||
current_time = time(NULL) + 1 84600;
|
||||
localtime_r(¤t_time, &selected_time);
|
||||
elm_calendar_mark_add(cal, "checked", selected_time, ELM_CALENDAR_UNIQUE);
|
||||
|
||||
elm_calendar_marks_draw(cal);
|
||||
|
||||
.. seealso::
|
||||
:py:func:`marks_draw()`
|
||||
:py:func:`mark_del()`
|
||||
|
||||
:param mark_type: A string used to define the type of mark. It will be
|
||||
emitted to the theme, that should display a related modification on these
|
||||
days representation.
|
||||
:type mark_type: string
|
||||
:param mark_time: A time struct to represent the date of inclusion of the
|
||||
mark. For marks that repeats it will just be displayed after the inclusion
|
||||
date in the calendar.
|
||||
:type mark_time: tm struct
|
||||
:param repeat: Repeat the event following this periodicity. Can be a unique
|
||||
mark (that don't repeat), daily, weekly, monthly or annually.
|
||||
:type repeat: Elm_Calendar_Mark_Repeat_Type
|
||||
:return: The created mark or ``None`` upon failure.
|
||||
:rtype: :py:class:`CalendarMark`
|
||||
|
||||
"""
|
||||
return CalendarMark(self, mark_type, mark_time, repeat)
|
||||
|
||||
property marks:
|
||||
"""Calendar marks.
|
||||
|
||||
:type: tuple of :py:class:`CalendarMark`
|
||||
|
||||
"""
|
||||
#def __get__(self):
|
||||
#const_Eina_List *elm_calendar_marks_get(self.obj)
|
||||
#def __set__(self, value):
|
||||
def __del__(self):
|
||||
elm_calendar_marks_clear(self.obj)
|
||||
|
||||
def marks_draw(self):
|
||||
"""marks_draw()
|
||||
|
||||
Draw calendar marks.
|
||||
|
||||
Should be used after adding, removing or clearing marks.
|
||||
It will go through the entire marks list updating the calendar.
|
||||
If lots of marks will be added, add all the marks and then call
|
||||
this function.
|
||||
|
||||
When the month is changed, i.e. user selects next or previous month,
|
||||
marks will be drawn.
|
||||
|
||||
.. seealso::
|
||||
:py:func:`mark_add()`
|
||||
:py:func:`mark_del()`
|
||||
:py:func:`marks_clear()`
|
||||
|
||||
"""
|
||||
elm_calendar_marks_draw(self.obj)
|
||||
|
||||
property interval:
|
||||
"""Set the interval on time updates for an user mouse button hold
|
||||
on calendar widgets' month selection.
|
||||
|
||||
This interval value is **decreased** while the user holds the
|
||||
mouse pointer either selecting next or previous month.
|
||||
|
||||
This helps the user to get to a given month distant from the
|
||||
current one easier/faster, as it will start to change quicker and
|
||||
quicker on mouse button holds.
|
||||
|
||||
The calculation for the next change interval value, starting from
|
||||
the one set with this call, is the previous interval divided by
|
||||
1.05, so it decreases a little bit.
|
||||
|
||||
The default starting interval value for automatic changes is
|
||||
**0.85** seconds.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_calendar_interval_get(self.obj)
|
||||
def __set__(self, interval):
|
||||
elm_calendar_interval_set(self.obj, interval)
|
||||
|
||||
property first_day_of_week:
|
||||
"""The first day of week to use on the calendar widget.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_calendar_first_day_of_week_get(self.obj)
|
||||
def __set__(self, day):
|
||||
elm_calendar_first_day_of_week_set(self.obj, day)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
"""Emitted when the date in the calendar is changed."""
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_calendar", Calendar)
|
|
@ -0,0 +1,26 @@
|
|||
# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
|
||||
#
|
||||
# This file is part of python-elementary.
|
||||
#
|
||||
# python-elementary is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# python-elementary 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 Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with python-elementary. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from efl.eo cimport const_char_ptr
|
||||
|
||||
def _cb_string_conv(long addr):
|
||||
cdef const_char_ptr s = <const_char_ptr>addr
|
||||
if s == NULL:
|
||||
return None
|
||||
else:
|
||||
return s
|
|
@ -0,0 +1,6 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_check_add(Evas_Object *parent)
|
||||
void elm_check_state_set(Evas_Object *obj, Eina_Bool state)
|
||||
Eina_Bool elm_check_state_get(Evas_Object *obj)
|
|
@ -15,34 +15,65 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cdef class Check(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
The check widget allows for toggling a value between true and false.
|
||||
|
||||
Check objects are a lot like radio objects in layout and functionality,
|
||||
except they do not work as a group, but independently, and only toggle
|
||||
the value of a boolean between false and true. :py:attr:`state` sets the
|
||||
boolean state and :py:attr:`state` returns the current state.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``changed`` - This is called whenever the user changes the state of
|
||||
the check objects.
|
||||
|
||||
Default content parts of the check widget that you can use for are:
|
||||
|
||||
- "icon" - An icon of the check
|
||||
|
||||
Default text parts of the check widget that you can use for are:
|
||||
|
||||
- "default" - A label of the check
|
||||
- "on" - On state label of the check
|
||||
- "off" - Off state label of the check
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_check_add(parent.obj))
|
||||
|
||||
def state_set(self, value):
|
||||
if value:
|
||||
elm_check_state_set(self.obj, 1)
|
||||
else:
|
||||
elm_check_state_set(self.obj, 0)
|
||||
|
||||
def state_get(self):
|
||||
cdef Eina_Bool state
|
||||
state = elm_check_state_get(self.obj)
|
||||
if state == 0:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
property state:
|
||||
"""The of/off state of the check object
|
||||
|
||||
This property reflects the state of the check. Setting it **doesn't**
|
||||
cause the "changed" signal to be emitted.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_check_state_get(self.obj))
|
||||
|
||||
def __set__(self, value):
|
||||
elm_check_state_set(self.obj, value)
|
||||
|
||||
def state_set(self, value):
|
||||
elm_check_state_set(self.obj, value)
|
||||
def state_get(self):
|
||||
return bool(elm_check_state_get(self.obj))
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
"""This is called whenever the user changes the state of the check
|
||||
objects."""
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
|
@ -0,0 +1,17 @@
|
|||
from efl.evas cimport Evas_Object, Eina_Bool
|
||||
from enums cimport Elm_Clock_Edit_Mode
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_clock_add(Evas_Object *parent)
|
||||
void elm_clock_time_set(Evas_Object *obj, int hrs, int min, int sec)
|
||||
void elm_clock_time_get(Evas_Object *obj, int *hrs, int *min, int *sec)
|
||||
void elm_clock_edit_set(Evas_Object *obj, Eina_Bool edit)
|
||||
Eina_Bool elm_clock_edit_get(Evas_Object *obj)
|
||||
void elm_clock_edit_mode_set(Evas_Object *obj, Elm_Clock_Edit_Mode mode)
|
||||
Elm_Clock_Edit_Mode elm_clock_edit_mode_get(Evas_Object *obj)
|
||||
void elm_clock_show_am_pm_set(Evas_Object *obj, Eina_Bool am_pm)
|
||||
Eina_Bool elm_clock_show_am_pm_get(Evas_Object *obj)
|
||||
void elm_clock_show_seconds_set(Evas_Object *obj, Eina_Bool seconds)
|
||||
Eina_Bool elm_clock_show_seconds_get(Evas_Object *obj)
|
||||
void elm_clock_first_interval_set(Evas_Object *obj, double interval)
|
||||
double elm_clock_first_interval_get(Evas_Object *obj)
|
|
@ -0,0 +1,276 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Clock edit modes
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_DEFAULT
|
||||
|
||||
Default edit
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_HOUR_DECIMAL
|
||||
|
||||
Edit hours' decimal
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_HOUR_UNIT
|
||||
|
||||
Edit hours' unit
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_MIN_DECIMAL
|
||||
|
||||
Edit minutes' decimal
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_MIN_UNIT
|
||||
|
||||
Edit minutes' unit
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_SEC_DECIMAL
|
||||
|
||||
Edit seconds' decimal
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_SEC_UNIT
|
||||
|
||||
Edit seconds' unit
|
||||
|
||||
.. data:: ELM_CLOCK_EDIT_ALL
|
||||
|
||||
Edit all
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_CLOCK_EDIT_DEFAULT = enums.ELM_CLOCK_EDIT_DEFAULT
|
||||
ELM_CLOCK_EDIT_HOUR_DECIMAL = enums.ELM_CLOCK_EDIT_HOUR_DECIMAL
|
||||
ELM_CLOCK_EDIT_HOUR_UNIT = enums.ELM_CLOCK_EDIT_HOUR_UNIT
|
||||
ELM_CLOCK_EDIT_MIN_DECIMAL = enums.ELM_CLOCK_EDIT_MIN_DECIMAL
|
||||
ELM_CLOCK_EDIT_MIN_UNIT = enums.ELM_CLOCK_EDIT_MIN_UNIT
|
||||
ELM_CLOCK_EDIT_SEC_DECIMAL = enums.ELM_CLOCK_EDIT_SEC_DECIMAL
|
||||
ELM_CLOCK_EDIT_SEC_UNIT = enums.ELM_CLOCK_EDIT_SEC_UNIT
|
||||
ELM_CLOCK_EDIT_ALL = enums.ELM_CLOCK_EDIT_ALL
|
||||
|
||||
cdef class Clock(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
This is a digital clock widget.
|
||||
|
||||
In its default theme, it has a vintage "flipping numbers clock" appearance,
|
||||
which will animate sheets of individual algarisms individually as time goes
|
||||
by.
|
||||
|
||||
A newly created clock will fetch system's time (already considering
|
||||
local time adjustments) to start with, and will tick accordingly. It may
|
||||
or may not show seconds.
|
||||
|
||||
Clocks have an **edition** mode. When in it, the sheets will display
|
||||
extra arrow indications on the top and bottom and the user may click on
|
||||
them to raise or lower the time values. After it's told to exit edition
|
||||
mode, it will keep ticking with that new time set (it keeps the
|
||||
difference from local time).
|
||||
|
||||
Also, when under edition mode, user clicks on the cited arrows which are
|
||||
**held** for some time will make the clock to flip the sheet, thus
|
||||
editing the time, continuously and automatically for the user. The
|
||||
interval between sheet flips will keep growing in time, so that it helps
|
||||
the user to reach a time which is distant from the one set.
|
||||
|
||||
The time display is, by default, in military mode (24h), but an am/pm
|
||||
indicator may be optionally shown, too, when it will switch to 12h.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``changed`` - the clock's user changed the time
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_clock_add(parent.obj))
|
||||
|
||||
property time:
|
||||
"""The clock widget's time
|
||||
|
||||
This property reflects the time that is showed by the clock widget.
|
||||
|
||||
Values **must** be set within the following ranges:
|
||||
|
||||
- 0 - 23, for hours
|
||||
- 0 - 59, for minutes
|
||||
- 0 - 59, for seconds,
|
||||
|
||||
even if the clock is not in "military" mode.
|
||||
|
||||
.. warning:: The behavior for values set out of those ranges is
|
||||
**undefined**.
|
||||
|
||||
:type: (int h, int m, int s)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef int hrs, min, sec
|
||||
elm_clock_time_get(self.obj, &hrs, &min, &sec)
|
||||
return (hrs, min, sec)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int hrs, min, sec
|
||||
hrs, min, sec = value
|
||||
elm_clock_time_set(self.obj, hrs, min, sec)
|
||||
|
||||
def time_set(self, hours, minutes, seconds):
|
||||
elm_clock_time_set(self.obj, hours, minutes, seconds)
|
||||
def time_get(self):
|
||||
cdef int hrs, min, sec
|
||||
elm_clock_time_get(self.obj, &hrs, &min, &sec)
|
||||
return (hrs, min, sec)
|
||||
|
||||
property edit:
|
||||
"""Whether a given clock widget is under **edition mode** or under
|
||||
(default) displaying-only mode.
|
||||
|
||||
This property reflects whether the clock editable or not **by user
|
||||
interaction**. When in edition mode, clocks **stop** ticking, until
|
||||
one brings them back to canonical mode. The :py:attr:`edit_mode`
|
||||
property will influence which digits of the clock will be editable.
|
||||
|
||||
.. note:: am/pm sheets, if being shown, will **always** be editable
|
||||
under edition mode.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_clock_edit_get(self.obj))
|
||||
|
||||
def __set__(self, edit):
|
||||
elm_clock_edit_set(self.obj, edit)
|
||||
|
||||
def edit_set(self, edit):
|
||||
elm_clock_edit_set(self.obj, edit)
|
||||
def edit_get(self, edit):
|
||||
return bool(elm_clock_edit_get(self.obj))
|
||||
|
||||
property edit_mode:
|
||||
"""Which digits of the given clock widget should be editable when in
|
||||
edition mode.
|
||||
|
||||
:type: Elm_Clock_Edit_Mode
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_clock_edit_mode_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_clock_edit_mode_set(self.obj, mode)
|
||||
|
||||
def edit_mode_set(self, mode):
|
||||
elm_clock_edit_mode_set(self.obj, mode)
|
||||
def edit_mode_get(self):
|
||||
return elm_clock_edit_mode_get(self.obj)
|
||||
|
||||
property show_am_pm:
|
||||
"""Whether the given clock widget must show hours in military or
|
||||
am/pm mode
|
||||
|
||||
This property reflects if the clock must show hours in military or
|
||||
am/pm mode. In some countries like Brazil the military mode
|
||||
(00-24h-format) is used, in opposition to the USA, where the
|
||||
am/pm mode is more commonly used.
|
||||
|
||||
``True``, if in am/pm mode, ``False`` if in military
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_clock_show_am_pm_get(self.obj)
|
||||
|
||||
def __set__(self, am_pm):
|
||||
elm_clock_show_am_pm_set(self.obj, am_pm)
|
||||
|
||||
def show_am_pm_set(self, am_pm):
|
||||
elm_clock_show_am_pm_set(self.obj, am_pm)
|
||||
def show_am_pm_get(self):
|
||||
return elm_clock_show_am_pm_get(self.obj)
|
||||
|
||||
property show_seconds:
|
||||
"""Whether the given clock widget must show time with seconds or not
|
||||
|
||||
By default, they are **not** shown.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_clock_show_seconds_get(self.obj)
|
||||
|
||||
def __set__(self, seconds):
|
||||
elm_clock_show_seconds_set(self.obj, seconds)
|
||||
|
||||
def show_seconds_set(self, seconds):
|
||||
elm_clock_show_seconds_set(self.obj, seconds)
|
||||
def show_seconds_get(self):
|
||||
return elm_clock_show_seconds_get(self.obj)
|
||||
|
||||
property first_interval:
|
||||
"""The first interval on time updates for a user mouse button hold
|
||||
on clock widgets' time edition.
|
||||
|
||||
This interval value is **decreased** while the user holds the
|
||||
mouse pointer either incrementing or decrementing a given the
|
||||
clock digit's value.
|
||||
|
||||
This helps the user to get to a given time distant from the
|
||||
current one easier/faster, as it will start to flip quicker and
|
||||
quicker on mouse button holds.
|
||||
|
||||
The calculation for the next flip interval value, starting from
|
||||
the one set with this call, is the previous interval divided by
|
||||
1.05, so it decreases a little bit.
|
||||
|
||||
The default starting interval value for automatic flips is
|
||||
**0.85** seconds.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_clock_first_interval_get(self.obj)
|
||||
|
||||
def __set__(self, interval):
|
||||
elm_clock_first_interval_set(self.obj, interval)
|
||||
|
||||
def first_interval_set(self, interval):
|
||||
elm_clock_first_interval_set(self.obj, interval)
|
||||
def first_interval_get(self):
|
||||
return elm_clock_first_interval_get(self.obj)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
"""The clock's user changed the time"""
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_clock", Clock)
|
|
@ -0,0 +1,17 @@
|
|||
from efl.evas cimport Evas_Object
|
||||
from object_item cimport Elm_Object_Item
|
||||
from enums cimport Elm_Colorselector_Mode
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object * elm_colorselector_add(Evas_Object *parent)
|
||||
void elm_colorselector_color_set(Evas_Object *obj, int r, int g, int b, int a)
|
||||
void elm_colorselector_color_get(Evas_Object *obj, int *r, int *g, int *b, int *a)
|
||||
void elm_colorselector_mode_set(Evas_Object *obj, Elm_Colorselector_Mode mode)
|
||||
Elm_Colorselector_Mode elm_colorselector_mode_get(Evas_Object *obj)
|
||||
void elm_colorselector_palette_item_color_get(Elm_Object_Item *it, int *r, int *g, int *b, int *a)
|
||||
void elm_colorselector_palette_item_color_set(Elm_Object_Item *it, int r, int g, int b, int a)
|
||||
Elm_Object_Item * elm_colorselector_palette_color_add(Evas_Object *obj, int r, int g, int b, int a)
|
||||
void elm_colorselector_palette_clear(Evas_Object *obj)
|
||||
void elm_colorselector_palette_name_set(Evas_Object *obj, const_char *palette_name)
|
||||
const_char * elm_colorselector_palette_name_get(Evas_Object *obj)
|
|
@ -14,10 +14,45 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Colorselector modes
|
||||
|
||||
.. data:: ELM_COLORSELECTOR_PALETTE
|
||||
|
||||
Show palette
|
||||
|
||||
.. data:: ELM_COLORSELECTOR_COMPONENTS
|
||||
|
||||
Show components
|
||||
|
||||
.. data:: ELM_COLORSELECTOR_BOTH
|
||||
|
||||
Show palette and components
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
from object_item cimport ObjectItem
|
||||
from object_item import _cb_object_item_conv
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_COLORSELECTOR_PALETTE = enums.ELM_COLORSELECTOR_PALETTE
|
||||
ELM_COLORSELECTOR_COMPONENTS = enums.ELM_COLORSELECTOR_COMPONENTS
|
||||
ELM_COLORSELECTOR_BOTH = enums.ELM_COLORSELECTOR_BOTH
|
||||
|
||||
cdef class ColorselectorPaletteItem(ObjectItem):
|
||||
|
||||
"""
|
||||
|
||||
An item for the :py:class:`Colorselector` widget.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject cs, r, g, b, a):
|
||||
cdef Elm_Object_Item *item = elm_colorselector_palette_color_add(cs.obj, r, g, b, a)
|
||||
if item != NULL:
|
||||
|
@ -25,15 +60,12 @@ cdef class ColorselectorPaletteItem(ObjectItem):
|
|||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
def color_get(self):
|
||||
cdef int r, g, b, a
|
||||
elm_colorselector_palette_item_color_get(self.item, &r, &g, &b, &a)
|
||||
return (r, g, b, a)
|
||||
|
||||
def color_set(self, r, g, b, a):
|
||||
elm_colorselector_palette_item_color_set(self.item, r, g, b, a)
|
||||
|
||||
property color:
|
||||
"""The palette item's color.
|
||||
|
||||
:type: tuple of ints
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef int r, g, b, a
|
||||
elm_colorselector_palette_item_color_get(self.item, &r, &g, &b, &a)
|
||||
|
@ -43,21 +75,47 @@ cdef class ColorselectorPaletteItem(ObjectItem):
|
|||
r, g, b, a = value
|
||||
elm_colorselector_palette_item_color_set(self.item, r, g, b, a)
|
||||
|
||||
def color_get(self):
|
||||
cdef int r, g, b, a
|
||||
elm_colorselector_palette_item_color_get(self.item, &r, &g, &b, &a)
|
||||
return (r, g, b, a)
|
||||
def color_set(self, r, g, b, a):
|
||||
elm_colorselector_palette_item_color_set(self.item, r, g, b, a)
|
||||
|
||||
cdef class Colorselector(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
A Colorselector is a color selection widget.
|
||||
|
||||
It allows application to set a series of colors. It also allows to
|
||||
load/save colors from/to config with a unique identifier, by default,
|
||||
the colors are loaded/saved from/to config using "default" identifier.
|
||||
The colors can be picked by user from the color set by clicking on
|
||||
individual color item on the palette or by selecting it from selector.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``"changed"`` - When the color value changes on selector
|
||||
- ``"color,item,selected"`` - When user clicks on color item.
|
||||
The event_info parameter of the callback will be the selected
|
||||
color item.
|
||||
- ``"color,item,longpressed"`` - When user long presses on color item.
|
||||
The event_info parameter of the callback will be the selected
|
||||
color item.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_colorselector_add(parent.obj))
|
||||
|
||||
def color_set(self, r, g, b, a):
|
||||
elm_colorselector_color_set(self.obj, r, g, b, a)
|
||||
|
||||
def color_get(self):
|
||||
cdef int r, g, b, a
|
||||
elm_colorselector_color_get(self.obj, &r, &g, &b, &a)
|
||||
return (r, g, b, a)
|
||||
|
||||
property color:
|
||||
"""The current color (r, g, b, a).
|
||||
|
||||
:type: tuple of ints
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef int r, g, b, a
|
||||
elm_colorselector_color_get(self.obj, &r, &g, &b, &a)
|
||||
|
@ -67,43 +125,86 @@ cdef class Colorselector(LayoutClass):
|
|||
r, g, b, a = value
|
||||
elm_colorselector_color_set(self.obj, r, g, b, a)
|
||||
|
||||
def mode_set(self, mode):
|
||||
elm_colorselector_mode_set(self.obj, mode)
|
||||
|
||||
def mode_get(self):
|
||||
return elm_colorselector_mode_get(self.obj)
|
||||
def color_set(self, r, g, b, a):
|
||||
elm_colorselector_color_set(self.obj, r, g, b, a)
|
||||
def color_get(self):
|
||||
cdef int r, g, b, a
|
||||
elm_colorselector_color_get(self.obj, &r, &g, &b, &a)
|
||||
return (r, g, b, a)
|
||||
|
||||
property mode:
|
||||
"""Colorselector's mode.
|
||||
|
||||
Colorselector supports three modes palette only, selector only and both.
|
||||
|
||||
:type: Elm_Colorselector_Mode
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_colorselector_mode_get(self.obj)
|
||||
def __set__(self, mode):
|
||||
elm_colorselector_mode_set(self.obj, mode)
|
||||
|
||||
def mode_set(self, mode):
|
||||
elm_colorselector_mode_set(self.obj, mode)
|
||||
def mode_get(self):
|
||||
return elm_colorselector_mode_get(self.obj)
|
||||
|
||||
def palette_color_add(self, r, g, b, a):
|
||||
"""palette_color_add(int r, int g, int b, int a) -> ColorselectorPaletteItem
|
||||
|
||||
Add a new color item to palette.
|
||||
|
||||
:param r: r-value of color
|
||||
:type r: int
|
||||
:param g: g-value of color
|
||||
:type g: int
|
||||
:param b: b-value of color
|
||||
:type b: int
|
||||
:param a: a-value of color
|
||||
:type a: int
|
||||
:return: A new color palette Item.
|
||||
:rtype: :py:class:`ColorselectorPaletteItem`
|
||||
|
||||
"""
|
||||
return ColorselectorPaletteItem(self, r, g, b, a)
|
||||
|
||||
def palette_clear(self):
|
||||
"""palette_clear()
|
||||
|
||||
Clear the palette items."""
|
||||
elm_colorselector_palette_clear(self.obj)
|
||||
|
||||
def palette_name_set(self, palette_name):
|
||||
elm_colorselector_palette_name_set(self.obj, _cfruni(palette_name))
|
||||
|
||||
def palette_name_get(self):
|
||||
return _ctouni(elm_colorselector_palette_name_get(self.obj))
|
||||
|
||||
property palette_name:
|
||||
"""The current palette's name
|
||||
|
||||
When colorpalette name is set, colors will be loaded from and saved
|
||||
to config using the set name. If no name is set then colors will be
|
||||
loaded from or saved to "default" config.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_colorselector_palette_name_get(self.obj))
|
||||
def __set__(self, palette_name):
|
||||
elm_colorselector_palette_name_set(self.obj, _cfruni(palette_name))
|
||||
|
||||
def palette_name_set(self, palette_name):
|
||||
elm_colorselector_palette_name_set(self.obj, _cfruni(palette_name))
|
||||
def palette_name_get(self):
|
||||
return _ctouni(elm_colorselector_palette_name_get(self.obj))
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
"""When the color value changes on selector"""
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
def callback_color_item_selected_add(self, func, *args, **kwargs):
|
||||
"""When user clicks on color item. The event_info parameter of the
|
||||
callback will be the selected color item."""
|
||||
self._callback_add_full("color,item,selected",
|
||||
_cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
@ -113,6 +214,8 @@ cdef class Colorselector(LayoutClass):
|
|||
_cb_object_item_conv, func)
|
||||
|
||||
def callback_color_item_longpressed_add(self, func, *args, **kwargs):
|
||||
"""When user long presses on color item. The event_info parameter of
|
||||
the callback will be the selected color item."""
|
||||
self._callback_add_full("color,item,longpressed",
|
||||
_cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
|
@ -0,0 +1,90 @@
|
|||
from efl.evas cimport Eina_Bool, Eina_List, const_Eina_List, Evas_Coord, Evas_Object, Evas_Font_Size
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
#font
|
||||
ctypedef struct Elm_Font_Overlay:
|
||||
const_char *text_class
|
||||
const_char *font
|
||||
Evas_Font_Size size
|
||||
|
||||
#text
|
||||
ctypedef struct Elm_Text_Class:
|
||||
const_char *name
|
||||
const_char *desc
|
||||
|
||||
# Config (py3: TODO)
|
||||
Eina_Bool elm_config_save()
|
||||
void elm_config_reload()
|
||||
void elm_config_all_flush()
|
||||
const_char * elm_config_profile_get()
|
||||
const_char * elm_config_profile_dir_get(const_char *profile, Eina_Bool is_user)
|
||||
void elm_config_profile_dir_free(const_char *p_dir)
|
||||
Eina_List * elm_config_profile_list_get()
|
||||
void elm_config_profile_list_free(Eina_List *l)
|
||||
void elm_config_profile_set(const_char *profile)
|
||||
Eina_Bool elm_config_scroll_bounce_enabled_get()
|
||||
void elm_config_scroll_bounce_enabled_set(Eina_Bool enabled)
|
||||
double elm_config_scroll_bounce_friction_get()
|
||||
void elm_config_scroll_bounce_friction_set(double friction)
|
||||
double elm_config_scroll_page_scroll_friction_get()
|
||||
void elm_config_scroll_page_scroll_friction_set(double friction)
|
||||
double elm_config_scroll_bring_in_scroll_friction_get()
|
||||
void elm_config_scroll_bring_in_scroll_friction_set(double friction)
|
||||
double elm_config_scroll_zoom_friction_get()
|
||||
void elm_config_scroll_zoom_friction_set(double friction)
|
||||
Eina_Bool elm_config_scroll_thumbscroll_enabled_get()
|
||||
void elm_config_scroll_thumbscroll_enabled_set(Eina_Bool enabled)
|
||||
unsigned int elm_config_scroll_thumbscroll_threshold_get()
|
||||
void elm_config_scroll_thumbscroll_threshold_set(unsigned int threshold)
|
||||
double elm_config_scroll_thumbscroll_momentum_threshold_get()
|
||||
void elm_config_scroll_thumbscroll_momentum_threshold_set(double threshold)
|
||||
double elm_config_scroll_thumbscroll_friction_get()
|
||||
void elm_config_scroll_thumbscroll_friction_set(double friction)
|
||||
double elm_config_scroll_thumbscroll_border_friction_get()
|
||||
void elm_config_scroll_thumbscroll_border_friction_set(double friction)
|
||||
double elm_config_scroll_thumbscroll_sensitivity_friction_get()
|
||||
void elm_config_scroll_thumbscroll_sensitivity_friction_set(double friction)
|
||||
double elm_config_longpress_timeout_get()
|
||||
void elm_config_longpress_timeout_set(double longpress_timeout)
|
||||
double elm_config_tooltip_delay_get()
|
||||
Eina_Bool elm_config_tooltip_delay_set(double delay)
|
||||
int elm_config_cursor_engine_only_get()
|
||||
Eina_Bool elm_config_cursor_engine_only_set(int engine_only)
|
||||
double elm_config_scale_get()
|
||||
void elm_config_scale_set(double scale)
|
||||
Eina_Bool elm_config_password_show_last_get()
|
||||
void elm_config_password_show_last_set(Eina_Bool password_show_last)
|
||||
double elm_config_password_show_last_timeout_get()
|
||||
void elm_config_password_show_last_timeout_set(double password_show_last_timeout)
|
||||
const_char * elm_config_engine_get()
|
||||
void elm_config_engine_set(const_char *engine)
|
||||
const_char * elm_config_preferred_engine_get()
|
||||
void elm_config_preferred_engine_set(const_char *engine)
|
||||
Eina_List * elm_config_text_classes_list_get()
|
||||
void elm_config_text_classes_list_free(Eina_List *list)
|
||||
Eina_List * elm_config_font_overlay_list_get()
|
||||
void elm_config_font_overlay_set(const_char *text_class, const_char *font, Evas_Font_Size size)
|
||||
void elm_config_font_overlay_unset(const_char *text_class)
|
||||
void elm_config_font_overlay_apply()
|
||||
Evas_Coord elm_config_finger_size_get()
|
||||
void elm_config_finger_size_set(Evas_Coord size)
|
||||
int elm_config_cache_flush_interval_get()
|
||||
void elm_config_cache_flush_interval_set(int size)
|
||||
Eina_Bool elm_config_cache_flush_enabled_get()
|
||||
void elm_config_cache_flush_enabled_set(Eina_Bool enabled)
|
||||
int elm_config_cache_font_cache_size_get()
|
||||
void elm_config_cache_font_cache_size_set(int size)
|
||||
int elm_config_cache_image_cache_size_get()
|
||||
void elm_config_cache_image_cache_size_set(int size)
|
||||
int elm_config_cache_edje_file_cache_size_get()
|
||||
void elm_config_cache_edje_file_cache_size_set(int size)
|
||||
int elm_config_cache_edje_collection_cache_size_get()
|
||||
void elm_config_cache_edje_collection_cache_size_set(int size)
|
||||
Eina_Bool elm_config_focus_highlight_enabled_get()
|
||||
void elm_config_focus_highlight_enabled_set(Eina_Bool enable)
|
||||
Eina_Bool elm_config_focus_highlight_animate_get()
|
||||
void elm_config_focus_highlight_animate_set(Eina_Bool animate)
|
||||
Eina_Bool elm_config_mirrored_get()
|
||||
void elm_config_mirrored_set(Eina_Bool mirrored)
|
|
@ -0,0 +1,692 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from efl.eo cimport _strings_to_python
|
||||
|
||||
cdef class Configuration(object):
|
||||
|
||||
"""
|
||||
|
||||
Elementary configuration is formed by a set options bounded to a
|
||||
given profile, like theme, "finger size", etc.
|
||||
|
||||
These are functions with which one synchronizes changes made to those
|
||||
values to the configuration storing files, de facto. You most probably
|
||||
don't want to use the functions in this group unless you're writing an
|
||||
elementary configuration manager.
|
||||
|
||||
.. rubric:: Profiles
|
||||
|
||||
Profiles are pre-set options that affect the whole look-and-feel of
|
||||
Elementary-based applications. There are, for example, profiles
|
||||
aimed at desktop computer applications and others aimed at mobile,
|
||||
touchscreen-based ones. You most probably don't want to use the
|
||||
functions in this group unless you're writing an elementary
|
||||
configuration manager.
|
||||
|
||||
.. rubric:: Elementary Scrolling
|
||||
|
||||
These set how scrollable views in Elementary widgets should behave on
|
||||
user interaction.
|
||||
|
||||
.. rubric:: Password show last
|
||||
|
||||
Show last feature of password mode enables user to view the last input
|
||||
entered for few seconds before masking it. These functions allow to set
|
||||
this feature in password mode of entry widget and also allow to
|
||||
manipulate the duration for which the input has to be visible.
|
||||
|
||||
.. rubric:: Elementary Engine
|
||||
|
||||
These are functions setting and querying which rendering engine
|
||||
Elementary will use for drawing its windows' pixels.
|
||||
|
||||
The following are the available engines:
|
||||
|
||||
- "software_x11"
|
||||
- "fb"
|
||||
- "directfb"
|
||||
- "software_16_x11"
|
||||
- "software_8_x11"
|
||||
- "xrender_x11"
|
||||
- "opengl_x11"
|
||||
- "software_gdi"
|
||||
- "software_16_wince_gdi"
|
||||
- "sdl"
|
||||
- "software_16_sdl"
|
||||
- "opengl_sdl"
|
||||
- "buffer"
|
||||
- "ews"
|
||||
- "opengl_cocoa"
|
||||
- "psl1ght"
|
||||
|
||||
"""
|
||||
|
||||
def save(self):
|
||||
"""save()
|
||||
|
||||
Save back Elementary's configuration, so that it will persist on
|
||||
future sessions.
|
||||
|
||||
This function will take effect -- thus, do I/O -- immediately. Use
|
||||
it when you want to save all configuration changes at once. The
|
||||
current configuration set will get saved onto the current profile
|
||||
configuration file.
|
||||
|
||||
:return: ``True``, when successful. ``False``, otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(elm_config_save())
|
||||
|
||||
def reload(self):
|
||||
"""reload()
|
||||
|
||||
Reload Elementary's configuration, bounded to current selected
|
||||
profile.
|
||||
|
||||
Useful when you want to force reloading of configuration values for
|
||||
a profile. If one removes user custom configuration directories,
|
||||
for example, it will force a reload with system values instead.
|
||||
|
||||
:return: ``True``, when successful. ``False``, otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
elm_config_reload()
|
||||
|
||||
def all_flush(self):
|
||||
"""all_flush()
|
||||
|
||||
Flush all config settings then apply those settings to all
|
||||
applications using elementary on the current display."""
|
||||
elm_config_all_flush()
|
||||
|
||||
property profile:
|
||||
"""Elementary's profile in use.
|
||||
|
||||
The global profile that is applied to all Elementary applications.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_config_profile_get())
|
||||
def __set__(self, profile):
|
||||
elm_config_profile_set(_cfruni(profile))
|
||||
|
||||
def profile_dir_get(self, profile, is_user):
|
||||
"""profile_dir_get(unicode profile, bool is_user)
|
||||
|
||||
Get an Elementary's profile directory path in the filesystem. One
|
||||
may want to fetch a system profile's dir or a user one (fetched
|
||||
inside $HOME).
|
||||
|
||||
:param profile: The profile's name
|
||||
:type profile: unicode
|
||||
:param is_user: Whether to lookup for a user profile (``True``)
|
||||
or a system one (``False``)
|
||||
:type is_user: bool
|
||||
:return: The profile's directory path.
|
||||
:rtype: string
|
||||
|
||||
"""
|
||||
return _ctouni(elm_config_profile_dir_get(_cfruni(profile), is_user))
|
||||
|
||||
property profile_list:
|
||||
"""Get Elementary's list of available profiles.
|
||||
|
||||
:type: tuple of strings
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Eina_List *lst = elm_config_profile_list_get()
|
||||
return tuple(_strings_to_python(lst))
|
||||
|
||||
property scroll_bounce_enabled:
|
||||
"""Whether scrollers should bounce when they reach their
|
||||
viewport's edge during a scroll.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_config_scroll_bounce_enabled_get())
|
||||
def __set__(self, enabled):
|
||||
elm_config_scroll_bounce_enabled_set(enabled)
|
||||
|
||||
property scroll_bounce_friction:
|
||||
"""The amount of inertia a scroller will impose at bounce animations.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_bounce_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_bounce_friction_set(friction)
|
||||
|
||||
property scroll_page_scroll_friction:
|
||||
"""The amount of inertia a **paged** scroller will impose at page
|
||||
fitting animations.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_page_scroll_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_page_scroll_friction_set(friction)
|
||||
|
||||
property scroll_bring_in_scroll_friction:
|
||||
"""The amount of inertia a scroller will impose at region bring
|
||||
animations.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_bring_in_scroll_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_bring_in_scroll_friction_set(friction)
|
||||
|
||||
property scroll_zoom_friction:
|
||||
"""The amount of inertia scrollers will impose at animations
|
||||
triggered by Elementary widgets' zooming API.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_zoom_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_zoom_friction_set(friction)
|
||||
|
||||
property scroll_thumbscroll_enabled:
|
||||
"""Whether scrollers should be draggable from any point in their views.
|
||||
|
||||
.. note:: This is the default behavior for touch screens, in general.
|
||||
.. note:: All other functions namespaced with "thumbscroll" will only
|
||||
have effect if this mode is enabled.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_config_scroll_thumbscroll_enabled_get())
|
||||
def __set__(self, enabled):
|
||||
elm_config_scroll_thumbscroll_enabled_set(enabled)
|
||||
|
||||
property scroll_thumbscroll_threshold:
|
||||
"""The number of pixels one should travel while dragging a
|
||||
scroller's view to actually trigger scrolling.
|
||||
|
||||
One would use higher values for touch screens, in general, because
|
||||
of their inherent imprecision.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_threshold_get()
|
||||
def __set__(self, threshold):
|
||||
elm_config_scroll_thumbscroll_threshold_set(threshold)
|
||||
|
||||
property scroll_thumbscroll_momentum_threshold:
|
||||
"""The minimum speed of mouse cursor movement which will trigger list
|
||||
self scrolling animation after a mouse up event (pixels/second).
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_momentum_threshold_get()
|
||||
def __set__(self, threshold):
|
||||
elm_config_scroll_thumbscroll_momentum_threshold_set(threshold)
|
||||
|
||||
property scroll_thumbscroll_friction:
|
||||
"""The amount of inertia a scroller will impose at self scrolling
|
||||
animations.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_thumbscroll_friction_set(friction)
|
||||
|
||||
property scroll_thumbscroll_border_friction:
|
||||
"""The amount of lag between your actual mouse cursor dragging
|
||||
movement and a scroller's view movement itself, while pushing it
|
||||
into bounce state manually.
|
||||
|
||||
.. note:: parameter value will get bound to 0.0 - 1.0 interval, always
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_border_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_thumbscroll_border_friction_set(friction)
|
||||
|
||||
property scroll_thumbscroll_sensitivity_friction:
|
||||
"""The sensitivity amount which is be multiplied by the length of
|
||||
mouse dragging.
|
||||
|
||||
``0.1`` for minimum sensitivity, ``1.0`` for maximum sensitivity.
|
||||
``0.25`` is proper.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_sensitivity_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_thumbscroll_sensitivity_friction_set(friction)
|
||||
|
||||
property longpress_timeout:
|
||||
"""The duration for occurring long press event.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_longpress_timeout_get()
|
||||
def __set__(self, longpress_timeout):
|
||||
elm_config_longpress_timeout_set(longpress_timeout)
|
||||
|
||||
property tooltip_delay:
|
||||
"""The duration after which tooltip will be shown.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_tooltip_delay_get()
|
||||
def __set__(self, delay):
|
||||
elm_config_tooltip_delay_set(delay)
|
||||
|
||||
property cursor_engine_only:
|
||||
"""The globally configured exclusive usage of engine cursors.
|
||||
|
||||
If True only engine cursors will be enabled, if False will look for
|
||||
them on theme before.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_cursor_engine_only_get()
|
||||
def __set__(self, engine_only):
|
||||
elm_config_cursor_engine_only_set(engine_only)
|
||||
|
||||
property scale:
|
||||
"""The global scaling factor
|
||||
|
||||
This gets the globally configured scaling factor that is applied to
|
||||
all objects.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_scale_get()
|
||||
def __set__(self, scale):
|
||||
elm_config_scale_set(scale)
|
||||
|
||||
property password_show_last:
|
||||
"""The "show last" setting of password mode.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_password_show_last_get()
|
||||
def __set__(self, password_show_last):
|
||||
elm_config_password_show_last_set(password_show_last)
|
||||
|
||||
property password_show_last_timeout:
|
||||
"""The timeout value for which the last input entered in password
|
||||
mode will be visible.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_password_show_last_timeout_get()
|
||||
def __set__(self, password_show_last_timeout):
|
||||
elm_config_password_show_last_timeout_set(password_show_last_timeout)
|
||||
|
||||
property engine:
|
||||
"""Elementary's rendering engine in use.
|
||||
|
||||
This gets the global rendering engine that is applied to all
|
||||
Elementary applications.
|
||||
|
||||
Note that it will take effect only to Elementary windows created
|
||||
after this is set.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_config_engine_get())
|
||||
def __set__(self, engine):
|
||||
elm_config_engine_set(_cfruni(engine))
|
||||
|
||||
property preferred_engine:
|
||||
"""Get Elementary's preferred engine to use.
|
||||
|
||||
This gets the global rendering engine that is applied to all
|
||||
Elementary applications and is PREFERRED by the application.
|
||||
|
||||
Note that it will take effect only to Elementary windows created
|
||||
after this is called. This overrides the engine set by configuration
|
||||
at application startup. Note that it is a hint and may not be honored.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_config_preferred_engine_get())
|
||||
def __set__(self, engine):
|
||||
elm_config_preferred_engine_set(_cfruni(engine))
|
||||
|
||||
property text_classes_list:
|
||||
"""Get Elementary's list of supported text classes.
|
||||
|
||||
:type: Elm_Text_Class
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Eina_List *lst
|
||||
cdef Elm_Text_Class *data
|
||||
cdef const_char *name, *desc
|
||||
ret = []
|
||||
lst = elm_config_text_classes_list_get()
|
||||
while lst:
|
||||
data = <Elm_Text_Class *>lst.data
|
||||
if data != NULL:
|
||||
name = data.name
|
||||
desc = data.desc
|
||||
ret.append((_ctouni(name), _ctouni(desc)))
|
||||
lst = lst.next
|
||||
return ret
|
||||
|
||||
property font_overlay_list:
|
||||
"""Get Elementary's list of font overlays, set with
|
||||
:py:func:`font_overlay_set()`.
|
||||
|
||||
For each text class, one can set a **font overlay** for it, overriding
|
||||
the default font properties for that class coming from the theme in
|
||||
use. There is no need to free this list.
|
||||
|
||||
:type: Elm_Font_Overlay
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef const_Eina_List *lst
|
||||
cdef Elm_Font_Overlay *data
|
||||
cdef const_char *text_class, *font
|
||||
cdef Evas_Font_Size size
|
||||
ret = []
|
||||
lst = elm_config_font_overlay_list_get()
|
||||
while lst:
|
||||
data = <Elm_Font_Overlay *>lst.data
|
||||
if data != NULL:
|
||||
text_class = data.text_class
|
||||
font = data.font
|
||||
size = data.size
|
||||
ret.append((_ctouni(text_class), _ctouni(font), size))
|
||||
lst = lst.next
|
||||
return ret
|
||||
|
||||
def font_overlay_set(self, text_class, font, size):
|
||||
"""font_overlay_set(unicode text_class, unicode font, int size)
|
||||
|
||||
Set a font overlay for a given Elementary text class.
|
||||
|
||||
*font* has to be in the format returned by font_fontconfig_name_get().
|
||||
|
||||
.. seealso::
|
||||
|
||||
:py:attr:`font_overlay_list`
|
||||
:py:func:`font_overlay_unset()`
|
||||
:py:func:`edje_object_text_class_set()`
|
||||
|
||||
:param text_class: Text class name
|
||||
:type text_class: string
|
||||
:param font: Font name and style string
|
||||
:type font: string
|
||||
:param size: Font size
|
||||
:type size: Evas_Font_Size
|
||||
|
||||
"""
|
||||
elm_config_font_overlay_set(_cfruni(text_class), _cfruni(font), size)
|
||||
|
||||
def font_overlay_unset(self, text_class):
|
||||
"""font_overlay_unset(unicode text_class)
|
||||
|
||||
Unset a font overlay for a given Elementary text class.
|
||||
|
||||
This will bring back text elements belonging to text class
|
||||
``text_class`` back to their default font settings.
|
||||
|
||||
:param text_class: Text class name
|
||||
:type text_class: string
|
||||
|
||||
"""
|
||||
elm_config_font_overlay_unset(_cfruni(text_class))
|
||||
|
||||
def font_overlay_apply(self):
|
||||
"""font_overlay_apply()
|
||||
|
||||
Apply the changes made with :py:func:`font_overlay_set()` and
|
||||
:py:func:`font_overlay_unset()` on the current Elementary window.
|
||||
|
||||
This applies all font overlays set to all objects in the UI.
|
||||
|
||||
"""
|
||||
elm_config_font_overlay_apply()
|
||||
|
||||
property finger_size:
|
||||
"""The configured "finger size"
|
||||
|
||||
This gets the globally configured finger size, **in pixels**
|
||||
|
||||
:type: Evas_Coord (int)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_finger_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_finger_size_set(size)
|
||||
|
||||
property cache_flush_interval:
|
||||
"""The globally configured cache flush interval time, in ticks
|
||||
|
||||
.. seealso:: :py:func:`cache_all_flush()`
|
||||
|
||||
.. note:: The ``size`` must be greater than 0. if not, the cache flush
|
||||
will be ignored.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_cache_flush_interval_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_flush_interval_set(size)
|
||||
|
||||
property cache_flush_enabled:
|
||||
"""The configured cache flush enabled state
|
||||
|
||||
This property reflects the globally configured cache flush state -
|
||||
if it is enabled or not. When cache flushing is enabled, elementary
|
||||
will regularly (see :py:attr:`cache_flush_interval`) flush
|
||||
caches and dump data out of memory and allow usage to re-seed caches
|
||||
and data in memory where it can do so. An idle application will thus
|
||||
minimize its memory usage as data will be freed from memory and not
|
||||
be re-loaded as it is idle and not rendering or doing anything
|
||||
graphically right now.
|
||||
|
||||
.. seealso:: :py:func:`cache_all_flush()`
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_config_cache_flush_enabled_get())
|
||||
def __set__(self, enabled):
|
||||
elm_config_cache_flush_enabled_set(enabled)
|
||||
|
||||
property cache_font_cache_size:
|
||||
"""The globally configured font cache size, in bytes.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_cache_font_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_font_cache_size_set(size)
|
||||
|
||||
property cache_image_cache_size:
|
||||
"""The globally configured image cache size, in bytes
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_cache_image_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_image_cache_size_set(size)
|
||||
|
||||
|
||||
property cache_edje_file_cache_size:
|
||||
"""The globally configured edje file cache size, in number of files.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_cache_edje_file_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_edje_file_cache_size_set(size)
|
||||
|
||||
property cache_edje_collection_cache_size:
|
||||
"""The globally configured edje collections cache size, in number of
|
||||
collections.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_config_cache_edje_collection_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_edje_collection_cache_size_set(size)
|
||||
|
||||
property focus_highlight_enabled:
|
||||
"""Whether the highlight on focused objects is enabled or not
|
||||
|
||||
Note that it will take effect only to Elementary windows created after
|
||||
this is set.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_config_focus_highlight_enabled_get())
|
||||
def __set__(self, enable):
|
||||
elm_config_focus_highlight_enabled_set(enable)
|
||||
|
||||
property focus_highlight_animate:
|
||||
"""Whether the focus highlight, if enabled, will animate its switch
|
||||
from one object to the next
|
||||
|
||||
Note that it will take effect only to Elementary windows created after
|
||||
this is set.
|
||||
|
||||
.. seealso:: :py:class:`elementary.window.Window`
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_config_focus_highlight_animate_get())
|
||||
def __set__(self, animate):
|
||||
elm_config_focus_highlight_animate_set(animate)
|
||||
|
||||
property mirrored:
|
||||
"""Get the system mirrored mode. This determines the default
|
||||
mirrored mode of widgets.
|
||||
|
||||
type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_config_mirrored_get())
|
||||
def __set__(self, mirrored):
|
||||
elm_config_mirrored_set(mirrored)
|
||||
|
||||
|
||||
#For compatibility
|
||||
def config_finger_size_get():
|
||||
return elm_config_finger_size_get()
|
||||
def config_finger_size_set(size):
|
||||
elm_config_finger_size_set(size)
|
||||
|
||||
def config_tooltip_delay_get():
|
||||
return elm_config_tooltip_delay_get()
|
||||
def config_tooltip_delay_set(delay):
|
||||
elm_config_tooltip_delay_set(delay)
|
||||
|
||||
def focus_highlight_enabled_get():
|
||||
return elm_config_focus_highlight_enabled_get()
|
||||
def focus_highlight_enabled_set(enabled):
|
||||
elm_config_focus_highlight_enabled_set(enabled)
|
||||
|
||||
def focus_highlight_animate_get():
|
||||
return elm_config_focus_highlight_animate_get()
|
||||
def focus_highlight_animate_set(animate):
|
||||
elm_config_focus_highlight_animate_set(animate)
|
||||
|
||||
def preferred_engine_get():
|
||||
return _ctouni(elm_config_preferred_engine_get())
|
||||
def preferred_engine_set(engine):
|
||||
elm_config_preferred_engine_set(_cfruni(engine))
|
||||
|
||||
def engine_get():
|
||||
return _ctouni(elm_config_engine_get())
|
||||
def engine_set(engine):
|
||||
elm_config_engine_set(_cfruni(engine))
|
||||
|
||||
def scale_get():
|
||||
return elm_config_scale_get()
|
||||
def scale_set(scale):
|
||||
elm_config_scale_set(scale)
|
||||
|
||||
def cursor_engine_only_get():
|
||||
return elm_config_cursor_engine_only_get()
|
||||
def cursor_engine_only_set(engine_only):
|
||||
elm_config_cursor_engine_only_set(engine_only)
|
||||
|
|
@ -0,0 +1,5 @@
|
|||
from efl.evas cimport Evas_Object
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_conformant_add(Evas_Object *parent)
|
||||
|
|
@ -15,9 +15,33 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cdef class Conformant(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
The aim is to provide a widget that can be used in elementary apps to
|
||||
account for space taken up by the indicator, virtual keypad & softkey
|
||||
windows when running the illume2 module of E17.
|
||||
|
||||
So conformant content will be sized and positioned considering the
|
||||
space required for such stuff, and when they popup, as a keyboard
|
||||
shows when an entry is selected, conformant content won't change.
|
||||
|
||||
This widget emits the signals sent from
|
||||
:py:class:`elementary.layout.Layout`.
|
||||
|
||||
Available styles for it:
|
||||
- ``"default"``
|
||||
|
||||
Default content parts of the conformant widget that you can use for are:
|
||||
- "default" - A content of the conformant
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_conformant_add(parent.obj))
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
# Copyright 2012 Kai Huuhko <kai.huuhko@gmail.com>
|
||||
#
|
||||
# This file is part of python-elementary.
|
||||
#
|
||||
# python-elementary is free software: you can redistribute it and/or modify
|
||||
# it under the terms of the GNU Lesser General Public License as published by
|
||||
# the Free Software Foundation, either version 3 of the License, or
|
||||
# (at your option) any later version.
|
||||
#
|
||||
# python-elementary 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 Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with python-elementary. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from efl.evas cimport Eina_List, const_Eina_List, eina_list_append, Evas_Object
|
||||
from efl.eo cimport object_from_instance
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef _strings_to_python(const_Eina_List *lst):
|
||||
cdef const_char *s
|
||||
ret = []
|
||||
while lst:
|
||||
s = <const_char *>lst.data
|
||||
if s != NULL:
|
||||
ret.append(_ctouni(s))
|
||||
lst = lst.next
|
||||
return ret
|
||||
|
||||
cdef Eina_List * _strings_from_python(strings):
|
||||
cdef Eina_List *lst = NULL
|
||||
for s in strings:
|
||||
lst = eina_list_append(lst, _cfruni(s))
|
||||
return lst
|
||||
|
||||
cdef _object_list_to_python(const_Eina_List *lst):
|
||||
cdef Evas_Object *o
|
||||
ret = []
|
||||
while lst:
|
||||
o = <Evas_Object *>lst.data
|
||||
obj = object_from_instance(o)
|
||||
ret.append(obj)
|
||||
lst = lst.next
|
||||
return ret
|
|
@ -0,0 +1,18 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Smart_Cb
|
||||
from object_item cimport Elm_Object_Item
|
||||
from enums cimport Elm_Ctxpopup_Direction
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_ctxpopup_add(Evas_Object *parent)
|
||||
void elm_ctxpopup_hover_parent_set(Evas_Object *obj, Evas_Object *parent)
|
||||
Evas_Object *elm_ctxpopup_hover_parent_get(Evas_Object *obj)
|
||||
void elm_ctxpopup_clear(Evas_Object *obj)
|
||||
void elm_ctxpopup_horizontal_set(Evas_Object *obj, Eina_Bool horizontal)
|
||||
Eina_Bool elm_ctxpopup_horizontal_get(Evas_Object *obj)
|
||||
Elm_Object_Item *elm_ctxpopup_item_append(Evas_Object *obj, const_char *label, Evas_Object *icon, Evas_Smart_Cb func, void *data)
|
||||
void elm_ctxpopup_direction_priority_set(Evas_Object *obj, Elm_Ctxpopup_Direction first, Elm_Ctxpopup_Direction second, Elm_Ctxpopup_Direction third, Elm_Ctxpopup_Direction fourth)
|
||||
void elm_ctxpopup_direction_priority_get(Evas_Object *obj, Elm_Ctxpopup_Direction *first, Elm_Ctxpopup_Direction *second, Elm_Ctxpopup_Direction *third, Elm_Ctxpopup_Direction *fourth)
|
||||
Elm_Ctxpopup_Direction elm_ctxpopup_direction_get(Evas_Object *obj)
|
||||
void elm_ctxpopup_dismiss(Evas_Object *obj)
|
||||
|
|
@ -14,7 +14,45 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Ctxpopup arrow directions
|
||||
|
||||
.. data:: ELM_CTXPOPUP_DIRECTION_DOWN
|
||||
|
||||
Arrow is pointing down
|
||||
|
||||
.. data:: ELM_CTXPOPUP_DIRECTION_RIGHT
|
||||
|
||||
Arrow is pointing right
|
||||
|
||||
.. data:: ELM_CTXPOPUP_DIRECTION_LEFT
|
||||
|
||||
Arrow is pointing left
|
||||
|
||||
.. data:: ELM_CTXPOPUP_DIRECTION_UP
|
||||
|
||||
Arrow is pointing up
|
||||
|
||||
.. data:: ELM_CTXPOPUP_DIRECTION_UNKNOWN
|
||||
|
||||
Arrow direction is unknown
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
from object cimport Object
|
||||
from object_item cimport ObjectItem, _object_item_callback
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_CTXPOPUP_DIRECTION_DOWN = enums.ELM_CTXPOPUP_DIRECTION_DOWN
|
||||
ELM_CTXPOPUP_DIRECTION_RIGHT = enums.ELM_CTXPOPUP_DIRECTION_RIGHT
|
||||
ELM_CTXPOPUP_DIRECTION_LEFT = enums.ELM_CTXPOPUP_DIRECTION_LEFT
|
||||
ELM_CTXPOPUP_DIRECTION_UP = enums.ELM_CTXPOPUP_DIRECTION_UP
|
||||
ELM_CTXPOPUP_DIRECTION_UNKNOWN = enums.ELM_CTXPOPUP_DIRECTION_UNKNOWN
|
||||
|
||||
cdef class CtxpopupItem(ObjectItem):
|
||||
def __init__(self, evasObject ctxpopup, label = None, evasObject icon = None, callback = None, *args, **kargs):
|
||||
|
@ -38,53 +76,114 @@ cdef class CtxpopupItem(ObjectItem):
|
|||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
cdef class Ctxpopup(Object):
|
||||
|
||||
"""
|
||||
|
||||
Context popup widget.
|
||||
|
||||
A ctxpopup is a widget that, when shown, pops up a list of items. It
|
||||
automatically chooses an area inside its parent object's view to
|
||||
optimally fit into it. In the default theme, it will also point an arrow
|
||||
to it's top left position at the time one shows it. Ctxpopup items have
|
||||
a label and/or an icon. It is intended for a small number of items
|
||||
(hence the use of list, not genlist).
|
||||
|
||||
Signals that you can add callbacks for are:
|
||||
|
||||
- "dismissed" - the ctxpopup was dismissed
|
||||
|
||||
Default content parts of the ctxpopup widget that you can use for are:
|
||||
|
||||
- "default" - A content of the ctxpopup
|
||||
|
||||
Default content parts of the ctxpopup items that you can use for are:
|
||||
|
||||
- "icon" - An icon in the title area
|
||||
|
||||
Default text parts of the ctxpopup items that you can use for are:
|
||||
|
||||
- "default" - Title label in the title area
|
||||
|
||||
.. note:: Ctxpopup is a specialization of :py:class:`elementary.hover.Hover`.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
Object.__init__(self, parent.evas)
|
||||
self._set_obj(elm_ctxpopup_add(parent.obj))
|
||||
|
||||
def hover_parent_set(self, evasObject parent):
|
||||
elm_ctxpopup_hover_parent_set(self.obj, parent.obj)
|
||||
property hover_parent:
|
||||
"""Ctxpopup hover's parent
|
||||
|
||||
def hover_parent_get(self):
|
||||
return object_from_instance(elm_ctxpopup_hover_parent_get(self.obj))
|
||||
:type: :py:class:`evas.object.Object`
|
||||
|
||||
property parent:
|
||||
"""
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_ctxpopup_hover_parent_get(self.obj))
|
||||
|
||||
def __set__(self, evasObject parent):
|
||||
elm_ctxpopup_hover_parent_set(self.obj, parent.obj)
|
||||
|
||||
def hover_parent_set(self, evasObject parent):
|
||||
elm_ctxpopup_hover_parent_set(self.obj, parent.obj)
|
||||
def hover_parent_get(self):
|
||||
return object_from_instance(elm_ctxpopup_hover_parent_get(self.obj))
|
||||
|
||||
def clear(self):
|
||||
"""Clear all items in the given ctxpopup object."""
|
||||
elm_ctxpopup_clear(self.obj)
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_ctxpopup_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_get(self):
|
||||
return bool(elm_ctxpopup_horizontal_get(self.obj))
|
||||
|
||||
property horizontal:
|
||||
"""Ctxpopup objects orientation.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_ctxpopup_horizontal_get(self.obj))
|
||||
|
||||
def __set__(self, horizontal):
|
||||
elm_ctxpopup_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_ctxpopup_horizontal_set(self.obj, horizontal)
|
||||
def horizontal_get(self):
|
||||
return bool(elm_ctxpopup_horizontal_get(self.obj))
|
||||
|
||||
def item_append(self, label, evasObject icon = None, func = None, *args, **kwargs):
|
||||
"""item_append(unicode label, evas.Object icon, func, *args, **kwargs) -> CtxpopupItem
|
||||
|
||||
Add a new item to a ctxpopup object.
|
||||
|
||||
.. warning:: Ctxpopup can't hold both an item list and a content at the
|
||||
same time. When an item is added, any previous content will be
|
||||
removed.
|
||||
|
||||
.. seealso:: :py:attr:`elementary.object.Object.content`
|
||||
|
||||
:param icon: Icon to be set on new item
|
||||
:type icon: :py:class:`evas.object.Object`
|
||||
:param label: The Label of the new item
|
||||
:type label: string
|
||||
:param func: Convenience function called when item selected
|
||||
:type func: function
|
||||
:return: The item added or ``None``, on errors
|
||||
:rtype: :py:class:`CtxpopupItem`
|
||||
|
||||
"""
|
||||
return CtxpopupItem(self, label, icon, func, *args, **kwargs)
|
||||
|
||||
def direction_priority_set(self, first, second, third, fourth):
|
||||
elm_ctxpopup_direction_priority_set(self.obj, first, second, third, fourth)
|
||||
|
||||
def direction_priority_get(self):
|
||||
cdef Elm_Ctxpopup_Direction first, second, third, fourth
|
||||
elm_ctxpopup_direction_priority_get(self.obj, &first, &second, &third, &fourth)
|
||||
return (first, second, third, fourth)
|
||||
|
||||
property direction_priority:
|
||||
"""The direction priority order of a ctxpopup.
|
||||
|
||||
This functions gives a chance to user to set the priority of ctxpopup
|
||||
showing direction. This doesn't guarantee the ctxpopup will appear
|
||||
in the requested direction.
|
||||
|
||||
:type: tuple of Elm_Ctxpopup_Direction
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Ctxpopup_Direction first, second, third, fourth
|
||||
elm_ctxpopup_direction_priority_get(self.obj, &first, &second, &third, &fourth)
|
||||
|
@ -95,17 +194,42 @@ cdef class Ctxpopup(Object):
|
|||
first, second, third, fourth = priority
|
||||
elm_ctxpopup_direction_priority_set(self.obj, first, second, third, fourth)
|
||||
|
||||
def direction_get(self):
|
||||
return elm_ctxpopup_direction_get(self.obj)
|
||||
def direction_priority_set(self, first, second, third, fourth):
|
||||
elm_ctxpopup_direction_priority_set(self.obj, first, second, third, fourth)
|
||||
def direction_priority_get(self):
|
||||
cdef Elm_Ctxpopup_Direction first, second, third, fourth
|
||||
elm_ctxpopup_direction_priority_get(self.obj, &first, &second, &third, &fourth)
|
||||
return (first, second, third, fourth)
|
||||
|
||||
property direction:
|
||||
"""Get the current direction of a ctxpopup.
|
||||
|
||||
.. warning:: Only once the ctxpopup is shown can the direction be
|
||||
determined
|
||||
|
||||
:type: Elm_Ctxpopup_Direction
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_ctxpopup_direction_get(self.obj)
|
||||
|
||||
def direction_get(self):
|
||||
return elm_ctxpopup_direction_get(self.obj)
|
||||
|
||||
def dismiss(self):
|
||||
"""dismiss()
|
||||
|
||||
Dismiss a ctxpopup object
|
||||
|
||||
Use this function to simulate clicking outside the ctxpopup to
|
||||
dismiss it. In this way, the ctxpopup will be hidden and the
|
||||
"clicked" signal will be emitted.
|
||||
|
||||
"""
|
||||
elm_ctxpopup_dismiss(self.obj)
|
||||
|
||||
def callback_dismissed_add(self, func, *args, **kwargs):
|
||||
"""the ctxpopup was dismissed"""
|
||||
self._callback_add("dismissed", func, *args, **kwargs)
|
||||
|
||||
def callback_dismissed_del(self, func):
|
|
@ -0,0 +1,19 @@
|
|||
from efl.evas cimport Evas_Object, Eina_Bool
|
||||
from general cimport tm
|
||||
from enums cimport Elm_Datetime_Field_Type
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object * elm_datetime_add(Evas_Object *parent)
|
||||
const_char * elm_datetime_format_get(Evas_Object *obj)
|
||||
void elm_datetime_format_set(Evas_Object *obj, const_char *fmt)
|
||||
Eina_Bool elm_datetime_value_max_get(Evas_Object *obj, tm *maxtime)
|
||||
Eina_Bool elm_datetime_value_max_set(Evas_Object *obj, tm *maxtime)
|
||||
Eina_Bool elm_datetime_value_min_get(Evas_Object *obj, tm *mintime)
|
||||
Eina_Bool elm_datetime_value_min_set(Evas_Object *obj, tm *mintime)
|
||||
void elm_datetime_field_limit_get(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int *min, int *max)
|
||||
void elm_datetime_field_limit_set(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, int min, int max)
|
||||
Eina_Bool elm_datetime_value_get(Evas_Object *obj, tm *currtime)
|
||||
Eina_Bool elm_datetime_value_set(Evas_Object *obj, tm *newtime)
|
||||
Eina_Bool elm_datetime_field_visible_get(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype)
|
||||
void elm_datetime_field_visible_set(Evas_Object *obj, Elm_Datetime_Field_Type fieldtype, Eina_Bool visible)
|
|
@ -0,0 +1,528 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Datetime fields
|
||||
|
||||
.. data:: ELM_DATETIME_YEAR
|
||||
|
||||
Year
|
||||
|
||||
.. data:: ELM_DATETIME_MONTH
|
||||
|
||||
Month
|
||||
|
||||
.. data:: ELM_DATETIME_DATE
|
||||
|
||||
Date
|
||||
|
||||
.. data:: ELM_DATETIME_HOUR
|
||||
|
||||
Hour
|
||||
|
||||
.. data:: ELM_DATETIME_MINUTE
|
||||
|
||||
Minute
|
||||
|
||||
.. data:: ELM_DATETIME_AMPM
|
||||
|
||||
Am/Pm
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from object cimport Object
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_DATETIME_YEAR = enums.ELM_DATETIME_YEAR
|
||||
ELM_DATETIME_MONTH = enums.ELM_DATETIME_MONTH
|
||||
ELM_DATETIME_DATE = enums.ELM_DATETIME_DATE
|
||||
ELM_DATETIME_HOUR = enums.ELM_DATETIME_HOUR
|
||||
ELM_DATETIME_MINUTE = enums.ELM_DATETIME_MINUTE
|
||||
ELM_DATETIME_AMPM = enums.ELM_DATETIME_AMPM
|
||||
|
||||
cdef class Datetime(Object):
|
||||
|
||||
"""
|
||||
|
||||
Datetime widget is used to display and input date & time values.
|
||||
|
||||
This widget displays date and time as per the **system's locale** settings
|
||||
(Date includes Day, Month & Year along with the defined separators and Time
|
||||
includes Hour, Minute & AM/PM fields). Separator for AM/PM field is ignored.
|
||||
|
||||
The corresponding Month, AM/PM strings are displayed according to the
|
||||
system’s language settings.
|
||||
|
||||
Datetime format is a combination of LIBC standard characters like "%%d %%b
|
||||
%%Y %%I : %%M %%p" which, as a whole represents both Date as well as Time
|
||||
format.
|
||||
|
||||
Elm_datetime supports only the following sub set of libc date format specifiers:
|
||||
|
||||
**%%Y** : The year as a decimal number including the century (example: 2011).
|
||||
|
||||
**%%y** : The year as a decimal number without a century (range 00 to 99)
|
||||
|
||||
**%%m** : The month as a decimal number (range 01 to 12).
|
||||
|
||||
**%%b** : The abbreviated month name according to the current locale.
|
||||
|
||||
**%%B** : The full month name according to the current locale.
|
||||
|
||||
**%%h** : The abbreviated month name according to the current locale(same as %%b).
|
||||
|
||||
**%%d** : The day of the month as a decimal number (range 01 to 31).
|
||||
|
||||
**%%e** : The day of the month as a decimal number (range 1 to 31). single
|
||||
digits are preceded by a blank.
|
||||
|
||||
**%%I** : The hour as a decimal number using a 12-hour clock (range 01 to 12).
|
||||
|
||||
**%%H** : The hour as a decimal number using a 24-hour clock (range 00 to 23).
|
||||
|
||||
**%%k** : The hour (24-hour clock) as a decimal number (range 0 to 23). single
|
||||
digits are preceded by a blank.
|
||||
|
||||
**%%l** : The hour (12-hour clock) as a decimal number (range 1 to 12); single
|
||||
digits are preceded by a blank.
|
||||
|
||||
**%%M** : The minute as a decimal number (range 00 to 59).
|
||||
|
||||
**%%p** : Either 'AM' or 'PM' according to the given time value, or the
|
||||
corresponding strings for the current locale. Noon is treated as 'PM'
|
||||
and midnight as 'AM'
|
||||
|
||||
**%%P** : Like %p but in lower case: 'am' or 'pm' or a corresponding string for
|
||||
the current locale.
|
||||
|
||||
**%%c** : The preferred date and time representation for the current locale.
|
||||
|
||||
**%%x** : The preferred date representation for the current locale without the time.
|
||||
|
||||
**%%X** : The preferred time representation for the current locale without the date.
|
||||
|
||||
**%%r** : The complete calendar time using the AM/PM format of the current locale.
|
||||
|
||||
**%%R** : The hour and minute in decimal numbers using the format %H:%M.
|
||||
|
||||
**%%T** : The time of day in decimal numbers using the format %H:%M:%S.
|
||||
|
||||
**%%D** : The date using the format %%m/%%d/%%y.
|
||||
|
||||
**%%F** : The date using the format %%Y-%%m-%%d.
|
||||
|
||||
(For more reference on the available **LIBC date format specifiers**,
|
||||
please visit the link:
|
||||
http://www.gnu.org/s/hello/manual/libc.html#Formatting-Calendar-Time )
|
||||
|
||||
Datetime widget can provide Unicode **separators** in between its fields
|
||||
except for AM/PM field. A separator can be any **Unicode character**
|
||||
other than the LIBC standard date format specifiers.
|
||||
|
||||
Example: In the format::
|
||||
|
||||
%%b %%d **,** %%y %%H **:** %%M
|
||||
|
||||
comma(,) is separator for date field %%d and colon(:) is separator for
|
||||
hour field %%H.
|
||||
|
||||
The default format is a predefined one, based on the system Locale.
|
||||
|
||||
Hour format 12hr(1-12) or 24hr(0-23) display can be selected by setting
|
||||
the corresponding user format.
|
||||
|
||||
Datetime supports six fields: Year, Month, Date, Hour, Minute, AM/PM.
|
||||
Depending on the Datetime module that is loaded, the user can see
|
||||
different UI to select the individual field values.
|
||||
|
||||
The individual fields of Datetime can be arranged in any order according
|
||||
to the format set by application.
|
||||
|
||||
There is a provision to set the visibility of a particular field as TRUE/
|
||||
FALSE so that **only time/ only date / only required fields** will be
|
||||
displayed.
|
||||
|
||||
Each field is having a default minimum and maximum values just like the
|
||||
daily calendar information. These min/max values can be modified as per
|
||||
the application usage.
|
||||
|
||||
User can enter the values only in between the range of maximum and
|
||||
minimum. Apart from these APIs, there is a provision to display only a
|
||||
limited set of values out of the possible values. APIs to select the
|
||||
individual field limits are intended for this purpose.
|
||||
|
||||
The whole widget is left aligned and its size grows horizontally
|
||||
depending on the current format and each field's visible/disabled state.
|
||||
|
||||
Datetime individual field selection is implemented in a modular style.
|
||||
Module can be implemented as a Ctxpopup based selection or an ISE based
|
||||
selection or even a spinner like selection etc.
|
||||
|
||||
**Datetime Module design:**
|
||||
|
||||
The following functions are expected to be implemented in a Datetime module:
|
||||
|
||||
**Field creation**::
|
||||
|
||||
__________ __________
|
||||
| |----- obj_hook() ---------------------->>>| |
|
||||
| |<<<----------------returns Mod_data ------| |
|
||||
| Datetime |_______ | |
|
||||
| widget | |Assign module call backs | Module |
|
||||
| base |<<<____| | |
|
||||
| | | |
|
||||
| |----- field_create() ------------------>>>| |
|
||||
|__________|<<<----------------returns field_obj -----|__________|
|
||||
|
||||
**Field value setting**::
|
||||
|
||||
__________ __________
|
||||
| | | |
|
||||
| Datetime |<<<----------elm_datetime_value_set()---| |
|
||||
| widget | | Module |
|
||||
| base |----display_field_value()------------>>>| |
|
||||
|__________| |__________|
|
||||
|
||||
**del_hook**::
|
||||
|
||||
__________ __________
|
||||
| | | |
|
||||
| Datetime |----obj_unhook()-------------------->>>>| |
|
||||
| widget | | Module |
|
||||
| base | <<<-----frees mod_data---------| |
|
||||
|__________| |__________|
|
||||
|
||||
Any module can use the following shared functions that are implemented in
|
||||
elm_datetime.c :
|
||||
|
||||
**field_format_get()** - gives the field format.
|
||||
|
||||
**field_limit_get()** - gives the field minimum, maximum limits.
|
||||
|
||||
To enable a module, set the ELM_MODULES environment variable as shown:
|
||||
|
||||
**export ELM_MODULES="datetime_input_ctxpopup>datetime/api"**
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- **"changed"** - whenever Datetime field value is changed, this
|
||||
signal is sent.
|
||||
- **"language,changed"** - whenever system locale changes, this
|
||||
signal is sent.
|
||||
|
||||
"""
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_datetime_add(parent.obj))
|
||||
|
||||
property format:
|
||||
"""The datetime format. Format is a combination of allowed Libc date format
|
||||
specifiers like: "%b %d, %Y %I : %M %p".
|
||||
|
||||
Maximum allowed format length is 64 chars.
|
||||
|
||||
Format can include separators for each individual datetime field except
|
||||
for AM/PM field.
|
||||
|
||||
Each separator can be a maximum of 6 UTF-8 bytes.
|
||||
Space is also taken as a separator.
|
||||
|
||||
Following are the allowed set of format specifiers for each datetime field.
|
||||
|
||||
**%%Y** : The year as a decimal number including the century.
|
||||
|
||||
**%%y** : The year as a decimal number without a century (range 00 to 99).
|
||||
|
||||
**%%m** : The month as a decimal number (range 01 to 12).
|
||||
|
||||
**%%b** : The abbreviated month name according to the current locale.
|
||||
|
||||
**%%B** : The full month name according to the current locale.
|
||||
|
||||
**%%h** : The abbreviated month name according to the current locale(same as %%b).
|
||||
|
||||
**%%d** : The day of the month as a decimal number (range 01 to 31).
|
||||
|
||||
**%%e** : The day of the month as a decimal number (range 1 to 31). single
|
||||
digits are preceded by a blank.
|
||||
|
||||
**%%I** : The hour as a decimal number using a 12-hour clock (range 01 to 12).
|
||||
|
||||
**%%H** : The hour as a decimal number using a 24-hour clock (range 00 to 23).
|
||||
|
||||
**%%k** : The hour (24-hour clock) as a decimal number (range 0 to 23). single
|
||||
digits are preceded by a blank.
|
||||
|
||||
**%%l** : The hour (12-hour clock) as a decimal number (range 1 to 12); single
|
||||
digits are preceded by a blank.
|
||||
|
||||
**%%M** : The minute as a decimal number (range 00 to 59).
|
||||
|
||||
**%%p** : Either 'AM' or 'PM' according to the given time value, or the
|
||||
corresponding strings for the current locale. Noon is treated as 'PM'
|
||||
and midnight as 'AM'.
|
||||
|
||||
**%%P** : Like %p but in lower case: 'am' or 'pm' or a corresponding string for
|
||||
the current locale.
|
||||
|
||||
**%%c** : The preferred date and time representation for the current locale.
|
||||
|
||||
**%%x** : The preferred date representation for the current locale without the time.
|
||||
|
||||
**%%X** : The preferred time representation for the current locale without the date.
|
||||
|
||||
**%%r** : The complete calendar time using the AM/PM format of the current locale.
|
||||
|
||||
**%%R** : The hour and minute in decimal numbers using the format %H:%M.
|
||||
|
||||
**%%T** : The time of day in decimal numbers using the format %H:%M:%S.
|
||||
|
||||
**%%D** : The date using the format %%m/%%d/%%y.
|
||||
|
||||
**%%F** : The date using the format %%Y-%%m-%%d.
|
||||
|
||||
These specifiers can be arranged in any order and the widget will display the
|
||||
fields accordingly.
|
||||
|
||||
Default format is taken as per the system locale settings.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_datetime_format_get(self.obj))
|
||||
def __set__(self, fmt):
|
||||
elm_datetime_format_set(self.obj, _cfruni(fmt))
|
||||
|
||||
property value_max:
|
||||
"""The upper boundary of a field.
|
||||
|
||||
Year: years since 1900. Negative value represents year below 1900 (year
|
||||
value -30 represents 1870). Year default range is from 70 to 137.
|
||||
|
||||
Month: default value range is from 0 to 11.
|
||||
|
||||
Date: default value range is from 1 to 31 according to the month value.
|
||||
|
||||
Hour: default value will be in terms of 24 hr format (0~23)
|
||||
|
||||
Minute: default value range is from 0 to 59.
|
||||
|
||||
:type: datetime.datetime
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_datetime_value_max_get(self.obj, &time)
|
||||
ret = datetime( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday,
|
||||
time.tm_hour,
|
||||
time.tm_min,
|
||||
time.tm_sec)
|
||||
return ret
|
||||
|
||||
def __set__(self, newtime):
|
||||
cdef tm time
|
||||
tmtup = newtime.timetuple()
|
||||
time.tm_sec = tmtup.tm_sec
|
||||
time.tm_min = tmtup.tm_min
|
||||
time.tm_hour = tmtup.tm_hour
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_datetime_value_max_set(self.obj, &time)
|
||||
|
||||
property value_min:
|
||||
"""The lower boundary of a field.
|
||||
|
||||
Year: years since 1900. Negative value represents year below 1900 (year
|
||||
value -30 represents 1870). Year default range is from 70 to 137.
|
||||
|
||||
Month: default value range is from 0 to 11.
|
||||
|
||||
Date: default value range is from 1 to 31 according to the month value.
|
||||
|
||||
Hour: default value will be in terms of 24 hr format (0~23)
|
||||
|
||||
Minute: default value range is from 0 to 59.
|
||||
|
||||
:type: datetime.datetime
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_datetime_value_min_get(self.obj, &time)
|
||||
ret = datetime( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday,
|
||||
time.tm_hour,
|
||||
time.tm_min,
|
||||
time.tm_sec)
|
||||
return ret
|
||||
|
||||
def __set__(self, newtime):
|
||||
cdef tm time
|
||||
tmtup = newtime.timetuple()
|
||||
time.tm_sec = tmtup.tm_sec
|
||||
time.tm_min = tmtup.tm_min
|
||||
time.tm_hour = tmtup.tm_hour
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_datetime_value_min_set(self.obj, &time)
|
||||
|
||||
property field_limit:
|
||||
"""The field limits of a field.
|
||||
|
||||
Limits can be set to individual fields, independently, except for
|
||||
AM/PM field. Any field can display the values only in between these
|
||||
Minimum and Maximum limits unless the corresponding time value is
|
||||
restricted from MinTime to MaxTime. That is, Min/ Max field limits
|
||||
always works under the limitations of MinTime/ MaxTime.
|
||||
|
||||
There is no provision to set the limits of AM/PM field.
|
||||
|
||||
Type of the field. ELM_DATETIME_YEAR etc.
|
||||
Reference to field's minimum value
|
||||
Reference to field's maximum value
|
||||
|
||||
type: (Elm_Datetime_Field_Type, int, int)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef int min, max
|
||||
cdef Elm_Datetime_Field_Type fieldtype = ELM_DATETIME_YEAR
|
||||
elm_datetime_field_limit_get(self.obj, fieldtype, &min, &max)
|
||||
return (fieldtype, min, max)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int min, max
|
||||
cdef Elm_Datetime_Field_Type fieldtype
|
||||
min, max, fieldtype = value
|
||||
elm_datetime_field_limit_set(self.obj, fieldtype, min, max)
|
||||
|
||||
property value:
|
||||
"""The current value of a field.
|
||||
|
||||
Year: years since 1900. Negative value represents year below 1900 (year
|
||||
value -30 represents 1870). Year default range is from 70 to 137.
|
||||
|
||||
Month: default value range is from 0 to 11.
|
||||
|
||||
Date: default value range is from 1 to 31 according to the month value.
|
||||
|
||||
Hour: default value will be in terms of 24 hr format (0~23)
|
||||
|
||||
Minute: default value range is from 0 to 59.
|
||||
|
||||
:type: datetime.datetime
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_datetime_value_get(self.obj, &time)
|
||||
ret = datetime( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday,
|
||||
time.tm_hour,
|
||||
time.tm_min,
|
||||
time.tm_sec)
|
||||
return ret
|
||||
|
||||
def __set__(self, newtime):
|
||||
cdef tm time
|
||||
tmtup = newtime.timetuple()
|
||||
time.tm_sec = tmtup.tm_sec
|
||||
time.tm_min = tmtup.tm_min
|
||||
time.tm_hour = tmtup.tm_hour
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_datetime_value_set(self.obj, &time)
|
||||
|
||||
def field_visible_get(self, fieldtype):
|
||||
"""field_visible_get(int fieldtype) -> bool
|
||||
|
||||
Whether a field can be visible/not
|
||||
|
||||
.. seealso:: :py:func:`field_visible_set()`
|
||||
|
||||
:param fieldtype: Type of the field. ELM_DATETIME_YEAR etc
|
||||
:type fieldtype: Elm_Datetime_Field_Type
|
||||
:return: ``True``, if field can be visible. ``False`` otherwise.
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(elm_datetime_field_visible_get(self.obj, fieldtype))
|
||||
|
||||
def field_visible_set(self, fieldtype, visible):
|
||||
"""field_visible_set(int fieldtype, bool visible)
|
||||
|
||||
Set a field to be visible or not.
|
||||
|
||||
Setting this API True does not ensure that the field is visible,
|
||||
apart from this, the field's format must be present in Datetime
|
||||
overall format. If a field's visibility is set to False then it
|
||||
won't appear even though its format is present in overall format. So
|
||||
if and only if this API is set true and the corresponding field's
|
||||
format is present in Datetime format, the field is visible.
|
||||
|
||||
By default the field visibility is set to True.
|
||||
|
||||
.. seealso:: :py:func:`field_visible_get()`
|
||||
|
||||
:param fieldtype: Type of the field. ELM_DATETIME_YEAR etc.
|
||||
:type fieldtype: Elm_Datetime_Field_Type
|
||||
:param visible: ``True`` field can be visible, ``False`` otherwise.
|
||||
:type visible: bool
|
||||
|
||||
"""
|
||||
elm_datetime_field_visible_set(self.obj, fieldtype, visible)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
"""Whenever Datetime field value is changed, this signal is sent."""
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
def callback_languge_changed_add(self, func, *args, **kwargs):
|
||||
"""Whenever system locale changes, this signal is sent."""
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_datetime", Datetime)
|
|
@ -0,0 +1,13 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object
|
||||
from enums cimport Elm_Dayselector_Day
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_dayselector_add(Evas_Object *parent)
|
||||
void elm_dayselector_day_selected_set(Evas_Object *obj, Elm_Dayselector_Day day, Eina_Bool selected)
|
||||
Eina_Bool elm_dayselector_day_selected_get(Evas_Object *obj, Elm_Dayselector_Day day)
|
||||
void elm_dayselector_week_start_set(Evas_Object *obj, Elm_Dayselector_Day day)
|
||||
Elm_Dayselector_Day elm_dayselector_week_start_get(Evas_Object *obj)
|
||||
void elm_dayselector_weekend_start_set(Evas_Object *obj, Elm_Dayselector_Day day)
|
||||
Elm_Dayselector_Day elm_dayselector_weekend_start_get(Evas_Object *obj)
|
||||
void elm_dayselector_weekend_length_set(Evas_Object *obj, unsigned int length)
|
||||
unsigned int elm_dayselector_weekend_length_get(Evas_Object *obj)
|
|
@ -0,0 +1,201 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Dayselector days
|
||||
|
||||
.. data:: ELM_DAYSELECTOR_SUN
|
||||
|
||||
Sunday
|
||||
|
||||
.. data:: ELM_DAYSELECTOR_MON
|
||||
|
||||
Monday
|
||||
|
||||
.. data:: ELM_DAYSELECTOR_TUE
|
||||
|
||||
Tuesday
|
||||
|
||||
.. data:: ELM_DAYSELECTOR_WED
|
||||
|
||||
Wednesday
|
||||
|
||||
.. data:: ELM_DAYSELECTOR_THU
|
||||
|
||||
Thursday
|
||||
|
||||
.. data:: ELM_DAYSELECTOR_FRI
|
||||
|
||||
Friday
|
||||
|
||||
.. data:: ELM_DAYSELECTOR_SAT
|
||||
|
||||
Saturday
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_DAYSELECTOR_SUN = enums.ELM_DAYSELECTOR_SUN
|
||||
ELM_DAYSELECTOR_MON = enums.ELM_DAYSELECTOR_MON
|
||||
ELM_DAYSELECTOR_TUE = enums.ELM_DAYSELECTOR_TUE
|
||||
ELM_DAYSELECTOR_WED = enums.ELM_DAYSELECTOR_WED
|
||||
ELM_DAYSELECTOR_THU = enums.ELM_DAYSELECTOR_THU
|
||||
ELM_DAYSELECTOR_FRI = enums.ELM_DAYSELECTOR_FRI
|
||||
ELM_DAYSELECTOR_SAT = enums.ELM_DAYSELECTOR_SAT
|
||||
ELM_DAYSELECTOR_MAX = enums.ELM_DAYSELECTOR_MAX
|
||||
|
||||
cdef class Dayselector(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
Dayselector displays all seven days of the week and allows the user to
|
||||
select multiple days.
|
||||
|
||||
The selection can be toggle by just clicking on the day.
|
||||
|
||||
Dayselector also provides the functionality to check whether a day is
|
||||
selected or not.
|
||||
|
||||
First day of the week is taken from config settings by default. It can be
|
||||
altered by using the API :py:attr:`week_start` API.
|
||||
|
||||
APIs are provided for setting the duration of weekend
|
||||
:py:attr:`weekend_start` and :py:attr:`weekend_length` does this job.
|
||||
|
||||
Two styles of weekdays and weekends are supported in Dayselector.
|
||||
Application can emit signals on individual check objects for setting the
|
||||
weekday, weekend styles.
|
||||
|
||||
Once the weekend start day or weekend length changes, all the weekday &
|
||||
weekend styles will be reset to default style. It's the application's
|
||||
responsibility to set the styles again by sending corresponding signals.
|
||||
|
||||
"day0" indicates Sunday, "day1" indicates Monday etc. continues and so,
|
||||
"day6" indicates the Saturday part name.
|
||||
|
||||
Application can change individual day display string by using the API
|
||||
:py:func:`elementary.object.Object.part_text_set()`.
|
||||
|
||||
:py:func:`elementary.object.Object.part_content_set()` API sets the
|
||||
individual day object only if the passed one is a Check widget.
|
||||
|
||||
Check object representing a day can be set/get by the application by using
|
||||
the elm_object_part_content_set/get APIs thus providing a way to handle
|
||||
the different check styles for individual days.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``"dayselector,changed"`` - when the user changes the state of a day.
|
||||
- ``"language,changed"`` - the program's language changed
|
||||
|
||||
Available styles for dayselector are:
|
||||
|
||||
- default
|
||||
|
||||
"""
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_dayselector_add(parent.obj))
|
||||
|
||||
def day_selected_set(self, day, selected):
|
||||
"""day_selected_set(int day, bool selected)
|
||||
|
||||
Set the state of given Dayselector_Day.
|
||||
|
||||
.. seealso:: Elm_Dayselector_Day
|
||||
.. seealso:: :py:func:`day_selected_get()`
|
||||
|
||||
:param day: The day that the user want to set state.
|
||||
:type day: Elm_Dayselector_Day
|
||||
:param selected: state of the day. ``True`` is selected.
|
||||
:type selected: bool
|
||||
|
||||
"""
|
||||
elm_dayselector_day_selected_set(self.obj, day, selected)
|
||||
|
||||
def day_selected_get(self, day):
|
||||
"""day_selected_get(int day):
|
||||
|
||||
Get the state of given Dayselector_Day.
|
||||
|
||||
.. seealso:: Elm_Dayselector_Day
|
||||
.. seealso:: :py:func:`day_selected_set()`
|
||||
|
||||
:param day: The day that the user want to know state.
|
||||
:type day: Elm_Dayselector_Day
|
||||
:return: ``True``, if the Day is selected
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return bool(elm_dayselector_day_selected_get(self.obj, day))
|
||||
|
||||
property week_start:
|
||||
"""The starting day of Dayselector.
|
||||
|
||||
:type: Elm_Dayselector_Day
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_dayselector_week_start_get(self.obj)
|
||||
def __set__(self, day):
|
||||
elm_dayselector_week_start_set(self.obj, day)
|
||||
|
||||
property weekend_start:
|
||||
"""The weekend starting day of Dayselector.
|
||||
|
||||
:type: Elm_Dayselector_Day
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_dayselector_weekend_start_get(self.obj)
|
||||
def __set__(self, day):
|
||||
elm_dayselector_weekend_start_set(self.obj, day)
|
||||
|
||||
property weekend_length:
|
||||
"""The weekend length of Dayselector.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_dayselector_weekend_length_get(self.obj)
|
||||
def __set__(self, length):
|
||||
elm_dayselector_weekend_length_set(self.obj, length)
|
||||
|
||||
def callback_dayselector_changed_add(self, func, *args, **kwargs):
|
||||
"""when the user changes the state of a day."""
|
||||
self._callback_add("dayselector,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_dayselector_changed_del(self, func):
|
||||
self._callback_del("dayselector,changed", func)
|
||||
|
||||
def callback_language_changed_add(self, func, *args, **kwargs):
|
||||
"""the program's language changed"""
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_dayselector", Dayselector)
|
|
@ -0,0 +1,28 @@
|
|||
from efl.evas cimport Eina_Bool, const_Eina_List, Evas_Object, Evas_Smart_Cb
|
||||
from object_item cimport Elm_Object_Item, ObjectItem
|
||||
from enums cimport Elm_Scroller_Policy
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_diskselector_add(Evas_Object *parent)
|
||||
void elm_diskselector_round_enabled_set(Evas_Object *obj, Eina_Bool enabled)
|
||||
Eina_Bool elm_diskselector_round_enabled_get(Evas_Object *obj)
|
||||
int elm_diskselector_side_text_max_length_get(Evas_Object *obj)
|
||||
void elm_diskselector_side_text_max_length_set(Evas_Object *obj, int len)
|
||||
void elm_diskselector_display_item_num_set(Evas_Object *obj, int num)
|
||||
int elm_diskselector_display_item_num_get(Evas_Object *obj)
|
||||
void elm_diskselector_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
|
||||
void elm_diskselector_bounce_get(Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
|
||||
void elm_diskselector_scroller_policy_get(Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
|
||||
void elm_diskselector_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
|
||||
void elm_diskselector_clear(Evas_Object *obj)
|
||||
const_Eina_List *elm_diskselector_items_get(Evas_Object *obj)
|
||||
Elm_Object_Item *elm_diskselector_item_append(Evas_Object *obj, const_char *label, Evas_Object *icon, Evas_Smart_Cb func, void *data)
|
||||
Elm_Object_Item *elm_diskselector_selected_item_get(Evas_Object *obj)
|
||||
void elm_diskselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected)
|
||||
Eina_Bool elm_diskselector_item_selected_get(Elm_Object_Item *it)
|
||||
Elm_Object_Item *elm_diskselector_first_item_get(Evas_Object *obj)
|
||||
Elm_Object_Item *elm_diskselector_last_item_get(Evas_Object *obj)
|
||||
Elm_Object_Item *elm_diskselector_item_prev_get(Elm_Object_Item *it)
|
||||
Elm_Object_Item *elm_diskselector_item_next_get(Elm_Object_Item *it)
|
||||
|
|
@ -0,0 +1,438 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include "widget_header.pxi"
|
||||
from object cimport Object
|
||||
from object_item cimport ObjectItem, _object_item_callback, _object_item_to_python
|
||||
from object_item import _cb_object_item_conv
|
||||
from scroller cimport *
|
||||
|
||||
cdef class DiskselectorItem(ObjectItem):
|
||||
|
||||
"""
|
||||
|
||||
An item for the Diskselector widget.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject diskselector, label, evasObject icon=None, callback=None, *args, **kargs):
|
||||
cdef Evas_Object* icon_obj = NULL
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
|
||||
if icon is not None:
|
||||
icon_obj = icon.obj
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
self.params = (callback, args, kargs)
|
||||
|
||||
item = elm_diskselector_item_append(diskselector.obj, _cfruni(label) if label is not None else NULL, icon_obj, cb, <void*>self)
|
||||
|
||||
if item != NULL:
|
||||
self._set_obj(item)
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
property selected:
|
||||
"""The selected state of an item.
|
||||
|
||||
This sets the selected state of the given item.
|
||||
``True`` for selected, ``False`` for not selected.
|
||||
|
||||
If a new item is selected the previously selected will be unselected.
|
||||
Previously selected item can be fetched from the property
|
||||
:py:attr:`Diskselector.selected_item`.
|
||||
|
||||
If the item is unselected, the first item of diskselector will
|
||||
be selected.
|
||||
|
||||
Selected items will be visible on center position of diskselector.
|
||||
So if it was on another position before selected, or was invisible,
|
||||
diskselector will animate items until the selected item reaches center
|
||||
position.
|
||||
|
||||
.. seealso:: :py:attr:`Diskselector.selected_item`
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __set__(self, selected):
|
||||
elm_diskselector_item_selected_set(self.item, selected)
|
||||
def __get__(self):
|
||||
return bool(elm_diskselector_item_selected_get(self.item))
|
||||
|
||||
property prev:
|
||||
"""Get the item before ``item`` in diskselector.
|
||||
|
||||
The list of items follows append order. So it will return item appended
|
||||
just before ``item`` and that wasn't deleted.
|
||||
|
||||
If it is the first item, ``None`` will be returned.
|
||||
First item can be get by :py:attr:`Diskselector.first_item`.
|
||||
|
||||
.. seealso::
|
||||
:py:func:`Diskselector.item_append()`
|
||||
:py:attr:`Diskselector.items`
|
||||
|
||||
:type: DiskselectorItem
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_item_prev_get(self.item)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
property next:
|
||||
"""Get the item after ``item`` in diskselector.
|
||||
|
||||
The list of items follows append order. So it will return item appended
|
||||
just after ``item`` and that wasn't deleted.
|
||||
|
||||
If it is the last item, ``None`` will be returned.
|
||||
Last item can be get by elm_diskselector_last_item_get().
|
||||
|
||||
.. seealso::
|
||||
:py:func:`Diskselector.item_append()`
|
||||
:py:attr:`Diskselector.items`
|
||||
|
||||
:type: DiskselectorItem
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_item_next_get(self.item)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
cdef class Diskselector(Object):
|
||||
|
||||
"""
|
||||
|
||||
A diskselector is a kind of list widget. It scrolls horizontally,
|
||||
and can contain label and icon objects. Three items are displayed
|
||||
with the selected one in the middle.
|
||||
|
||||
It can act like a circular list with round mode and labels can be
|
||||
reduced for a defined length for side items.
|
||||
|
||||
Smart callbacks one can listen to:
|
||||
|
||||
- "selected" - when item is selected, i.e. scroller stops.
|
||||
- "scroll,anim,start" - scrolling animation has started
|
||||
- "scroll,anim,stop" - scrolling animation has stopped
|
||||
- "scroll,drag,start" - dragging the diskselector has started
|
||||
- "scroll,drag,stop" - dragging the diskselector has stopped
|
||||
|
||||
Available styles for it:
|
||||
|
||||
- ``"default"``
|
||||
|
||||
Default content parts of the diskselector items that you can use for are:
|
||||
|
||||
- "icon" - An icon in the diskselector item
|
||||
|
||||
Default text parts of the diskselector items that you can use for are:
|
||||
|
||||
- "default" - Label of the diskselector item
|
||||
|
||||
.. note:: The "scroll,anim,*" and "scroll,drag,*" signals are only emitted
|
||||
by user intervention.
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_diskselector_add(parent.obj))
|
||||
|
||||
property round_enabled:
|
||||
"""Enable or disable round mode.
|
||||
|
||||
Disabled by default. If round mode is enabled the items list will
|
||||
work like a circular list, so when the user reaches the last item,
|
||||
the first one will popup.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __set__(self, enabled):
|
||||
elm_diskselector_round_enabled_set(self.obj, enabled)
|
||||
def __get__(self):
|
||||
return bool(elm_diskselector_round_enabled_get(self.obj))
|
||||
|
||||
property side_text_max_length:
|
||||
"""The side labels max length.
|
||||
|
||||
Length is the number of characters of items' label that will be
|
||||
visible when it's set on side positions. It will just crop
|
||||
the string after defined size. E.g.:
|
||||
|
||||
An item with label "January" would be displayed on side position as
|
||||
"Jan" if max length is set to 3, or "Janu", if this property
|
||||
is set to 4.
|
||||
|
||||
When it's selected, the entire label will be displayed, except for
|
||||
width restrictions. In this case label will be cropped and "..."
|
||||
will be concatenated.
|
||||
|
||||
Default side label max length is 3.
|
||||
|
||||
This property will be applied over all items, included before or
|
||||
later this function call.
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_diskselector_side_text_max_length_get(self.obj)
|
||||
def __set__(self, length):
|
||||
elm_diskselector_side_text_max_length_set(self.obj, length)
|
||||
|
||||
property display_item_num:
|
||||
"""The number of items to be displayed.
|
||||
|
||||
Default value is 3, and also it's the minimum. If ``num`` is less
|
||||
than 3, it will be set to 3.
|
||||
|
||||
Also, it can be set on theme, using data item ``display_item_num``
|
||||
on group "elm/diskselector/item/X", where X is style set.
|
||||
E.g.::
|
||||
|
||||
group { name: "elm/diskselector/item/X";
|
||||
data {
|
||||
item: "display_item_num" "5";
|
||||
}
|
||||
|
||||
:type: int
|
||||
|
||||
"""
|
||||
def __set__(self, num):
|
||||
elm_diskselector_display_item_num_set(self.obj, num)
|
||||
def __get__(self):
|
||||
return elm_diskselector_display_item_num_get(self.obj)
|
||||
|
||||
property bounce:
|
||||
"""Bouncing behaviour when the scrolled content reaches an edge.
|
||||
|
||||
Tell the internal scroller object whether it should bounce or not
|
||||
when it reaches the respective edges for each axis.
|
||||
|
||||
.. seealso:: :py:attr:`elementary.scroller.Scroller.bounce`
|
||||
|
||||
:type: (bool h_bounce, bool v_bounce)
|
||||
|
||||
"""
|
||||
def __set__(self, bounce):
|
||||
h_bounce, v_bounce = bounce
|
||||
elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
|
||||
def __get__(self):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
|
||||
return (h_bounce, v_bounce)
|
||||
|
||||
property scroller_policy:
|
||||
"""The scrollbar policy.
|
||||
|
||||
This sets the scrollbar visibility policy for the given scroller.
|
||||
ELM_SCROLLER_POLICY_AUTO means the scrollbar is made visible if it
|
||||
is needed, and otherwise kept hidden. ELM_SCROLLER_POLICY_ON turns
|
||||
it on all the time, and ELM_SCROLLER_POLICY_OFF always keeps it off.
|
||||
This applies respectively for the horizontal and vertical scrollbars.
|
||||
|
||||
Both are disabled by default, i.e., are set to ELM_SCROLLER_POLICY_OFF.
|
||||
|
||||
:type: tuple of Elm_Scroller_Policy
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Scroller_Policy h_policy, v_policy
|
||||
elm_scroller_policy_get(self.obj, &h_policy, &v_policy)
|
||||
return (h_policy, v_policy)
|
||||
def __set__(self, policy):
|
||||
h_policy, v_policy = policy
|
||||
elm_scroller_policy_set(self.obj, h_policy, v_policy)
|
||||
|
||||
def clear(self):
|
||||
"""clear()
|
||||
|
||||
Remove all diskselector's items.
|
||||
|
||||
.. seealso::
|
||||
:py:func:`elementary.object_item.ObjectItem.delete()`
|
||||
:py:func:`item_append()`
|
||||
|
||||
"""
|
||||
elm_diskselector_clear(self.obj)
|
||||
|
||||
property items:
|
||||
"""Get a list of all the diskselector items.
|
||||
|
||||
.. seealso::
|
||||
:py:func:`item_append()`
|
||||
:py:func:`elementary.object_item.ObjectItem.delete()`
|
||||
:py:func:`clear()`
|
||||
|
||||
:type: list of :py:class:`DiskselectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it
|
||||
cdef const_Eina_List *lst
|
||||
|
||||
lst = elm_diskselector_items_get(self.obj)
|
||||
ret = []
|
||||
ret_append = ret.append
|
||||
while lst:
|
||||
it = <Elm_Object_Item *>lst.data
|
||||
lst = lst.next
|
||||
o = _object_item_to_python(it)
|
||||
if o is not None:
|
||||
ret_append(o)
|
||||
return ret
|
||||
|
||||
def item_append(self, label, evasObject icon = None, callback = None, *args, **kwargs):
|
||||
"""item_append(self, unicode label, evas.Object icon = None, callback = None, *args, **kwargs) -> DiskselectorItem
|
||||
|
||||
Appends a new item to the diskselector object.
|
||||
|
||||
A new item will be created and appended to the diskselector, i.e.,
|
||||
will be set as last item. Also, if there is no selected item, it will
|
||||
be selected. This will always happens for the first appended item.
|
||||
|
||||
If no icon is set, label will be centered on item position, otherwise
|
||||
the icon will be placed at left of the label, that will be shifted
|
||||
to the right.
|
||||
|
||||
Items created with this method can be deleted with
|
||||
:py:func:`elementary.object_item.ObjectItem.delete()`.
|
||||
|
||||
If a function is passed as argument, it will be called every time
|
||||
this item is selected, i.e., the user stops the diskselector with
|
||||
this item on center position.
|
||||
|
||||
Simple example (with no function callback or data associated)::
|
||||
|
||||
disk = Diskselector(win)
|
||||
ic = Icon(win)
|
||||
ic.file_set("path/to/image")
|
||||
ic.resizable_set(EINA_TRUE, EINA_TRUE)
|
||||
disk.item_append("label", ic)
|
||||
|
||||
.. seealso::
|
||||
:py:func:`elementary.object_item.ObjectItem.delete()`
|
||||
:py:func:`clear()`
|
||||
:py:class:`elementary.image.Image`
|
||||
|
||||
:param label: The label of the diskselector item.
|
||||
:type label: string
|
||||
:param icon: The icon object to use at left side of the item. An
|
||||
icon can be any Evas object, but usually it is an
|
||||
:py:class:`elementary.icon.Icon`.
|
||||
:type icon: :py:class:`evas.object.Object`
|
||||
:param func: The function to call when the item is selected.
|
||||
:type func: function
|
||||
|
||||
:return: The created item or ``None`` upon failure.
|
||||
:rtype: :py:class:`DiskselectorItem`
|
||||
|
||||
"""
|
||||
return DiskselectorItem(self, label, icon, callback, *args, **kwargs)
|
||||
|
||||
property selected_item:
|
||||
"""Get the selected item.
|
||||
|
||||
The selected item can be unselected with function
|
||||
:py:attr:`DiskselectorItem.selected`, and the first item of diskselector
|
||||
will be selected.
|
||||
|
||||
The selected item always will be centered on diskselector, with full
|
||||
label displayed, i.e., max length set to side labels won't apply on
|
||||
the selected item. More details on
|
||||
:py:attr:`side_text_max_length`.
|
||||
|
||||
:type: :py:class:`DiskselectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_selected_item_get(self.obj)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
property first_item:
|
||||
"""Get the first item of the diskselector.
|
||||
|
||||
The list of items follows append order. So it will return the first
|
||||
item appended to the widget that wasn't deleted.
|
||||
|
||||
.. seealso:: :py:func:`item_append()` :py:attr:`items`
|
||||
|
||||
:type: :py:class:`DiskselectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_first_item_get(self.obj)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
property last_item:
|
||||
"""Get the last item of the diskselector.
|
||||
|
||||
The list of items follows append order. So it will return last first
|
||||
item appended to the widget that wasn't deleted.
|
||||
|
||||
.. seealso:: :py:func:`item_append()` :py:attr:`items`
|
||||
|
||||
:type: :py:class:`DiskselectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_last_item_get(self.obj)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
"""When item is selected, i.e. scroller stops."""
|
||||
self._callback_add_full("selected", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_scroll_anim_start_add(self, func, *args, **kwargs):
|
||||
"""Scrolling animation has started."""
|
||||
self._callback_add("scroll,anim,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_start_del(self, func):
|
||||
self._callback_del("scroll,anim,start", func)
|
||||
|
||||
def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
|
||||
"""Scrolling animation has stopped."""
|
||||
self._callback_add("scroll,anim,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_stop_del(self, func):
|
||||
self._callback_del("scroll,anim,stop", func)
|
||||
|
||||
def callback_scroll_drag_start_add(self, func, *args, **kwargs):
|
||||
"""Dragging the diskselector has started."""
|
||||
self._callback_add("scroll,drag,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_start_del(self, func):
|
||||
self._callback_del("scroll,drag,start", func)
|
||||
|
||||
def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
|
||||
"""Dragging the diskselector has stopped."""
|
||||
self._callback_add("scroll,drag,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_stop_del(self, func):
|
||||
self._callback_del("scroll,drag,stop", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_diskselector", Diskselector)
|
|
@ -1,98 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Background(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_bg_add(parent.obj))
|
||||
|
||||
def file_set(self, filename, group = ""):
|
||||
return bool(elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group)))
|
||||
|
||||
def file_get(self):
|
||||
cdef const_char_ptr filename, group
|
||||
|
||||
elm_bg_file_get(self.obj, &filename, &group)
|
||||
if filename == NULL:
|
||||
filename = ""
|
||||
if group == NULL:
|
||||
group = ""
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
property file:
|
||||
def __get__(self):
|
||||
cdef const_char_ptr filename, group
|
||||
elm_bg_file_get(self.obj, &filename, &group)
|
||||
if filename == NULL:
|
||||
filename = ""
|
||||
if group == NULL:
|
||||
group = ""
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
def __set__(self, value):
|
||||
if isinstance(value, tuple) or isinstance(value, list):
|
||||
filename, group = value
|
||||
else:
|
||||
filename = value
|
||||
group = ""
|
||||
elm_bg_file_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
|
||||
def option_set(self, option):
|
||||
elm_bg_option_set(self.obj, option)
|
||||
|
||||
def option_get(self):
|
||||
return elm_bg_option_get(self.obj)
|
||||
|
||||
property option:
|
||||
def __get__(self):
|
||||
return elm_bg_option_get(self.obj)
|
||||
|
||||
def __set__(self, value):
|
||||
elm_bg_option_set(self.obj, value)
|
||||
|
||||
def color_set(self, r, g, b):
|
||||
elm_bg_color_set(self.obj, r, g, b)
|
||||
|
||||
def color_get(self):
|
||||
cdef int r, g, b
|
||||
|
||||
elm_bg_color_get(self.obj, &r, &g, &b)
|
||||
return (r, g, b)
|
||||
|
||||
property color:
|
||||
def __get__(self):
|
||||
cdef int r, g, b
|
||||
elm_bg_color_get(self.obj, &r, &g, &b)
|
||||
return (r, g, b)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int r, g, b
|
||||
r, g, b = value
|
||||
elm_bg_color_set(self.obj, r, g, b)
|
||||
|
||||
def load_size_set(self, w, h):
|
||||
elm_bg_load_size_set(self.obj, w, h)
|
||||
|
||||
property load_size:
|
||||
def __set__(self, value):
|
||||
cdef Evas_Coord w, h
|
||||
w, h = value
|
||||
elm_bg_load_size_set(self.obj, w, h)
|
||||
|
||||
|
||||
_object_mapping_register("elm_bg", Background)
|
|
@ -1,194 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from efl.evas cimport evas_object_box_layout_horizontal
|
||||
from efl.evas cimport evas_object_box_layout_vertical
|
||||
from efl.evas cimport evas_object_box_layout_homogeneous_vertical
|
||||
from efl.evas cimport evas_object_box_layout_homogeneous_horizontal
|
||||
from efl.evas cimport evas_object_box_layout_homogeneous_max_size_horizontal
|
||||
from efl.evas cimport evas_object_box_layout_homogeneous_max_size_vertical
|
||||
from efl.evas cimport evas_object_box_layout_flow_horizontal
|
||||
from efl.evas cimport evas_object_box_layout_flow_vertical
|
||||
from efl.evas cimport evas_object_box_layout_stack
|
||||
from efl.evas cimport elm_box_layout_transition
|
||||
|
||||
# ctypedef enum Elm_Box_CLayout:
|
||||
# ELM_BOX_LAYOUT_HORIZONTAL
|
||||
# ELM_BOX_LAYOUT_VERTICAL
|
||||
# ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL
|
||||
# ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL
|
||||
# ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL
|
||||
# ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL
|
||||
# ELM_BOX_LAYOUT_FLOW_HORIZONTAL
|
||||
# ELM_BOX_LAYOUT_FLOW_VERTICAL
|
||||
# ELM_BOX_LAYOUT_STACK
|
||||
|
||||
cdef Evas_Object_Box_Layout _py_elm_box_layout_resolv(int layout) with gil:
|
||||
if layout == ELM_BOX_LAYOUT_HORIZONTAL:
|
||||
return evas_object_box_layout_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_VERTICAL:
|
||||
return evas_object_box_layout_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL:
|
||||
return evas_object_box_layout_homogeneous_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL:
|
||||
return evas_object_box_layout_homogeneous_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL:
|
||||
return evas_object_box_layout_homogeneous_max_size_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL:
|
||||
return evas_object_box_layout_homogeneous_max_size_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_FLOW_HORIZONTAL:
|
||||
return evas_object_box_layout_flow_horizontal
|
||||
elif layout == ELM_BOX_LAYOUT_FLOW_VERTICAL:
|
||||
return evas_object_box_layout_flow_vertical
|
||||
elif layout == ELM_BOX_LAYOUT_STACK:
|
||||
return evas_object_box_layout_stack
|
||||
return evas_object_box_layout_vertical
|
||||
|
||||
|
||||
cdef class Box(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_box_add(parent.obj))
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_box_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_get(self):
|
||||
return elm_box_horizontal_get(self.obj)
|
||||
|
||||
property horizontal:
|
||||
def __get__(self):
|
||||
return elm_box_horizontal_get(self.obj)
|
||||
def __set__(self, value):
|
||||
elm_box_horizontal_set(self.obj, value)
|
||||
|
||||
def homogeneous_set(self, homogeneous):
|
||||
elm_box_homogeneous_set(self.obj, homogeneous)
|
||||
|
||||
def homogeneous_get(self):
|
||||
return bool(elm_box_homogeneous_get(self.obj))
|
||||
|
||||
property homogeneous:
|
||||
def __get__(self):
|
||||
return bool(elm_box_homogeneous_get(self.obj))
|
||||
|
||||
def __set__(self, value):
|
||||
elm_box_homogeneous_set(self.obj, value)
|
||||
|
||||
def pack_start(self, evasObject obj):
|
||||
elm_box_pack_start(self.obj, obj.obj)
|
||||
|
||||
def pack_end(self, evasObject obj):
|
||||
elm_box_pack_end(self.obj, obj.obj)
|
||||
|
||||
def pack_before(self, evasObject obj, evasObject before):
|
||||
elm_box_pack_before(self.obj, obj.obj, before.obj)
|
||||
|
||||
def pack_after(self, evasObject obj, evasObject after):
|
||||
elm_box_pack_after(self.obj, obj.obj, after.obj)
|
||||
|
||||
def clear(self):
|
||||
elm_box_clear(self.obj)
|
||||
|
||||
def unpack(self, evasObject obj):
|
||||
elm_box_unpack(self.obj, obj.obj)
|
||||
|
||||
def unpack_all(self):
|
||||
elm_box_unpack_all(self.obj)
|
||||
|
||||
def children_get(self):
|
||||
return _object_list_to_python(elm_box_children_get(self.obj))
|
||||
|
||||
property children:
|
||||
def __get__(self):
|
||||
return _object_list_to_python(elm_box_children_get(self.obj))
|
||||
#def __set__(self, value):
|
||||
#TODO: unpack_all() and then get the objects from value and pack_end() them.
|
||||
def __del__(self):
|
||||
elm_box_clear(self.obj)
|
||||
|
||||
def padding_set(self, horizontal, vertical):
|
||||
elm_box_padding_set(self.obj, horizontal, vertical)
|
||||
|
||||
def padding_get(self):
|
||||
cdef int horizontal, vertical
|
||||
|
||||
elm_box_padding_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
property padding:
|
||||
def __get__(self):
|
||||
cdef int horizontal, vertical
|
||||
elm_box_padding_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int horizontal, vertical
|
||||
horizontal, vertical = value
|
||||
elm_box_padding_set(self.obj, horizontal, vertical)
|
||||
|
||||
def align_set(self, horizontal, vertical):
|
||||
elm_box_align_set(self.obj, horizontal, vertical)
|
||||
|
||||
def align_get(self):
|
||||
cdef double horizontal, vertical
|
||||
|
||||
elm_box_align_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
property align:
|
||||
def __get__(self):
|
||||
cdef double horizontal, vertical
|
||||
elm_box_align_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef double horizontal, vertical
|
||||
horizontal, vertical = value
|
||||
elm_box_align_set(self.obj, horizontal, vertical)
|
||||
|
||||
def recalculate(self):
|
||||
elm_box_recalculate(self.obj)
|
||||
|
||||
def layout_set(self, layout):
|
||||
cdef Evas_Object_Box_Layout ly
|
||||
|
||||
ly = _py_elm_box_layout_resolv(layout)
|
||||
elm_box_layout_set(self.obj, ly, NULL, NULL)
|
||||
|
||||
property layout:
|
||||
def __set__(self, layout):
|
||||
cdef Evas_Object_Box_Layout ly
|
||||
ly = _py_elm_box_layout_resolv(layout)
|
||||
elm_box_layout_set(self.obj, ly, NULL, NULL)
|
||||
|
||||
def layout_transition(self, duration, from_layout, to_layout):
|
||||
cdef Elm_Box_Transition *t
|
||||
cdef Evas_Object_Box_Layout ly_from, ly_to
|
||||
|
||||
ly_from = _py_elm_box_layout_resolv(from_layout)
|
||||
ly_to = _py_elm_box_layout_resolv(to_layout)
|
||||
t = elm_box_transition_new(duration,
|
||||
ly_from, NULL, NULL,
|
||||
ly_to, NULL, NULL,
|
||||
NULL, NULL)
|
||||
elm_box_layout_set(self.obj, elm_box_layout_transition, t,
|
||||
elm_box_transition_free)
|
||||
|
||||
|
||||
_object_mapping_register("elm_box", Box)
|
|
@ -1,44 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Bubble(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_bubble_add(parent.obj))
|
||||
|
||||
def pos_set(self, pos):
|
||||
elm_bubble_pos_set(self.obj, pos)
|
||||
|
||||
def pos_get(self):
|
||||
return elm_bubble_pos_get(self.obj)
|
||||
|
||||
property pos:
|
||||
def __get__(self):
|
||||
return elm_bubble_pos_get(self.obj)
|
||||
|
||||
def __set__(self, value):
|
||||
elm_bubble_pos_set(self.obj, value)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_bubble", Bubble)
|
|
@ -1,85 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Button(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_button_add(parent.obj))
|
||||
|
||||
def autorepeat_set(self, on):
|
||||
elm_button_autorepeat_set(self.obj, on)
|
||||
|
||||
def autorepeat_get(self):
|
||||
return bool(elm_button_autorepeat_get(self.obj))
|
||||
|
||||
property autorepeat:
|
||||
def __get__(self):
|
||||
return bool(elm_button_autorepeat_get(self.obj))
|
||||
def __set__(self, on):
|
||||
elm_button_autorepeat_set(self.obj, on)
|
||||
|
||||
def autorepeat_initial_timeout_set(self, t):
|
||||
elm_button_autorepeat_initial_timeout_set(self.obj, t)
|
||||
|
||||
def autorepeat_initial_timeout_get(self):
|
||||
return elm_button_autorepeat_initial_timeout_get(self.obj)
|
||||
|
||||
property autorepeat_initial_timeout:
|
||||
def __get__(self):
|
||||
return elm_button_autorepeat_initial_timeout_get(self.obj)
|
||||
def __set__(self, t):
|
||||
elm_button_autorepeat_initial_timeout_set(self.obj, t)
|
||||
|
||||
def autorepeat_gap_timeout_set(self, t):
|
||||
elm_button_autorepeat_gap_timeout_set(self.obj, t)
|
||||
|
||||
def autorepeat_gap_timeout_get(self):
|
||||
return elm_button_autorepeat_gap_timeout_get(self.obj)
|
||||
|
||||
property autorepeat_gap_timeout:
|
||||
def __get__(self):
|
||||
return elm_button_autorepeat_gap_timeout_get(self.obj)
|
||||
def __set__(self, t):
|
||||
elm_button_autorepeat_gap_timeout_set(self.obj, t)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_repeated_add(self, func, *args, **kwargs):
|
||||
self._callback_add("repeated", func, *args, **kwargs)
|
||||
|
||||
def callback_repeated_del(self, func):
|
||||
self._callback_del("repeated", func)
|
||||
|
||||
def callback_pressed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("pressed", func, *args, **kwargs)
|
||||
|
||||
def callback_pressed_del(self, func):
|
||||
self._callback_del("pressed", func)
|
||||
|
||||
def callback_unpressed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("unpressed", func, *args, **kwargs)
|
||||
|
||||
def callback_unpressed_del(self, func):
|
||||
self._callback_del("unpressed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_button", Button)
|
|
@ -1,139 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from datetime import date
|
||||
|
||||
cdef class CalendarMark(object):
|
||||
cdef Elm_Calendar_Mark *obj
|
||||
|
||||
def __init__(self, evasObject cal, mark_type, mark_time, repeat):
|
||||
cdef tm time
|
||||
tmtup = mark_time.timetuple()
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
self.obj = elm_calendar_mark_add(cal.obj, _cfruni(mark_type), &time, repeat)
|
||||
|
||||
def delete(self):
|
||||
elm_calendar_mark_del(self.obj)
|
||||
|
||||
|
||||
cdef class Calendar(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_calendar_add(parent.obj))
|
||||
|
||||
property weekdays_names:
|
||||
def __get__(self):
|
||||
cdef const_char_ptr *lst
|
||||
cdef const_char_ptr weekday
|
||||
ret = []
|
||||
lst = elm_calendar_weekdays_names_get(self.obj)
|
||||
for i from 0 <= i < 7:
|
||||
weekday = lst[i]
|
||||
if weekday != NULL:
|
||||
ret.append(_ctouni(weekday))
|
||||
return ret
|
||||
|
||||
def __set__(self, weekdays):
|
||||
cdef int i, day_len
|
||||
cdef char **days, *weekday
|
||||
days = <char **>PyMem_Malloc(7 * sizeof(char*))
|
||||
for i from 0 <= i < 7:
|
||||
weekday = _fruni(weekdays[i])
|
||||
day_len = len(weekday)
|
||||
days[i] = <char *>PyMem_Malloc(day_len + 1)
|
||||
memcpy(days[i], weekday, day_len + 1)
|
||||
elm_calendar_weekdays_names_set(self.obj, <const_char_ptr *>days)
|
||||
|
||||
property min_max_year:
|
||||
def __get__(self):
|
||||
cdef int min, max
|
||||
elm_calendar_min_max_year_get(self.obj, &min, &max)
|
||||
return (min, max)
|
||||
def __set__(self, value):
|
||||
cdef int min, max
|
||||
min, max = value
|
||||
elm_calendar_min_max_year_set(self.obj, min, max)
|
||||
|
||||
property select_mode:
|
||||
def __get__(self):
|
||||
return elm_calendar_select_mode_get(self.obj)
|
||||
def __set__(self, mode):
|
||||
elm_calendar_select_mode_set(self.obj, mode)
|
||||
|
||||
property selected_time:
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_calendar_selected_time_get(self.obj, &time)
|
||||
ret = date( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday)
|
||||
return ret
|
||||
|
||||
def __set__(self, selected_time):
|
||||
cdef tm time
|
||||
tmtup = selected_time.timetuple()
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_calendar_selected_time_set(self.obj, &time)
|
||||
|
||||
def format_function_set(self, format_func):
|
||||
pass
|
||||
#elm_calendar_format_function_set(self.obj, format_func)
|
||||
|
||||
def mark_add(self, mark_type, mark_time, repeat):
|
||||
return CalendarMark(self, mark_type, mark_time, repeat)
|
||||
|
||||
property marks:
|
||||
#def __get__(self):
|
||||
#const_Eina_List *elm_calendar_marks_get(self.obj)
|
||||
#def __set__(self, value):
|
||||
def __del__(self):
|
||||
elm_calendar_marks_clear(self.obj)
|
||||
|
||||
def marks_draw(self):
|
||||
elm_calendar_marks_draw(self.obj)
|
||||
|
||||
property interval:
|
||||
def __get__(self):
|
||||
return elm_calendar_interval_get(self.obj)
|
||||
def __set__(self, interval):
|
||||
elm_calendar_interval_set(self.obj, interval)
|
||||
|
||||
property first_day_of_week:
|
||||
def __get__(self):
|
||||
return elm_calendar_first_day_of_week_get(self.obj)
|
||||
def __set__(self, day):
|
||||
elm_calendar_first_day_of_week_set(self.obj, day)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_calendar", Calendar)
|
|
@ -1,116 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Clock(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_clock_add(parent.obj))
|
||||
|
||||
def time_set(self, hours, minutes, seconds):
|
||||
elm_clock_time_set(self.obj, hours, minutes, seconds)
|
||||
|
||||
def time_get(self):
|
||||
cdef int hrs, min, sec
|
||||
|
||||
elm_clock_time_get(self.obj, &hrs, &min, &sec)
|
||||
return (hrs, min, sec)
|
||||
|
||||
property time:
|
||||
def __get__(self):
|
||||
cdef int hrs, min, sec
|
||||
elm_clock_time_get(self.obj, &hrs, &min, &sec)
|
||||
return (hrs, min, sec)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int hrs, min, sec
|
||||
hrs, min, sec = value
|
||||
elm_clock_time_set(self.obj, hrs, min, sec)
|
||||
|
||||
def edit_set(self, edit):
|
||||
elm_clock_edit_set(self.obj, edit)
|
||||
|
||||
def edit_get(self, edit):
|
||||
return bool(elm_clock_edit_get(self.obj))
|
||||
|
||||
property edit:
|
||||
def __get__(self):
|
||||
return bool(elm_clock_edit_get(self.obj))
|
||||
|
||||
def __set__(self, edit):
|
||||
elm_clock_edit_set(self.obj, edit)
|
||||
|
||||
def edit_mode_set(self, mode):
|
||||
elm_clock_edit_mode_set(self.obj, mode)
|
||||
|
||||
def edit_mode_get(self):
|
||||
return elm_clock_edit_mode_get(self.obj)
|
||||
|
||||
property edit_mode:
|
||||
def __get__(self):
|
||||
return elm_clock_edit_mode_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_clock_edit_mode_set(self.obj, mode)
|
||||
|
||||
def show_am_pm_set(self, am_pm):
|
||||
elm_clock_show_am_pm_set(self.obj, am_pm)
|
||||
|
||||
def show_am_pm_get(self):
|
||||
return elm_clock_show_am_pm_get(self.obj)
|
||||
|
||||
property show_am_pm:
|
||||
def __get__(self):
|
||||
return elm_clock_show_am_pm_get(self.obj)
|
||||
|
||||
def __set__(self, am_pm):
|
||||
elm_clock_show_am_pm_set(self.obj, am_pm)
|
||||
|
||||
def show_seconds_set(self, seconds):
|
||||
elm_clock_show_seconds_set(self.obj, seconds)
|
||||
|
||||
def show_seconds_get(self):
|
||||
return elm_clock_show_seconds_get(self.obj)
|
||||
|
||||
property show_seconds:
|
||||
def __get__(self):
|
||||
return elm_clock_show_seconds_get(self.obj)
|
||||
|
||||
def __set__(self, seconds):
|
||||
elm_clock_show_seconds_set(self.obj, seconds)
|
||||
|
||||
def first_interval_set(self, interval):
|
||||
elm_clock_first_interval_set(self.obj, interval)
|
||||
|
||||
def first_interval_get(self):
|
||||
return elm_clock_first_interval_get(self.obj)
|
||||
|
||||
property first_interval:
|
||||
def __get__(self):
|
||||
return elm_clock_first_interval_get(self.obj)
|
||||
|
||||
def __set__(self, interval):
|
||||
elm_clock_first_interval_set(self.obj, interval)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_clock", Clock)
|
|
@ -1,311 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Configuration(object):
|
||||
|
||||
def save(self):
|
||||
return bool(elm_config_save())
|
||||
|
||||
def reload(self):
|
||||
elm_config_reload()
|
||||
|
||||
def all_flush(self):
|
||||
elm_config_all_flush()
|
||||
|
||||
property profile:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_config_profile_get())
|
||||
def __set__(self, profile):
|
||||
elm_config_profile_set(_cfruni(profile))
|
||||
|
||||
def profile_dir_get(self, profile, is_user):
|
||||
return _ctouni(elm_config_profile_dir_get(_cfruni(profile), is_user))
|
||||
|
||||
property profile_list:
|
||||
def __get__(self):
|
||||
cdef Eina_List *lst = elm_config_profile_list_get()
|
||||
return tuple(_strings_to_python(lst))
|
||||
|
||||
property scroll_bounce_enabled:
|
||||
def __get__(self):
|
||||
return bool(elm_config_scroll_bounce_enabled_get())
|
||||
def __set__(self, enabled):
|
||||
elm_config_scroll_bounce_enabled_set(enabled)
|
||||
|
||||
property scroll_bounce_friction:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_bounce_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_bounce_friction_set(friction)
|
||||
|
||||
property scroll_page_scroll_friction:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_page_scroll_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_page_scroll_friction_set(friction)
|
||||
|
||||
property scroll_bring_in_scroll_friction:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_bring_in_scroll_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_bring_in_scroll_friction_set(friction)
|
||||
|
||||
property scroll_zoom_friction:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_zoom_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_zoom_friction_set(friction)
|
||||
|
||||
property scroll_thumbscroll_enabled:
|
||||
def __get__(self):
|
||||
return bool(elm_config_scroll_thumbscroll_enabled_get())
|
||||
def __set__(self, enabled):
|
||||
elm_config_scroll_thumbscroll_enabled_set(enabled)
|
||||
|
||||
property scroll_thumbscroll_threshold:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_threshold_get()
|
||||
def __set__(self, threshold):
|
||||
elm_config_scroll_thumbscroll_threshold_set(threshold)
|
||||
|
||||
property scroll_thumbscroll_momentum_threshold:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_momentum_threshold_get()
|
||||
def __set__(self, threshold):
|
||||
elm_config_scroll_thumbscroll_momentum_threshold_set(threshold)
|
||||
|
||||
property scroll_thumbscroll_friction:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_thumbscroll_friction_set(friction)
|
||||
|
||||
property scroll_thumbscroll_border_friction:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_border_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_thumbscroll_border_friction_set(friction)
|
||||
|
||||
property scroll_thumbscroll_sensitivity_friction:
|
||||
def __get__(self):
|
||||
return elm_config_scroll_thumbscroll_sensitivity_friction_get()
|
||||
def __set__(self, friction):
|
||||
elm_config_scroll_thumbscroll_sensitivity_friction_set(friction)
|
||||
|
||||
|
||||
property longpress_timeout:
|
||||
def __get__(self):
|
||||
return elm_config_longpress_timeout_get()
|
||||
def __set__(self, longpress_timeout):
|
||||
elm_config_longpress_timeout_set(longpress_timeout)
|
||||
|
||||
property tooltip_delay:
|
||||
def __get__(self):
|
||||
return elm_config_tooltip_delay_get()
|
||||
def __set__(self, delay):
|
||||
elm_config_tooltip_delay_set(delay)
|
||||
|
||||
property cursor_engine_only:
|
||||
def __get__(self):
|
||||
return elm_config_cursor_engine_only_get()
|
||||
def __set__(self, engine_only):
|
||||
elm_config_cursor_engine_only_set(engine_only)
|
||||
|
||||
property scale:
|
||||
def __get__(self):
|
||||
return elm_config_scale_get()
|
||||
def __set__(self, scale):
|
||||
elm_config_scale_set(scale)
|
||||
|
||||
property password_show_last:
|
||||
def __get__(self):
|
||||
return elm_config_password_show_last_get()
|
||||
def __set__(self, password_show_last):
|
||||
elm_config_password_show_last_set(password_show_last)
|
||||
|
||||
property password_show_last_timeout:
|
||||
def __get__(self):
|
||||
return elm_config_password_show_last_timeout_get()
|
||||
def __set__(self, password_show_last_timeout):
|
||||
elm_config_password_show_last_timeout_set(password_show_last_timeout)
|
||||
|
||||
property engine:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_config_engine_get())
|
||||
def __set__(self, engine):
|
||||
elm_config_engine_set(_cfruni(engine))
|
||||
|
||||
property preferred_engine:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_config_preferred_engine_get())
|
||||
def __set__(self, engine):
|
||||
elm_config_preferred_engine_set(_cfruni(engine))
|
||||
|
||||
property text_classes_list:
|
||||
def __get__(self):
|
||||
cdef Eina_List *lst
|
||||
cdef Elm_Text_Class *data
|
||||
cdef const_char_ptr name, desc
|
||||
ret = []
|
||||
lst = elm_config_text_classes_list_get()
|
||||
while lst:
|
||||
data = <Elm_Text_Class *>lst.data
|
||||
if data != NULL:
|
||||
name = data.name
|
||||
desc = data.desc
|
||||
ret.append((_ctouni(name), _ctouni(desc)))
|
||||
lst = lst.next
|
||||
return ret
|
||||
|
||||
property font_overlay_list:
|
||||
def __get__(self):
|
||||
cdef const_Eina_List *lst
|
||||
cdef Elm_Font_Overlay *data
|
||||
cdef const_char_ptr text_class, font
|
||||
cdef Evas_Font_Size size
|
||||
ret = []
|
||||
lst = elm_config_font_overlay_list_get()
|
||||
while lst:
|
||||
data = <Elm_Font_Overlay *>lst.data
|
||||
if data != NULL:
|
||||
text_class = data.text_class
|
||||
font = data.font
|
||||
size = data.size
|
||||
ret.append((_ctouni(text_class), _ctouni(font), size))
|
||||
lst = lst.next
|
||||
return ret
|
||||
|
||||
def font_overlay_set(self, text_class, font, size):
|
||||
elm_config_font_overlay_set(_cfruni(text_class), _cfruni(font), size)
|
||||
|
||||
def font_overlay_unset(self, text_class):
|
||||
elm_config_font_overlay_unset(_cfruni(text_class))
|
||||
|
||||
def font_overlay_apply(self):
|
||||
elm_config_font_overlay_apply()
|
||||
|
||||
property finger_size:
|
||||
def __get__(self):
|
||||
return elm_config_finger_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_finger_size_set(size)
|
||||
|
||||
property cache_flush_interval:
|
||||
def __get__(self):
|
||||
return elm_config_cache_flush_interval_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_flush_interval_set(size)
|
||||
|
||||
property cache_flush_enabled:
|
||||
def __get__(self):
|
||||
return bool(elm_config_cache_flush_enabled_get())
|
||||
def __set__(self, enabled):
|
||||
elm_config_cache_flush_enabled_set(enabled)
|
||||
|
||||
property cache_font_cache_size:
|
||||
def __get__(self):
|
||||
return elm_config_cache_font_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_font_cache_size_set(size)
|
||||
|
||||
property cache_image_cache_size:
|
||||
def __get__(self):
|
||||
return elm_config_cache_image_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_image_cache_size_set(size)
|
||||
|
||||
|
||||
property cache_edje_file_cache_size:
|
||||
def __get__(self):
|
||||
return elm_config_cache_edje_file_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_edje_file_cache_size_set(size)
|
||||
|
||||
property cache_edje_collection_cache_size:
|
||||
def __get__(self):
|
||||
return elm_config_cache_edje_collection_cache_size_get()
|
||||
def __set__(self, size):
|
||||
elm_config_cache_edje_collection_cache_size_set(size)
|
||||
|
||||
property focus_highlight_enabled:
|
||||
def __get__(self):
|
||||
return bool(elm_config_focus_highlight_enabled_get())
|
||||
def __set__(self, enable):
|
||||
elm_config_focus_highlight_enabled_set(enable)
|
||||
|
||||
property focus_highlight_animate:
|
||||
def __get__(self):
|
||||
return bool(elm_config_focus_highlight_animate_get())
|
||||
def __set__(self, animate):
|
||||
elm_config_focus_highlight_animate_set(animate)
|
||||
|
||||
property mirrored:
|
||||
def __get__(self):
|
||||
return bool(elm_config_mirrored_get())
|
||||
def __set__(self, mirrored):
|
||||
elm_config_mirrored_set(mirrored)
|
||||
|
||||
|
||||
def config_finger_size_get():
|
||||
return elm_config_finger_size_get()
|
||||
|
||||
def config_finger_size_set(size):
|
||||
elm_config_finger_size_set(size)
|
||||
|
||||
def config_tooltip_delay_get():
|
||||
return elm_config_tooltip_delay_get()
|
||||
|
||||
def config_tooltip_delay_set(delay):
|
||||
elm_config_tooltip_delay_set(delay)
|
||||
|
||||
def focus_highlight_enabled_get():
|
||||
return elm_config_focus_highlight_enabled_get()
|
||||
|
||||
def focus_highlight_enabled_set(enabled):
|
||||
elm_config_focus_highlight_enabled_set(enabled)
|
||||
|
||||
def focus_highlight_animate_get():
|
||||
return elm_config_focus_highlight_animate_get()
|
||||
|
||||
def focus_highlight_animate_set(animate):
|
||||
elm_config_focus_highlight_animate_set(animate)
|
||||
|
||||
def preferred_engine_get():
|
||||
return _ctouni(elm_config_preferred_engine_get())
|
||||
|
||||
def preferred_engine_set(engine):
|
||||
elm_config_preferred_engine_set(engine)
|
||||
|
||||
def engine_get():
|
||||
return _ctouni(elm_config_engine_get())
|
||||
|
||||
def engine_set(engine):
|
||||
elm_config_engine_set(_cfruni(engine))
|
||||
|
||||
def scale_get():
|
||||
return elm_config_scale_get()
|
||||
|
||||
def scale_set(scale):
|
||||
elm_config_scale_set(scale)
|
||||
|
||||
def cursor_engine_only_get():
|
||||
return elm_config_cursor_engine_only_get()
|
||||
|
||||
def cursor_engine_only_set(engine_only):
|
||||
elm_config_cursor_engine_only_set(engine_only)
|
||||
|
|
@ -1,142 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from datetime import datetime
|
||||
|
||||
|
||||
cdef class Datetime(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_datetime_add(parent.obj))
|
||||
|
||||
property format:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_datetime_format_get(self.obj))
|
||||
def __set__(self, fmt):
|
||||
elm_datetime_format_set(self.obj, _cfruni(fmt))
|
||||
|
||||
property value_max:
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_datetime_value_max_get(self.obj, &time)
|
||||
ret = datetime( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday,
|
||||
time.tm_hour,
|
||||
time.tm_min,
|
||||
time.tm_sec)
|
||||
return ret
|
||||
|
||||
def __set__(self, newtime):
|
||||
cdef tm time
|
||||
tmtup = newtime.timetuple()
|
||||
time.tm_sec = tmtup.tm_sec
|
||||
time.tm_min = tmtup.tm_min
|
||||
time.tm_hour = tmtup.tm_hour
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_datetime_value_max_set(self.obj, &time)
|
||||
|
||||
property value_min:
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_datetime_value_min_get(self.obj, &time)
|
||||
ret = datetime( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday,
|
||||
time.tm_hour,
|
||||
time.tm_min,
|
||||
time.tm_sec)
|
||||
return ret
|
||||
|
||||
def __set__(self, newtime):
|
||||
cdef tm time
|
||||
tmtup = newtime.timetuple()
|
||||
time.tm_sec = tmtup.tm_sec
|
||||
time.tm_min = tmtup.tm_min
|
||||
time.tm_hour = tmtup.tm_hour
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_datetime_value_min_set(self.obj, &time)
|
||||
|
||||
property field_limit:
|
||||
def __get__(self):
|
||||
cdef int min, max
|
||||
cdef Elm_Datetime_Field_Type fieldtype = ELM_DATETIME_YEAR
|
||||
elm_datetime_field_limit_get(self.obj, fieldtype, &min, &max)
|
||||
return (fieldtype, min, max)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef int min, max
|
||||
cdef Elm_Datetime_Field_Type fieldtype
|
||||
min, max, fieldtype = value
|
||||
elm_datetime_field_limit_set(self.obj, fieldtype, min, max)
|
||||
|
||||
property value:
|
||||
def __get__(self):
|
||||
cdef tm time
|
||||
elm_datetime_value_get(self.obj, &time)
|
||||
ret = datetime( time.tm_year + 1900,
|
||||
time.tm_mon + 1,
|
||||
time.tm_mday,
|
||||
time.tm_hour,
|
||||
time.tm_min,
|
||||
time.tm_sec)
|
||||
return ret
|
||||
|
||||
def __set__(self, newtime):
|
||||
cdef tm time
|
||||
tmtup = newtime.timetuple()
|
||||
time.tm_sec = tmtup.tm_sec
|
||||
time.tm_min = tmtup.tm_min
|
||||
time.tm_hour = tmtup.tm_hour
|
||||
time.tm_mday = tmtup.tm_mday
|
||||
time.tm_mon = tmtup.tm_mon - 1
|
||||
time.tm_year = tmtup.tm_year - 1900
|
||||
time.tm_wday = tmtup.tm_wday
|
||||
time.tm_yday = tmtup.tm_yday
|
||||
time.tm_isdst = tmtup.tm_isdst
|
||||
elm_datetime_value_set(self.obj, &time)
|
||||
|
||||
def field_visible_get(self, fieldtype):
|
||||
return bool(elm_datetime_field_visible_get(self.obj, fieldtype))
|
||||
|
||||
def field_visible_set(self, fieldtype, visible):
|
||||
elm_datetime_field_visible_set(self.obj, fieldtype, visible)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
def callback_languge_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_datetime", Datetime)
|
|
@ -1,61 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Dayselector(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_dayselector_add(parent.obj))
|
||||
|
||||
def day_selected_set(self, day, selected):
|
||||
elm_dayselector_day_selected_set(self.obj, day, selected)
|
||||
|
||||
def day_selected_get(self, day):
|
||||
return bool(elm_dayselector_day_selected_get(self.obj, day))
|
||||
|
||||
property week_start:
|
||||
def __get__(self):
|
||||
return elm_dayselector_week_start_get(self.obj)
|
||||
def __set__(self, day):
|
||||
elm_dayselector_week_start_set(self.obj, day)
|
||||
|
||||
property weekend_start:
|
||||
def __get__(self):
|
||||
return elm_dayselector_weekend_start_get(self.obj)
|
||||
def __set__(self, day):
|
||||
elm_dayselector_weekend_start_set(self.obj, day)
|
||||
|
||||
property weekend_length:
|
||||
def __get__(self):
|
||||
return elm_dayselector_weekend_length_get(self.obj)
|
||||
def __set__(self, length):
|
||||
elm_dayselector_weekend_length_set(self.obj, length)
|
||||
|
||||
def callback_dayselector_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("dayselector,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_dayselector_changed_del(self, func):
|
||||
self._callback_del("dayselector,changed", func)
|
||||
|
||||
def callback_language_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_dayselector", Dayselector)
|
|
@ -1,168 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class DiskselectorItem(ObjectItem):
|
||||
|
||||
def __init__(self, evasObject diskselector, label, evasObject icon=None, callback=None, *args, **kargs):
|
||||
cdef Evas_Object* icon_obj = NULL
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
|
||||
if icon is not None:
|
||||
icon_obj = icon.obj
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
self.params = (callback, args, kargs)
|
||||
|
||||
item = elm_diskselector_item_append(diskselector.obj, _cfruni(label), icon_obj, cb, <void*>self)
|
||||
|
||||
if item != NULL:
|
||||
self._set_obj(item)
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
property selected:
|
||||
def __set__(self, selected):
|
||||
elm_diskselector_item_selected_set(self.item, selected)
|
||||
def __get__(self):
|
||||
return bool(elm_diskselector_item_selected_get(self.item))
|
||||
|
||||
property prev:
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_item_prev_get(self.item)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
property next:
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_item_next_get(self.item)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
|
||||
cdef class Diskselector(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_diskselector_add(parent.obj))
|
||||
|
||||
property round_enabled:
|
||||
def __set__(self, enabled):
|
||||
elm_diskselector_round_enabled_set(self.obj, enabled)
|
||||
def __get__(self):
|
||||
return bool(elm_diskselector_round_enabled_get(self.obj))
|
||||
|
||||
property side_text_max_length:
|
||||
def __get__(self):
|
||||
return elm_diskselector_side_text_max_length_get(self.obj)
|
||||
def __set__(self, length):
|
||||
elm_diskselector_side_text_max_length_set(self.obj, length)
|
||||
|
||||
property display_item_num:
|
||||
def __set__(self, num):
|
||||
elm_diskselector_display_item_num_set(self.obj, num)
|
||||
def __get__(self):
|
||||
return elm_diskselector_display_item_num_get(self.obj)
|
||||
|
||||
property bounce:
|
||||
def __set__(self, bounce):
|
||||
h_bounce, v_bounce = bounce
|
||||
elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
|
||||
def __get__(self):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
|
||||
return (h_bounce, v_bounce)
|
||||
|
||||
property scroller_policy:
|
||||
def __get__(self):
|
||||
cdef Elm_Scroller_Policy h_policy, v_policy
|
||||
elm_scroller_policy_get(self.obj, &h_policy, &v_policy)
|
||||
return (h_policy, v_policy)
|
||||
def __set__(self, policy):
|
||||
h_policy, v_policy = policy
|
||||
elm_scroller_policy_set(self.obj, h_policy, v_policy)
|
||||
|
||||
def clear(self):
|
||||
elm_diskselector_clear(self.obj)
|
||||
|
||||
property items:
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it
|
||||
cdef const_Eina_List *lst
|
||||
|
||||
lst = elm_diskselector_items_get(self.obj)
|
||||
ret = []
|
||||
ret_append = ret.append
|
||||
while lst:
|
||||
it = <Elm_Object_Item *>lst.data
|
||||
lst = lst.next
|
||||
o = _object_item_to_python(it)
|
||||
if o is not None:
|
||||
ret_append(o)
|
||||
return ret
|
||||
|
||||
def item_append(self, label, evasObject icon = None, callback = None, *args, **kwargs):
|
||||
return DiskselectorItem(self, label, icon, callback, *args, **kwargs)
|
||||
|
||||
property selected_item:
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_selected_item_get(self.obj)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
property first_item:
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_first_item_get(self.obj)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
property last_item:
|
||||
def __get__(self):
|
||||
cdef Elm_Object_Item *it = elm_diskselector_last_item_get(self.obj)
|
||||
return _object_item_to_python(it)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("selected", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_scroll_anim_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_start_del(self, func):
|
||||
self._callback_del("scroll,anim,start", func)
|
||||
|
||||
def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_stop_del(self, func):
|
||||
self._callback_del("scroll,anim,stop", func)
|
||||
|
||||
def callback_scroll_drag_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_start_del(self, func):
|
||||
self._callback_del("scroll,drag,start", func)
|
||||
|
||||
def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_stop_del(self, func):
|
||||
self._callback_del("scroll,drag,stop", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_diskselector", Diskselector)
|
|
@ -1,683 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
def Entry_markup_to_utf8(str):
|
||||
cdef const_char_ptr string
|
||||
string = elm_entry_markup_to_utf8(str)
|
||||
if string == NULL:
|
||||
return None
|
||||
return string
|
||||
|
||||
def Entry_utf8_to_markup(str):
|
||||
cdef const_char_ptr string
|
||||
string = elm_entry_utf8_to_markup(str)
|
||||
if string == NULL:
|
||||
return None
|
||||
return string
|
||||
|
||||
class EntryAnchorInfo:
|
||||
def __init__(self):
|
||||
self.name = None
|
||||
self.button = 0
|
||||
self.x = 0
|
||||
self.y = 0
|
||||
self.w = 0
|
||||
self.h = 0
|
||||
|
||||
class EntryAnchorHoverInfo:
|
||||
def __init__(self):
|
||||
self.anchor_info = None
|
||||
self.hover = None
|
||||
self.hover_parent = (0, 0, 0, 0)
|
||||
self.hover_left = False
|
||||
self.hover_right = False
|
||||
self.hover_top = False
|
||||
self.hover_bottom = False
|
||||
|
||||
def _entryanchor_conv(long addr):
|
||||
cdef Elm_Entry_Anchor_Info *ei = <Elm_Entry_Anchor_Info *>addr
|
||||
eai = EntryAnchorInfo()
|
||||
eai.name = ei.name
|
||||
eai.button = ei.button
|
||||
eai.x = ei.x
|
||||
eai.y = ei.y
|
||||
eai.w = ei.w
|
||||
eai.h = ei.h
|
||||
return eai
|
||||
|
||||
def _entryanchorhover_conv(long addr):
|
||||
cdef Elm_Entry_Anchor_Hover_Info *ehi = <Elm_Entry_Anchor_Hover_Info *>addr
|
||||
eahi = EntryAnchorHoverInfo()
|
||||
eahi.anchor_info = <object>ehi.anchor_info
|
||||
eahi.hover = Hover(None, <object>ehi.hover)
|
||||
eahi.hover_parent = (ehi.hover_parent.x, ehi.hover_parent.y,
|
||||
ehi.hover_parent.w, ehi.hover_parent.h)
|
||||
eahi.hover_left = ehi.hover_left
|
||||
eahi.hover_right = ehi.hover_right
|
||||
eahi.hover_top = ehi.hover_top
|
||||
eahi.hover_bottom = ehi.hover_bottom
|
||||
return eahi
|
||||
|
||||
cdef class Entry(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_entry_add(parent.obj))
|
||||
|
||||
def single_line_set(self, single_line):
|
||||
elm_entry_single_line_set(self.obj, single_line)
|
||||
|
||||
def single_line_get(self):
|
||||
return bool(elm_entry_single_line_get(self.obj))
|
||||
|
||||
property single_line:
|
||||
def __get__(self):
|
||||
return bool(elm_entry_single_line_get(self.obj))
|
||||
|
||||
def __set__(self, single_line):
|
||||
elm_entry_single_line_set(self.obj, single_line)
|
||||
|
||||
def password_set(self, password):
|
||||
elm_entry_password_set(self.obj, password)
|
||||
|
||||
def password_get(self):
|
||||
return bool(elm_entry_password_get(self.obj))
|
||||
|
||||
property password:
|
||||
def __get__(self):
|
||||
return bool(elm_entry_password_get(self.obj))
|
||||
|
||||
def __set__(self, password):
|
||||
elm_entry_password_set(self.obj, password)
|
||||
|
||||
def entry_set(self, entry):
|
||||
elm_entry_entry_set(self.obj, _cfruni(entry))
|
||||
|
||||
def entry_get(self):
|
||||
return _ctouni(elm_entry_entry_get(self.obj))
|
||||
|
||||
property entry:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_entry_entry_get(self.obj))
|
||||
|
||||
def __set__(self, entry):
|
||||
elm_entry_entry_set(self.obj, _cfruni(entry))
|
||||
|
||||
def entry_append(self, text):
|
||||
elm_entry_entry_append(self.obj, _cfruni(text))
|
||||
|
||||
def is_empty(self):
|
||||
return elm_entry_is_empty(self.obj)
|
||||
|
||||
def selection_get(self):
|
||||
return _ctouni(elm_entry_selection_get(self.obj))
|
||||
|
||||
property selection:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_entry_selection_get(self.obj))
|
||||
|
||||
def textblock_get(self):
|
||||
cdef Evas_Object *o
|
||||
o = elm_entry_textblock_get(self.obj)
|
||||
return object_from_instance(o)
|
||||
|
||||
property textblock:
|
||||
def __get__(self):
|
||||
cdef Evas_Object *o
|
||||
o = elm_entry_textblock_get(self.obj)
|
||||
return object_from_instance(o)
|
||||
|
||||
def calc_force(self):
|
||||
elm_entry_calc_force(self.obj)
|
||||
|
||||
def entry_insert(self, entry):
|
||||
elm_entry_entry_insert(self.obj, _cfruni(entry))
|
||||
|
||||
def line_wrap_set(self, wrap):
|
||||
elm_entry_line_wrap_set(self.obj, wrap)
|
||||
|
||||
def line_wrap_get(self):
|
||||
return elm_entry_line_wrap_get(self.obj)
|
||||
|
||||
property line_wrap:
|
||||
def __get__(self):
|
||||
return elm_entry_line_wrap_get(self.obj)
|
||||
|
||||
def __set__(self, wrap):
|
||||
elm_entry_line_wrap_set(self.obj, wrap)
|
||||
|
||||
def editable_set(self, editable):
|
||||
elm_entry_editable_set(self.obj, editable)
|
||||
|
||||
def editable_get(self):
|
||||
return bool(elm_entry_editable_get(self.obj))
|
||||
|
||||
property editable:
|
||||
def __get__(self):
|
||||
return bool(elm_entry_editable_get(self.obj))
|
||||
|
||||
def __set__(self, editable):
|
||||
elm_entry_editable_set(self.obj, editable)
|
||||
|
||||
def select_none(self):
|
||||
elm_entry_select_none(self.obj)
|
||||
|
||||
def select_all(self):
|
||||
elm_entry_select_all(self.obj)
|
||||
|
||||
def cursor_next(self):
|
||||
|
||||
return bool(elm_entry_cursor_next(self.obj))
|
||||
|
||||
def cursor_prev(self):
|
||||
return bool(elm_entry_cursor_prev(self.obj))
|
||||
|
||||
def cursor_up(self):
|
||||
return bool(elm_entry_cursor_up(self.obj))
|
||||
|
||||
def cursor_down(self):
|
||||
return bool(elm_entry_cursor_down(self.obj))
|
||||
|
||||
def cursor_begin_set(self):
|
||||
elm_entry_cursor_begin_set(self.obj)
|
||||
|
||||
def cursor_end_set(self):
|
||||
elm_entry_cursor_end_set(self.obj)
|
||||
|
||||
def cursor_line_begin_set(self):
|
||||
elm_entry_cursor_line_begin_set(self.obj)
|
||||
|
||||
def cursor_line_end_set(self):
|
||||
elm_entry_cursor_line_end_set(self.obj)
|
||||
|
||||
def cursor_selection_begin(self):
|
||||
elm_entry_cursor_selection_begin(self.obj)
|
||||
|
||||
def cursor_selection_end(self):
|
||||
elm_entry_cursor_selection_end(self.obj)
|
||||
|
||||
def cursor_is_format_get(self):
|
||||
return bool(elm_entry_cursor_is_format_get(self.obj))
|
||||
|
||||
def cursor_is_visible_format_get(self):
|
||||
return bool(elm_entry_cursor_is_visible_format_get(self.obj))
|
||||
|
||||
def cursor_content_get(self):
|
||||
return elm_entry_cursor_content_get(self.obj)
|
||||
|
||||
def cursor_geometry_get(self):
|
||||
cdef Evas_Coord x, y, w, h
|
||||
#TODO: Check return status for success
|
||||
elm_entry_cursor_geometry_get(self.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
def cursor_pos_set(self, pos):
|
||||
elm_entry_cursor_pos_set(self.obj, pos)
|
||||
|
||||
def cursor_pos_get(self):
|
||||
return elm_entry_cursor_pos_get(self.obj)
|
||||
|
||||
property cursor_pos:
|
||||
def __get__(self):
|
||||
return elm_entry_cursor_pos_get(self.obj)
|
||||
|
||||
def __set__(self, pos):
|
||||
elm_entry_cursor_pos_set(self.obj, pos)
|
||||
|
||||
def selection_cut(self):
|
||||
elm_entry_selection_cut(self.obj)
|
||||
|
||||
def selection_copy(self):
|
||||
elm_entry_selection_copy(self.obj)
|
||||
|
||||
def selection_paste(self):
|
||||
elm_entry_selection_paste(self.obj)
|
||||
|
||||
def context_menu_clear(self):
|
||||
elm_entry_context_menu_clear(self.obj)
|
||||
|
||||
# TODO XXX
|
||||
# def context_menu_item_add(self, label, icon_file, icon_type, cb, data):
|
||||
#elm_entry_context_menu_item_add(self.obj, label, icon_file, icon_type, func, data);
|
||||
|
||||
def context_menu_disabled_set(self, disabled):
|
||||
elm_entry_context_menu_disabled_set(self.obj, disabled)
|
||||
|
||||
def context_menu_disabled_get(self):
|
||||
return elm_entry_context_menu_disabled_get(self.obj)
|
||||
|
||||
property context_menu_disabled:
|
||||
def __get__(self):
|
||||
return elm_entry_context_menu_disabled_get(self.obj)
|
||||
|
||||
def __set__(self, disabled):
|
||||
elm_entry_context_menu_disabled_set(self.obj, disabled)
|
||||
|
||||
|
||||
# elm_entry_item_provider_append() # TODO XXX
|
||||
|
||||
# elm_entry_item_provider_prepend() # TODO XXX
|
||||
|
||||
# elm_entry_item_provider_remove() # TODO XXX
|
||||
|
||||
# elm_entry_markup_filter_append() # TODO XXX
|
||||
|
||||
# elm_entry_markup_filter_prepend() # TODO XXX
|
||||
|
||||
# elm_entry_markup_filter_remove() # TODO XXX
|
||||
|
||||
markup_to_utf8 = staticmethod(Entry_markup_to_utf8)
|
||||
|
||||
utf8_to_markup = staticmethod(Entry_utf8_to_markup)
|
||||
|
||||
def file_set(self, file, format):
|
||||
return bool(elm_entry_file_set(self.obj, _cfruni(file), format))
|
||||
|
||||
def file_get(self):
|
||||
cdef const_char_ptr file
|
||||
cdef Elm_Text_Format format
|
||||
|
||||
elm_entry_file_get(self.obj, &file, &format)
|
||||
return (_ctouni(file), format)
|
||||
|
||||
property file:
|
||||
def __get__(self):
|
||||
cdef const_char_ptr file
|
||||
cdef Elm_Text_Format format
|
||||
elm_entry_file_get(self.obj, &file, &format)
|
||||
return (_ctouni(file), format)
|
||||
|
||||
def __set__(self, value):
|
||||
file, format = value
|
||||
elm_entry_file_set(self.obj, _cfruni(file), format)
|
||||
|
||||
def file_save(self):
|
||||
elm_entry_file_save(self.obj)
|
||||
|
||||
def autosave_set(self, autosave):
|
||||
elm_entry_autosave_set(self.obj, autosave)
|
||||
|
||||
def autosave_get(self):
|
||||
return elm_entry_autosave_get(self.obj)
|
||||
|
||||
property autosave:
|
||||
def __get__(self):
|
||||
return elm_entry_autosave_get(self.obj)
|
||||
|
||||
def __set__(self, autosave):
|
||||
elm_entry_autosave_set(self.obj, autosave)
|
||||
|
||||
def scrollable_set(self, scrollable):
|
||||
elm_entry_scrollable_set(self.obj, scrollable)
|
||||
|
||||
def scrollable_get(self):
|
||||
return bool(elm_entry_scrollable_get(self.obj))
|
||||
|
||||
property scrollable:
|
||||
def __get__(self):
|
||||
return bool(elm_entry_scrollable_get(self.obj))
|
||||
|
||||
def __set__(self, scrollable):
|
||||
elm_entry_scrollable_set(self.obj, scrollable)
|
||||
|
||||
def icon_visible_set(self, visible):
|
||||
elm_entry_icon_visible_set(self.obj, visible)
|
||||
|
||||
property icon_visible:
|
||||
def __set__(self, visible):
|
||||
elm_entry_icon_visible_set(self.obj, visible)
|
||||
|
||||
def scrollbar_policy_set(self, Elm_Scroller_Policy h, Elm_Scroller_Policy v):
|
||||
elm_scroller_policy_set(self.obj, h, v)
|
||||
|
||||
property scrollbar_policy:
|
||||
def __set__(self, value):
|
||||
cdef Elm_Scroller_Policy h, v
|
||||
h, v = value
|
||||
elm_scroller_policy_set(self.obj, h, v)
|
||||
|
||||
def bounce_set(self, h_bounce, v_bounce):
|
||||
elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
|
||||
|
||||
def bounce_get(self):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
|
||||
elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
|
||||
return (h_bounce, v_bounce)
|
||||
|
||||
property bounce:
|
||||
def __get__(self):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
|
||||
return (h_bounce, v_bounce)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
h_bounce, v_bounce = value
|
||||
elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
|
||||
|
||||
def input_panel_layout_set(self, layout):
|
||||
elm_entry_input_panel_layout_set(self.obj, layout)
|
||||
|
||||
def input_panel_layout_get(self):
|
||||
return elm_entry_input_panel_layout_get(self.obj)
|
||||
|
||||
property input_panel_layout:
|
||||
def __get__(self):
|
||||
return elm_entry_input_panel_layout_get(self.obj)
|
||||
|
||||
def __set__(self, layout):
|
||||
elm_entry_input_panel_layout_set(self.obj, layout)
|
||||
|
||||
def input_panel_enabled_set(self, enabled):
|
||||
elm_entry_input_panel_enabled_set(self.obj, enabled)
|
||||
|
||||
def input_panel_enabled_get(self):
|
||||
return bool(elm_entry_input_panel_enabled_get(self.obj))
|
||||
|
||||
property input_panel_enabled:
|
||||
def __get__(self):
|
||||
return bool(elm_entry_input_panel_enabled_get(self.obj))
|
||||
|
||||
def __set__(self, enabled):
|
||||
elm_entry_input_panel_enabled_set(self.obj, enabled)
|
||||
|
||||
def input_panel_show(self):
|
||||
elm_entry_input_panel_show(self.obj)
|
||||
|
||||
def input_panel_hide(self):
|
||||
elm_entry_input_panel_hide(self.obj)
|
||||
|
||||
def input_panel_language_set(self, lang):
|
||||
elm_entry_input_panel_language_set(self.obj, lang)
|
||||
|
||||
def input_panel_language_get(self):
|
||||
return elm_entry_input_panel_language_get(self.obj)
|
||||
|
||||
property input_panel_language:
|
||||
def __get__(self):
|
||||
return elm_entry_input_panel_language_get(self.obj)
|
||||
|
||||
def __set__(self, lang):
|
||||
elm_entry_input_panel_language_set(self.obj, lang)
|
||||
|
||||
# TODO XXX elm_entry_input_panel_imdata_set() ??
|
||||
|
||||
# TODO XXX elm_entry_input_panel_imdata_get() ??
|
||||
|
||||
def input_panel_return_key_type_set(self, return_key_type):
|
||||
elm_entry_input_panel_return_key_type_set(self.obj, return_key_type)
|
||||
|
||||
def input_panel_return_key_type_get(self):
|
||||
return elm_entry_input_panel_return_key_type_get(self.obj)
|
||||
|
||||
property input_panel_return_key_type:
|
||||
def __get__(self):
|
||||
return elm_entry_input_panel_return_key_type_get(self.obj)
|
||||
|
||||
def __set__(self, return_key_type):
|
||||
elm_entry_input_panel_return_key_type_set(self.obj, return_key_type)
|
||||
|
||||
def input_panel_return_key_disabled_set(self, disabled):
|
||||
elm_entry_input_panel_return_key_disabled_set(self.obj, disabled)
|
||||
|
||||
def input_panel_return_key_disabled_get(self):
|
||||
return elm_entry_input_panel_return_key_disabled_get(self.obj)
|
||||
|
||||
property input_panel_return_key_disabled:
|
||||
def __get__(self):
|
||||
return elm_entry_input_panel_return_key_disabled_get(self.obj)
|
||||
|
||||
def __set__(self, disabled):
|
||||
elm_entry_input_panel_return_key_disabled_set(self.obj, disabled)
|
||||
|
||||
def input_panel_return_key_autoenabled_set(self, enabled):
|
||||
elm_entry_input_panel_return_key_autoenabled_set(self.obj, enabled)
|
||||
|
||||
property input_panel_return_key_autoenabled:
|
||||
def __set__(self, enabled):
|
||||
elm_entry_input_panel_return_key_autoenabled_set(self.obj, enabled)
|
||||
|
||||
def imf_context_reset(self):
|
||||
elm_entry_imf_context_reset(self.obj)
|
||||
|
||||
def prediction_allow_set(self, allow):
|
||||
elm_entry_prediction_allow_set(self.obj, allow)
|
||||
|
||||
def prediction_allow_get(self):
|
||||
return elm_entry_prediction_allow_get(self.obj)
|
||||
|
||||
property prediction_allow:
|
||||
def __get__(self):
|
||||
return elm_entry_prediction_allow_get(self.obj)
|
||||
|
||||
def __set__(self, allow):
|
||||
elm_entry_prediction_allow_set(self.obj, allow)
|
||||
|
||||
# TODO XXX elm_entry_filter_accept_set()
|
||||
# TODO XXX elm_entry_imf_context_get() ??
|
||||
|
||||
def cnp_mode_set(self, mode):
|
||||
elm_entry_cnp_mode_set(self.obj, mode)
|
||||
|
||||
def cnp_mode_get(self):
|
||||
return elm_entry_cnp_mode_get(self.obj)
|
||||
|
||||
property cnp_mode:
|
||||
def __get__(self):
|
||||
return elm_entry_cnp_mode_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_entry_cnp_mode_set(self.obj, mode)
|
||||
|
||||
def anchor_hover_parent_set(self, evasObject anchor_hover_parent):
|
||||
elm_entry_anchor_hover_parent_set(self.obj, anchor_hover_parent.obj)
|
||||
|
||||
def anchor_hover_parent_get(self):
|
||||
cdef Evas_Object *anchor_hover_parent
|
||||
anchor_hover_parent = elm_entry_anchor_hover_parent_get(self.obj)
|
||||
return object_from_instance(anchor_hover_parent)
|
||||
|
||||
property anchor_hover_parent:
|
||||
def __get__(self):
|
||||
cdef Evas_Object *anchor_hover_parent
|
||||
anchor_hover_parent = elm_entry_anchor_hover_parent_get(self.obj)
|
||||
return object_from_instance(anchor_hover_parent)
|
||||
|
||||
def __set__(self, evasObject anchor_hover_parent):
|
||||
elm_entry_anchor_hover_parent_set(self.obj, anchor_hover_parent.obj)
|
||||
|
||||
def anchor_hover_style_set(self, style):
|
||||
elm_entry_anchor_hover_style_set(self.obj, _cfruni(style))
|
||||
|
||||
def anchor_hover_style_get(self):
|
||||
return _ctouni(elm_entry_anchor_hover_style_get(self.obj))
|
||||
|
||||
property anchor_hover_style:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_entry_anchor_hover_style_get(self.obj))
|
||||
|
||||
def __set__(self, style):
|
||||
elm_entry_anchor_hover_style_set(self.obj, _cfruni(style))
|
||||
|
||||
def anchor_hover_end(self):
|
||||
elm_entry_anchor_hover_end(self.obj)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
def callback_changed_user_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed,user", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_user_del(self, func):
|
||||
self._callback_del("changed,user", func)
|
||||
|
||||
def callback_activated_add(self, func, *args, **kwargs):
|
||||
self._callback_add("activated", func, *args, **kwargs)
|
||||
|
||||
def callback_activated_del(self, func):
|
||||
self._callback_del("activated", func)
|
||||
|
||||
def callback_press_add(self, func, *args, **kwargs):
|
||||
self._callback_add("press", func, *args, **kwargs)
|
||||
|
||||
def callback_press_del(self, func):
|
||||
self._callback_del("press", func)
|
||||
|
||||
def callback_longpressed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("longpressed", func, *args, **kwargs)
|
||||
|
||||
def callback_longpressed_del(self, func):
|
||||
self._callback_del("longpressed", func)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_double_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked,double", func, *args, **kwargs)
|
||||
|
||||
def callback_double_clicked_del(self, func):
|
||||
self._callback_del("clicked,double", func)
|
||||
|
||||
def callback_triple_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked,triple", func, *args, **kwargs)
|
||||
|
||||
def callback_triple_clicked_del(self, func):
|
||||
self._callback_del("clicked,triple", func)
|
||||
|
||||
def callback_focused_add(self, func, *args, **kwargs):
|
||||
self._callback_add("focused", func, *args, **kwargs)
|
||||
|
||||
def callback_focused_del(self, func):
|
||||
self._callback_del("focused", func)
|
||||
|
||||
def callback_unfocused_add(self, func, *args, **kwargs):
|
||||
self._callback_add("unfocused", func, *args, **kwargs)
|
||||
|
||||
def callback_unfocused_del(self, func):
|
||||
self._callback_del("unfocused", func)
|
||||
|
||||
def callback_selection_paste_add(self, func, *args, **kwargs):
|
||||
self._callback_add("selection,paste", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_paste_del(self, func):
|
||||
self._callback_del("selection,paste", func)
|
||||
|
||||
def callback_selection_copy_add(self, func, *args, **kwargs):
|
||||
self._callback_add("selection,copy", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_copy_del(self, func):
|
||||
self._callback_del("selection,copy", func)
|
||||
|
||||
def callback_selection_cut_add(self, func, *args, **kwargs):
|
||||
self._callback_add("selection,cut", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_cut_del(self, func):
|
||||
self._callback_del("selection,cut", func)
|
||||
|
||||
def callback_selection_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("selection,start", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_start_del(self, func):
|
||||
self._callback_del("selection,start", func)
|
||||
|
||||
def callback_selection_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("selection,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_changed_del(self, func):
|
||||
self._callback_del("selection,changed", func)
|
||||
|
||||
def callback_selection_cleared_add(self, func, *args, **kwargs):
|
||||
self._callback_add("selection,cleared", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_cleared_del(self, func):
|
||||
self._callback_del("selection,cleared", func)
|
||||
|
||||
def callback_cursor_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("cursor,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_cursor_changed_del(self, func):
|
||||
self._callback_del("cursor,changed", func)
|
||||
|
||||
def callback_anchor_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("anchor,clicked", _entryanchor_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_anchor_clicked_del(self, func):
|
||||
self._callback_del_full("anchor,clicked", _entryanchor_conv,
|
||||
func)
|
||||
|
||||
def callback_anchor_in_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("anchor,in", _entryanchor_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_anchor_in_del(self, func):
|
||||
self._callback_del_full("anchor,in", _entryanchor_conv,
|
||||
func)
|
||||
|
||||
def callback_anchor_out_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("anchor,out", _entryanchor_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_anchor_out_del(self, func):
|
||||
self._callback_del_full("anchor,out", _entryanchor_conv,
|
||||
func)
|
||||
|
||||
def callback_anchor_up_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("anchor,up", _entryanchor_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_anchor_up_del(self, func):
|
||||
self._callback_del_full("anchor,up", _entryanchor_conv,
|
||||
func)
|
||||
|
||||
def callback_anchor_down_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("anchor,down", _entryanchor_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_anchor_down_del(self, func):
|
||||
self._callback_del_full("anchor,down", _entryanchor_conv,
|
||||
func)
|
||||
|
||||
def callback_anchor_hover_opened_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("anchor,hover,opened", _entryanchorhover_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_anchor_hover_opened_del(self, func):
|
||||
self._callback_del_full("anchor,hover,opened", _entryanchorhover_conv,
|
||||
func)
|
||||
|
||||
def callback_preedit_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("preedit,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_preedit_changed_del(self, func):
|
||||
self._callback_del("preedit,changed", func)
|
||||
|
||||
def callback_language_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_entry", Entry)
|
|
@ -1,138 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Fileselector(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_fileselector_add(parent.obj))
|
||||
|
||||
def is_save_set(self, is_save):
|
||||
elm_fileselector_is_save_set(self.obj, is_save)
|
||||
|
||||
def is_save_get(self):
|
||||
return elm_fileselector_is_save_get(self.obj)
|
||||
|
||||
property is_save:
|
||||
def __get__(self):
|
||||
return elm_fileselector_is_save_get(self.obj)
|
||||
|
||||
def __set__(self, is_save):
|
||||
elm_fileselector_is_save_set(self.obj, is_save)
|
||||
|
||||
def folder_only_set(self, folder_only):
|
||||
elm_fileselector_folder_only_set(self.obj, folder_only)
|
||||
|
||||
def folder_only_get(self):
|
||||
return elm_fileselector_folder_only_get(self.obj)
|
||||
|
||||
property folder_only:
|
||||
def __get__(self):
|
||||
return elm_fileselector_folder_only_get(self.obj)
|
||||
|
||||
def __set__(self, folder_only):
|
||||
elm_fileselector_folder_only_set(self.obj, folder_only)
|
||||
|
||||
def buttons_ok_cancel_set(self, buttons):
|
||||
elm_fileselector_buttons_ok_cancel_set(self.obj, buttons)
|
||||
|
||||
def buttons_ok_cancel_get(self):
|
||||
return elm_fileselector_buttons_ok_cancel_get(self.obj)
|
||||
|
||||
property buttons_ok_cancel:
|
||||
def __get__(self):
|
||||
return elm_fileselector_buttons_ok_cancel_get(self.obj)
|
||||
|
||||
def __set__(self, buttons):
|
||||
elm_fileselector_buttons_ok_cancel_set(self.obj, buttons)
|
||||
|
||||
def expandable_set(self, expand):
|
||||
elm_fileselector_expandable_set(self.obj, expand)
|
||||
|
||||
def expandable_get(self):
|
||||
return elm_fileselector_expandable_get(self.obj)
|
||||
|
||||
property expandable:
|
||||
def __get__(self):
|
||||
return elm_fileselector_expandable_get(self.obj)
|
||||
|
||||
def __set__(self, expand):
|
||||
elm_fileselector_expandable_set(self.obj, expand)
|
||||
|
||||
def path_set(self, path):
|
||||
elm_fileselector_path_set(self.obj, _cfruni(path))
|
||||
|
||||
def path_get(self):
|
||||
return _ctouni(elm_fileselector_path_get(self.obj))
|
||||
|
||||
property path:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_path_get(self.obj))
|
||||
|
||||
def __set__(self, path):
|
||||
elm_fileselector_path_set(self.obj, _cfruni(path))
|
||||
|
||||
def selected_set(self, path):
|
||||
return elm_fileselector_selected_set(self.obj, _cfruni(path))
|
||||
|
||||
def selected_get(self):
|
||||
return _ctouni(elm_fileselector_selected_get(self.obj))
|
||||
|
||||
property selected:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_selected_get(self.obj))
|
||||
|
||||
def __set__(self, path):
|
||||
#TODO: Check return value for success
|
||||
elm_fileselector_selected_set(self.obj, _cfruni(path))
|
||||
|
||||
def mode_set(self, mode):
|
||||
elm_fileselector_mode_set(self.obj, mode)
|
||||
|
||||
def mode_get(self):
|
||||
return elm_fileselector_mode_get(self.obj)
|
||||
|
||||
property mode:
|
||||
def __get__(self):
|
||||
return elm_fileselector_mode_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_fileselector_mode_set(self.obj, mode)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("selected", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_string_conv, func)
|
||||
|
||||
def callback_directory_open_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("directory,open", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_directory_open_del(self, func):
|
||||
self._callback_del_full("directory,open", _cb_string_conv, func)
|
||||
|
||||
def callback_done_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("done", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_done_del(self, func):
|
||||
self._callback_del_full("done", _cb_string_conv, func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_fileselector", Fileselector)
|
|
@ -1,75 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Flip(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_flip_add(parent.obj))
|
||||
|
||||
def front_visible_get(self):
|
||||
return elm_flip_front_visible_get(self.obj)
|
||||
|
||||
property front_visible:
|
||||
def __get__(self):
|
||||
return elm_flip_front_visible_get(self.obj)
|
||||
|
||||
def perspective_set(self, foc, x, y):
|
||||
elm_flip_perspective_set(self.obj, foc, x, y)
|
||||
|
||||
def go(self, flip_mode):
|
||||
elm_flip_go(self.obj, flip_mode)
|
||||
|
||||
def interaction_set(self, mode):
|
||||
elm_flip_interaction_set(self.obj, mode)
|
||||
|
||||
def interaction_get(self):
|
||||
return elm_flip_interaction_get(self.obj)
|
||||
|
||||
property interaction:
|
||||
def __get__(self):
|
||||
return elm_flip_interaction_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_flip_interaction_set(self.obj, mode)
|
||||
|
||||
def interaction_direction_enabled_set(self, direction, enable):
|
||||
elm_flip_interaction_direction_enabled_set(self.obj, direction, enable)
|
||||
|
||||
def interaction_direction_enabled_get(self, direction):
|
||||
return elm_flip_interaction_direction_enabled_get(self.obj, direction)
|
||||
|
||||
def interaction_direction_hitsize_set(self, direction, hitsize):
|
||||
elm_flip_interaction_direction_hitsize_set(self.obj, direction, hitsize)
|
||||
|
||||
def interaction_direction_hitsize_get(self, direction):
|
||||
return elm_flip_interaction_direction_hitsize_get(self.obj, direction)
|
||||
|
||||
def callback_animate_begin_add(self, func, *args, **kwargs):
|
||||
self._callback_add("animate,begin", func, *args, **kwargs)
|
||||
|
||||
def callback_animate_begin_del(self, func):
|
||||
self._callback_del("animate,begin", func)
|
||||
|
||||
def callback_animate_done_add(self, func, *args, **kwargs):
|
||||
self._callback_add("animate,done", func, *args, **kwargs)
|
||||
|
||||
def callback_animate_done_del(self, func):
|
||||
self._callback_del("animate,done", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_flip", Flip)
|
|
@ -1,134 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class FlipSelectorItem(ObjectItem):
|
||||
|
||||
property selected:
|
||||
def __set__(self, selected):
|
||||
elm_flipselector_item_selected_set(self.item, selected)
|
||||
|
||||
def __get__(self):
|
||||
return bool(elm_flipselector_item_selected_get(self.item))
|
||||
|
||||
property prev:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_item_prev_get(self.item))
|
||||
|
||||
property next:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_item_next_get(self.item))
|
||||
|
||||
|
||||
cdef class FlipSelector(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_flipselector_add(parent.obj))
|
||||
|
||||
def next(self):
|
||||
elm_flipselector_flip_next(self.obj)
|
||||
|
||||
def prev(self):
|
||||
elm_flipselector_flip_prev(self.obj)
|
||||
|
||||
def item_append(self, label = None, callback = None, *args, **kwargs):
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
cdef FlipSelectorItem ret = FlipSelectorItem()
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
ret.params = (callback, args, kwargs)
|
||||
item = elm_flipselector_item_append(self.obj,
|
||||
_cfruni(label),
|
||||
cb,
|
||||
<void *>self)
|
||||
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return
|
||||
|
||||
def item_prepend(self, label = None, callback = None, *args, **kwargs):
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
cdef FlipSelectorItem ret = FlipSelectorItem()
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
ret.params = (callback, args, kwargs)
|
||||
item = elm_flipselector_item_append(self.obj,
|
||||
_cfruni(label),
|
||||
cb,
|
||||
<void *>self)
|
||||
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return
|
||||
|
||||
property items:
|
||||
def __get__(self):
|
||||
return tuple(_object_item_list_to_python(elm_flipselector_items_get(self.obj)))
|
||||
|
||||
property first_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_first_item_get(self.obj))
|
||||
|
||||
property last_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_last_item_get(self.obj))
|
||||
|
||||
property selected_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_selected_item_get(self.obj))
|
||||
|
||||
property first_interval:
|
||||
def __set__(self, interval):
|
||||
elm_flipselector_first_interval_set(self.obj, interval)
|
||||
|
||||
def __get__(self):
|
||||
return elm_flipselector_first_interval_get(self.obj)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add("selected", func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del("selected", func)
|
||||
|
||||
def callback_overflowed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("overflowed", func, *args, **kwargs)
|
||||
|
||||
def callback_overflowed_del(self, func):
|
||||
self._callback_del("overflowed", func)
|
||||
|
||||
def callback_underflowed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("underflowed", func, *args, **kwargs)
|
||||
|
||||
def callback_underflowed_del(self, func):
|
||||
self._callback_del("underflowed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_flipselector", FlipSelector)
|
|
@ -1,810 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import traceback
|
||||
|
||||
cdef _py_elm_gengrid_item_call(func, Evas_Object *obj, part, data) with gil:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
return func(o, _ctouni(part), data)
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return None
|
||||
|
||||
cdef char *_py_elm_gengrid_item_text_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
|
||||
cdef GengridItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef GengridItemClass itc = params[0]
|
||||
|
||||
func = itc._text_get_func
|
||||
if func is None:
|
||||
return NULL
|
||||
|
||||
ret = _py_elm_gengrid_item_call(func, obj, part, params[1])
|
||||
if ret is not None:
|
||||
return strdup(_fruni(ret))
|
||||
else:
|
||||
return NULL
|
||||
|
||||
cdef Evas_Object *_py_elm_gengrid_item_content_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
|
||||
cdef GengridItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef evasObject icon
|
||||
cdef GengridItemClass itc = params[0]
|
||||
|
||||
func = itc._content_get_func
|
||||
if func is None:
|
||||
return NULL
|
||||
|
||||
ret = _py_elm_gengrid_item_call(func, obj, part, params[1])
|
||||
if ret is not None:
|
||||
try:
|
||||
icon = ret
|
||||
return icon.obj
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return NULL
|
||||
else:
|
||||
return NULL
|
||||
|
||||
cdef Eina_Bool _py_elm_gengrid_item_state_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
|
||||
cdef GengridItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef GengridItemClass itc = params[0]
|
||||
|
||||
func = itc._state_get_func
|
||||
if func is None:
|
||||
return False
|
||||
|
||||
ret = _py_elm_gengrid_item_call(func, obj, part, params[1])
|
||||
if ret is not None:
|
||||
return bool(ret)
|
||||
else:
|
||||
return False
|
||||
|
||||
cdef void _py_elm_gengrid_object_item_del(void *data, Evas_Object *obj) with gil:
|
||||
cdef GengridItem item = <object>data
|
||||
cdef object params
|
||||
cdef GengridItemClass itc
|
||||
|
||||
if item is None:
|
||||
return
|
||||
|
||||
params = item.params
|
||||
itc = params[0]
|
||||
|
||||
func = itc._del_func
|
||||
if func is not None:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
func(o, params[1])
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
item._unset_obj()
|
||||
Py_DECREF(item)
|
||||
|
||||
cdef void _py_elm_gengrid_item_func(void *data, Evas_Object *obj, void *event_info) with gil:
|
||||
cdef GengridItem item = <object>data
|
||||
cdef object func = item.params[2]
|
||||
|
||||
if func is not None:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
func(item, o, item.params[1])
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
cdef class GengridItemClass:
|
||||
|
||||
cdef Elm_Gengrid_Item_Class obj
|
||||
cdef readonly object _item_style
|
||||
cdef readonly object _text_get_func
|
||||
cdef readonly object _content_get_func
|
||||
cdef readonly object _state_get_func
|
||||
cdef readonly object _del_func
|
||||
|
||||
def __cinit__(self, *a, **ka):
|
||||
self._item_style = "default"
|
||||
self._text_get_func = None
|
||||
self._content_get_func = None
|
||||
self._state_get_func = None
|
||||
self._del_func = None
|
||||
|
||||
self.obj.item_style = NULL
|
||||
self.obj.func.text_get = _py_elm_gengrid_item_text_get
|
||||
self.obj.func.content_get = _py_elm_gengrid_item_content_get
|
||||
self.obj.func.state_get = _py_elm_gengrid_item_state_get
|
||||
self.obj.func.del_ = _py_elm_gengrid_object_item_del
|
||||
|
||||
def __init__(self, item_style=None, text_get_func=None,
|
||||
content_get_func=None, state_get_func=None, del_func=None):
|
||||
if item_style:
|
||||
self._item_style = item_style
|
||||
|
||||
if text_get_func and not callable(text_get_func):
|
||||
raise TypeError("text_get_func is not callable!")
|
||||
elif text_get_func:
|
||||
self._text_get_func = text_get_func
|
||||
else:
|
||||
self._text_get_func = self.text_get
|
||||
|
||||
if content_get_func and not callable(content_get_func):
|
||||
raise TypeError("content_get_func is not callable!")
|
||||
elif content_get_func:
|
||||
self._content_get_func = content_get_func
|
||||
else:
|
||||
self._content_get_func = self.content_get
|
||||
|
||||
if state_get_func and not callable(state_get_func):
|
||||
raise TypeError("state_get_func is not callable!")
|
||||
elif state_get_func:
|
||||
self._state_get_func = state_get_func
|
||||
else:
|
||||
self._state_get_func = self.state_get
|
||||
|
||||
if del_func and not callable(del_func):
|
||||
raise TypeError("del_func is not callable!")
|
||||
elif del_func:
|
||||
self._del_func = del_func
|
||||
else:
|
||||
try:
|
||||
self._del_func = self.delete
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
self.obj.item_style = _cfruni(self._item_style)
|
||||
|
||||
def __str__(self):
|
||||
return ("%s(item_style=%r, text_get_func=%s, content_get_func=%s, "
|
||||
"state_get_func=%s, del_func=%s)") % \
|
||||
(self.__class__.__name__,
|
||||
self._item_style,
|
||||
self._text_get_func,
|
||||
self._content_get_func,
|
||||
self._state_get_func,
|
||||
self._del_func)
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Gengrid_Item_Class=%#x, "
|
||||
"item_style=%r, text_get_func=%s, content_get_func=%s, "
|
||||
"state_get_func=%s, del_func=%s)") % \
|
||||
(self.__class__.__name__,
|
||||
<unsigned long><void *>self,
|
||||
PY_REFCOUNT(self),
|
||||
<unsigned long>&self.obj,
|
||||
self._item_style,
|
||||
self._text_get_func,
|
||||
self._content_get_func,
|
||||
self._state_get_func,
|
||||
self._del_func)
|
||||
|
||||
property item_style:
|
||||
def __get__(self):
|
||||
return self._item_style
|
||||
|
||||
def text_get(self, evasObject obj, part, item_data):
|
||||
return None
|
||||
|
||||
def content_get(self, evasObject obj, part, item_data):
|
||||
return None
|
||||
|
||||
def state_get(self, evasObject obj, part, item_data):
|
||||
return False
|
||||
|
||||
|
||||
cdef class GengridItem(ObjectItem):
|
||||
|
||||
cdef int _set_obj(self, Elm_Object_Item *item) except 0:
|
||||
assert self.item == NULL, "Object must be clean"
|
||||
self.item = item
|
||||
Py_INCREF(self)
|
||||
return 1
|
||||
|
||||
cdef void _unset_obj(self):
|
||||
assert self.item != NULL, "Object must wrap something"
|
||||
self.item = NULL
|
||||
|
||||
def __str__(self):
|
||||
return "%s(item_class=%s, func=%s, item_data=%s)" % \
|
||||
(self.__class__.__name__,
|
||||
self.params[0].__class__.__name__,
|
||||
self.params[2],
|
||||
self.params[1])
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
|
||||
"item_class=%s, func=%s, item_data=%r)") % \
|
||||
(self.__class__.__name__,
|
||||
<unsigned long><void*>self,
|
||||
PY_REFCOUNT(self),
|
||||
<unsigned long>self.item,
|
||||
self.params[0].__class__.__name__,
|
||||
self.params[2],
|
||||
self.params[1])
|
||||
|
||||
def data_get(self):
|
||||
(item_class, item_data, func) = self.params
|
||||
return item_data
|
||||
|
||||
property data:
|
||||
def __get__(self):
|
||||
return self.data_get()
|
||||
|
||||
def next_get(self):
|
||||
return _object_item_to_python(elm_gengrid_item_next_get(self.item))
|
||||
|
||||
property next:
|
||||
def __get__(self):
|
||||
return self.next_get()
|
||||
|
||||
def prev_get(self):
|
||||
return _object_item_to_python(elm_gengrid_item_prev_get(self.item))
|
||||
|
||||
property prev:
|
||||
def __get__(self):
|
||||
return self.prev_get()
|
||||
|
||||
def gengrid_get(self):
|
||||
return object_from_instance(elm_object_item_widget_get(self.item))
|
||||
|
||||
property gengrid:
|
||||
def __get__(self):
|
||||
return self.gengrid_get()
|
||||
|
||||
def index_get(self):
|
||||
return elm_gengrid_item_index_get(self.item)
|
||||
|
||||
property index:
|
||||
def __get__(self):
|
||||
return self.index_get()
|
||||
|
||||
def delete(self):
|
||||
elm_object_item_del(self.item)
|
||||
|
||||
def update(self):
|
||||
elm_gengrid_item_update(self.item)
|
||||
|
||||
def selected_set(self, selected):
|
||||
elm_gengrid_item_selected_set(self.item, bool(selected))
|
||||
|
||||
def selected_get(self):
|
||||
return bool(elm_gengrid_item_selected_get(self.item))
|
||||
|
||||
property selected:
|
||||
def __get__(self):
|
||||
return self.selected_get()
|
||||
|
||||
def __set__(self, selected):
|
||||
self.selected_set(selected)
|
||||
|
||||
def show(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
|
||||
elm_gengrid_item_show(self.item, scrollto_type)
|
||||
|
||||
def bring_in(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
|
||||
elm_gengrid_item_bring_in(self.item, scrollto_type)
|
||||
|
||||
def pos_get(self):
|
||||
cdef unsigned int x, y
|
||||
elm_gengrid_item_pos_get(self.item, &x, &y)
|
||||
return (x, y)
|
||||
|
||||
# XXX TODO elm_gengrid_item_item_class_update
|
||||
|
||||
# XXX TODO elm_gengrid_item_item_class_get
|
||||
|
||||
def tooltip_text_set(self, text):
|
||||
elm_gengrid_item_tooltip_text_set(self.item, _cfruni(text))
|
||||
|
||||
property tooltip_text:
|
||||
def __get__(self):
|
||||
return self.tooltip_text_get()
|
||||
|
||||
def tooltip_content_cb_set(self, func, *args, **kargs):
|
||||
if not callable(func):
|
||||
raise TypeError("func must be callable")
|
||||
|
||||
cdef void *cbdata
|
||||
|
||||
data = (func, self, args, kargs)
|
||||
Py_INCREF(data)
|
||||
cbdata = <void *>data
|
||||
elm_gengrid_item_tooltip_content_cb_set(self.item,
|
||||
_tooltip_item_content_create,
|
||||
cbdata,
|
||||
_tooltip_item_data_del_cb)
|
||||
|
||||
def item_tooltip_unset(self):
|
||||
elm_gengrid_item_tooltip_unset(self.item)
|
||||
|
||||
def tooltip_style_set(self, style=None):
|
||||
if style:
|
||||
elm_gengrid_item_tooltip_style_set(self.item, _cfruni(style))
|
||||
else:
|
||||
elm_gengrid_item_tooltip_style_set(self.item, NULL)
|
||||
|
||||
def tooltip_style_get(self):
|
||||
return _ctouni(elm_gengrid_item_tooltip_style_get(self.item))
|
||||
|
||||
property tooltip_style:
|
||||
def __get__(self):
|
||||
return self.tooltip_style_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.tooltip_style_set(value)
|
||||
|
||||
def tooltip_window_mode_set(self, disable):
|
||||
elm_gengrid_item_tooltip_window_mode_set(self.item, bool(disable))
|
||||
|
||||
def tooltip_window_mode_get(self):
|
||||
return bool(elm_gengrid_item_tooltip_window_mode_get(self.item))
|
||||
|
||||
property tooltip_window_mode:
|
||||
def __get__(self):
|
||||
return self.tooltip_window_mode_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.tooltip_window_mode_set(value)
|
||||
|
||||
def cursor_set(self, char *cursor):
|
||||
elm_gengrid_item_cursor_set(self.item, _cfruni(cursor))
|
||||
|
||||
def cursor_get(self):
|
||||
return _ctouni(elm_gengrid_item_cursor_get(self.item))
|
||||
|
||||
property cursor:
|
||||
def __get__(self):
|
||||
return self.cursor_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.cursor_set(value)
|
||||
|
||||
def cursor_unset(self):
|
||||
elm_gengrid_item_cursor_unset(self.item)
|
||||
|
||||
def cursor_style_set(self, style=None):
|
||||
if style:
|
||||
elm_gengrid_item_cursor_style_set(self.item, _cfruni(style))
|
||||
else:
|
||||
elm_gengrid_item_cursor_style_set(self.item, NULL)
|
||||
|
||||
def cursor_style_get(self):
|
||||
return _ctouni(elm_gengrid_item_cursor_style_get(self.item))
|
||||
|
||||
property cursor_style:
|
||||
def __get__(self):
|
||||
return self.cursor_style_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.cursor_style_set(value)
|
||||
|
||||
def cursor_engine_only_set(self, engine_only):
|
||||
elm_gengrid_item_cursor_engine_only_set(self.item, bool(engine_only))
|
||||
|
||||
def cursor_engine_only_get(self):
|
||||
return elm_gengrid_item_cursor_engine_only_get(self.item)
|
||||
|
||||
property cursor_engine_only:
|
||||
def __get__(self):
|
||||
return self.cursor_engine_only_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.cursor_engine_only_set(value)
|
||||
|
||||
def select_mode_set(self, mode):
|
||||
elm_gengrid_item_select_mode_set(self.item, mode)
|
||||
|
||||
def select_mode_get(self):
|
||||
return elm_gengrid_item_select_mode_get(self.item)
|
||||
|
||||
property select_mode:
|
||||
def __get__(self):
|
||||
return self.select_mode_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.select_mode_set(value)
|
||||
|
||||
|
||||
cdef class Gengrid(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_gengrid_add(parent.obj))
|
||||
|
||||
def clear(self):
|
||||
elm_gengrid_clear(self.obj)
|
||||
|
||||
def multi_select_set(self, multi):
|
||||
elm_gengrid_multi_select_set(self.obj, bool(multi))
|
||||
|
||||
def multi_select_get(self):
|
||||
return bool(elm_gengrid_multi_select_get(self.obj))
|
||||
|
||||
property multi_select:
|
||||
def __get__(self):
|
||||
return self.multi_select_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.multi_select_set(value)
|
||||
|
||||
def horizontal_set(self, setting):
|
||||
elm_gengrid_horizontal_set(self.obj, bool(setting))
|
||||
|
||||
def horizontal_get(self):
|
||||
return bool(elm_gengrid_horizontal_get(self.obj))
|
||||
|
||||
property horizontal:
|
||||
def __get__(self):
|
||||
return self.horizontal_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.horizontal_set(value)
|
||||
|
||||
def bounce_set(self, h_bounce, v_bounce):
|
||||
elm_scroller_bounce_set(self.obj, bool(h_bounce), bool(v_bounce))
|
||||
|
||||
def bounce_get(self):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
|
||||
return (h_bounce, v_bounce)
|
||||
|
||||
property bounce:
|
||||
def __get__(self):
|
||||
return self.bouce_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.bouce_set(*value)
|
||||
|
||||
def item_append(self, GengridItemClass item_class not None,
|
||||
item_data, func=None):
|
||||
cdef GengridItem ret = GengridItem()
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_gengrid_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_gengrid_item_append( self.obj,
|
||||
&item_class.obj,
|
||||
<void*>ret,
|
||||
cb,
|
||||
<void*>ret)
|
||||
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
def item_prepend(self, GengridItemClass item_class not None,
|
||||
item_data, func=None):
|
||||
cdef GengridItem ret = GengridItem()
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_gengrid_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_gengrid_item_prepend(self.obj,
|
||||
&item_class.obj,
|
||||
<void*>ret,
|
||||
cb,
|
||||
<void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
def item_insert_before(self, GengridItemClass item_class not None,
|
||||
item_data, GengridItem before_item=None,
|
||||
func=None):
|
||||
cdef GengridItem ret = GengridItem()
|
||||
cdef Elm_Object_Item *item, *before
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
before = _object_item_from_python(before_item)
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_gengrid_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
(item_class, item_data, func)
|
||||
item = elm_gengrid_item_insert_before( self.obj,
|
||||
&item_class.obj,
|
||||
<void*>ret,
|
||||
before,
|
||||
cb,
|
||||
<void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
def item_insert_after(self, GengridItemClass item_class not None,
|
||||
item_data, GengridItem after_item=None,
|
||||
func=None):
|
||||
cdef GengridItem ret = GengridItem()
|
||||
cdef Elm_Object_Item *item, *after
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
after = _object_item_from_python(after_item)
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_gengrid_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_gengrid_item_insert_after( self.obj,
|
||||
&item_class.obj,
|
||||
<void*>ret,
|
||||
after,
|
||||
cb,
|
||||
<void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
# XXX TODO elm_gengrid_item_sorted_insert()
|
||||
|
||||
def selected_item_get(self):
|
||||
return _object_item_to_python(elm_gengrid_selected_item_get(self.obj))
|
||||
|
||||
property selected_item:
|
||||
def __get__(self):
|
||||
return self.selected_item_get()
|
||||
|
||||
def selected_items_get(self):
|
||||
return _object_item_list_to_python(elm_gengrid_selected_items_get(self.obj))
|
||||
|
||||
property selected_items:
|
||||
def __get__(self):
|
||||
return self.selected_items_get()
|
||||
|
||||
def realized_items_get(self):
|
||||
return _object_item_list_to_python(elm_gengrid_realized_items_get(self.obj))
|
||||
|
||||
property realized_items:
|
||||
def __get__(self):
|
||||
return self.realized_items_get()
|
||||
|
||||
def realized_items_update(self):
|
||||
elm_gengrid_realized_items_update(self.obj)
|
||||
|
||||
def first_item_get(self):
|
||||
return _object_item_to_python(elm_gengrid_first_item_get(self.obj))
|
||||
|
||||
property first_item:
|
||||
def __get__(self):
|
||||
return self.first_item_get()
|
||||
|
||||
def last_item_get(self):
|
||||
return _object_item_to_python(elm_gengrid_last_item_get(self.obj))
|
||||
|
||||
property last_item:
|
||||
def __get__(self):
|
||||
return self.last_item_get()
|
||||
|
||||
def scroller_policy_set(self, policy_h, policy_v):
|
||||
elm_scroller_policy_set(self.obj, policy_h, policy_v)
|
||||
|
||||
def scroller_policy_get(self):
|
||||
cdef Elm_Scroller_Policy policy_h, policy_v
|
||||
elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
|
||||
return (policy_h, policy_v)
|
||||
|
||||
property scroller_policy:
|
||||
def __get__(self):
|
||||
return self.scroller_policy_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.scroller_policy_set(*value)
|
||||
|
||||
def item_size_set(self, w, h):
|
||||
elm_gengrid_item_size_set(self.obj, w, h)
|
||||
|
||||
def item_size_get(self):
|
||||
cdef Evas_Coord x, y
|
||||
elm_gengrid_item_size_get(self.obj, &x, &y)
|
||||
return (x, y)
|
||||
|
||||
def items_count(self):
|
||||
return elm_gengrid_items_count(self.obj)
|
||||
|
||||
property item_size:
|
||||
def __get__(self):
|
||||
return self.item_size_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.item_size_set(value)
|
||||
|
||||
def group_item_size_set(self, w, h):
|
||||
elm_gengrid_group_item_size_set(self.obj, w, h)
|
||||
|
||||
def group_item_size_get(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_gengrid_group_item_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
property group_item_size:
|
||||
def __get__(self):
|
||||
return self.group_item_size_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.group_item_size_set(*value)
|
||||
|
||||
def align_set(self, align_x, align_y):
|
||||
elm_gengrid_align_set(self.obj, align_x, align_y)
|
||||
|
||||
def align_get(self):
|
||||
cdef double align_x, align_y
|
||||
elm_gengrid_align_get(self.obj, &align_x, &align_y)
|
||||
return (align_x, align_y)
|
||||
|
||||
property align:
|
||||
def __get__(self):
|
||||
return self.align_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.align_set(*value)
|
||||
|
||||
def reorder_mode_set(self, mode):
|
||||
elm_gengrid_reorder_mode_set(self.obj, bool(mode))
|
||||
|
||||
def reorder_mode_get(self, mode):
|
||||
return bool(elm_gengrid_reorder_mode_get(self.obj))
|
||||
|
||||
property reorder_mode:
|
||||
def __get__(self):
|
||||
return self.reorder_mode_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.reorder_mode_set(value)
|
||||
|
||||
def page_relative_set(self, h_pagerel, v_pagerel):
|
||||
elm_scroller_page_relative_set(self.obj, h_pagerel, v_pagerel)
|
||||
|
||||
def page_relative_get(self):
|
||||
cdef double h_pagerel, v_pagerel
|
||||
elm_scroller_page_relative_get(self.obj, &h_pagerel, &v_pagerel)
|
||||
return (h_pagerel, v_pagerel)
|
||||
|
||||
property page_relative:
|
||||
def __get__(self):
|
||||
return self.page_relative_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.page_relative_set(*value)
|
||||
|
||||
def page_size_set(self, h_pagesize, v_pagesize):
|
||||
elm_scroller_page_size_set(self.obj, h_pagesize, v_pagesize)
|
||||
|
||||
def current_page_get(self):
|
||||
cdef int h_pagenum, v_pagenum
|
||||
elm_scroller_current_page_get(self.obj, &h_pagenum, &v_pagenum)
|
||||
return (h_pagenum, v_pagenum)
|
||||
|
||||
property current_page:
|
||||
def __get__(self):
|
||||
return self.current_page_get()
|
||||
|
||||
def last_page_get(self):
|
||||
cdef int h_pagenum, v_pagenum
|
||||
elm_scroller_last_page_get(self.obj, &h_pagenum, &v_pagenum)
|
||||
return (h_pagenum, v_pagenum)
|
||||
|
||||
property last_page:
|
||||
def __get__(self):
|
||||
return self.last_page_get()
|
||||
|
||||
def page_show(self, h_pagenum, v_pagenum):
|
||||
elm_gengrid_page_show(self.obj, h_pagenum, v_pagenum)
|
||||
|
||||
def page_bring_in(self, h_pagenum, v_pagenum):
|
||||
elm_scroller_page_bring_in(self.obj, h_pagenum, v_pagenum)
|
||||
|
||||
def filled_set(self, fill):
|
||||
elm_gengrid_filled_set(self.obj, bool(fill))
|
||||
|
||||
def filled_get(self, fill):
|
||||
return bool(elm_gengrid_filled_get(self.obj))
|
||||
|
||||
property filled:
|
||||
def __get__(self):
|
||||
return self.filled_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.filled_set(value)
|
||||
|
||||
def select_mode_set(self, mode):
|
||||
elm_gengrid_select_mode_set(self.obj, mode)
|
||||
|
||||
def select_mode_get(self):
|
||||
return elm_gengrid_select_mode_get(self.obj)
|
||||
|
||||
property select_mode:
|
||||
def __get__(self):
|
||||
return self.select_mode_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.select_mode_set(value)
|
||||
|
||||
def highlight_mode_set(self, highlight):
|
||||
elm_gengrid_highlight_mode_set(self.obj, bool(highlight))
|
||||
|
||||
def highlight_mode_get(self, fill):
|
||||
return bool(elm_gengrid_highlight_mode_get(self.obj))
|
||||
|
||||
property highlight_mode:
|
||||
def __get__(self):
|
||||
return self.highlight_mode_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.highlight_mode_set(value)
|
||||
|
||||
def callback_clicked_double_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("clicked,double", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_double_del(self, func):
|
||||
self._callback_del_full("clicked,double", _cb_object_item_conv, func)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("clicked", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del_full("clicked", _cb_object_item_conv, func)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("selected", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_unselected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("unselected", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_unselected_del(self, func):
|
||||
self._callback_del_full("unselected", _cb_object_item_conv, func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_gengrid", Gengrid)
|
|
@ -1,922 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
import traceback
|
||||
|
||||
|
||||
cdef _py_elm_genlist_item_call(func, Evas_Object *obj, part, data) with gil:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
return func(o, _ctouni(part), data)
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return None
|
||||
|
||||
cdef char *_py_elm_genlist_item_text_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
|
||||
cdef GenlistItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef GenlistItemClass itc = params[0]
|
||||
|
||||
func = itc._text_get_func
|
||||
if func is None:
|
||||
return NULL
|
||||
|
||||
ret = _py_elm_genlist_item_call(func, obj, part, params[1])
|
||||
if ret is not None:
|
||||
return strdup(_fruni(ret))
|
||||
else:
|
||||
return NULL
|
||||
|
||||
cdef Evas_Object *_py_elm_genlist_item_content_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
|
||||
cdef GenlistItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef evasObject icon
|
||||
cdef GenlistItemClass itc = params[0]
|
||||
|
||||
func = itc._content_get_func
|
||||
if func is None:
|
||||
return NULL
|
||||
|
||||
ret = _py_elm_genlist_item_call(func, obj, part, params[1])
|
||||
if ret is not None:
|
||||
try:
|
||||
icon = ret
|
||||
return icon.obj
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return NULL
|
||||
else:
|
||||
return NULL
|
||||
|
||||
cdef Eina_Bool _py_elm_genlist_item_state_get(void *data, Evas_Object *obj, const_char_ptr part) with gil:
|
||||
cdef GenlistItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef GenlistItemClass itc = params[0]
|
||||
|
||||
func = itc._state_get_func
|
||||
if func is None:
|
||||
return False
|
||||
|
||||
ret = _py_elm_genlist_item_call(func, obj, part, params[1])
|
||||
if ret is not None:
|
||||
return bool(ret)
|
||||
else:
|
||||
return False
|
||||
|
||||
cdef void _py_elm_genlist_object_item_del(void *data, Evas_Object *obj) with gil:
|
||||
cdef GenlistItem item = <object>data
|
||||
cdef object params
|
||||
cdef GenlistItemClass itc
|
||||
|
||||
if item is None:
|
||||
return
|
||||
|
||||
params = item.params
|
||||
itc = params[0]
|
||||
|
||||
func = itc._del_func
|
||||
if func is not None:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
func(o, params[1])
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
item._unset_obj()
|
||||
Py_DECREF(item)
|
||||
|
||||
cdef void _py_elm_genlist_item_func(void *data, Evas_Object *obj, void *event_info) with gil:
|
||||
cdef GenlistItem item = <object>data
|
||||
cdef object func = item.params[2]
|
||||
|
||||
if func is not None:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
func(item, o, item.params[1])
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
|
||||
|
||||
cdef class GenlistItemClass:
|
||||
cdef Elm_Genlist_Item_Class obj
|
||||
cdef readonly object _item_style
|
||||
cdef readonly object _text_get_func
|
||||
cdef readonly object _content_get_func
|
||||
cdef readonly object _state_get_func
|
||||
cdef readonly object _del_func
|
||||
|
||||
def __cinit__(self, *a, **ka):
|
||||
self._item_style = "default"
|
||||
self._text_get_func = None
|
||||
self._content_get_func = None
|
||||
self._state_get_func = None
|
||||
self._del_func = None
|
||||
|
||||
self.obj.item_style = NULL
|
||||
self.obj.func.text_get = _py_elm_genlist_item_text_get
|
||||
self.obj.func.content_get = _py_elm_genlist_item_content_get
|
||||
self.obj.func.state_get = _py_elm_genlist_item_state_get
|
||||
self.obj.func.del_ = _py_elm_genlist_object_item_del
|
||||
|
||||
def __init__(self, item_style=None, text_get_func=None,
|
||||
content_get_func=None, state_get_func=None, del_func=None):
|
||||
if item_style:
|
||||
self._item_style = item_style
|
||||
|
||||
if text_get_func and not callable(text_get_func):
|
||||
raise TypeError("text_get_func is not callable!")
|
||||
elif text_get_func:
|
||||
self._text_get_func = text_get_func
|
||||
else:
|
||||
self._text_get_func = self.text_get
|
||||
|
||||
if content_get_func and not callable(content_get_func):
|
||||
raise TypeError("content_get_func is not callable!")
|
||||
elif content_get_func:
|
||||
self._content_get_func = content_get_func
|
||||
else:
|
||||
self._content_get_func = self.content_get
|
||||
|
||||
if state_get_func and not callable(state_get_func):
|
||||
raise TypeError("state_get_func is not callable!")
|
||||
elif state_get_func:
|
||||
self._state_get_func = state_get_func
|
||||
else:
|
||||
self._state_get_func = self.state_get
|
||||
|
||||
if del_func and not callable(del_func):
|
||||
raise TypeError("del_func is not callable!")
|
||||
elif del_func:
|
||||
self._del_func = del_func
|
||||
else:
|
||||
try:
|
||||
self._del_func = self.delete
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
self.obj.item_style = _fruni(self._item_style)
|
||||
|
||||
def __str__(self):
|
||||
return ("%s(item_style=%r, text_get_func=%s, content_get_func=%s, "
|
||||
"state_get_func=%s, del_func=%s)") % \
|
||||
(self.__class__.__name__,
|
||||
self._item_style,
|
||||
self._text_get_func,
|
||||
self._content_get_func,
|
||||
self._state_get_func,
|
||||
self._del_func)
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Genlist_Item_Class=%#x, "
|
||||
"item_style=%r, text_get_func=%s, content_get_func=%s, "
|
||||
"state_get_func=%s, del_func=%s)") % \
|
||||
(self.__class__.__name__,
|
||||
<unsigned long><void *>self,
|
||||
PY_REFCOUNT(self),
|
||||
<unsigned long>&self.obj,
|
||||
self._item_style,
|
||||
self._text_get_func,
|
||||
self._content_get_func,
|
||||
self._state_get_func,
|
||||
self._del_func)
|
||||
|
||||
property item_style:
|
||||
def __get__(self):
|
||||
return self._item_style
|
||||
|
||||
def text_get(self, evasObject obj, part, item_data):
|
||||
return None
|
||||
|
||||
def content_get(self, evasObject obj, part, item_data):
|
||||
return None
|
||||
|
||||
def state_get(self, evasObject obj, part, item_data):
|
||||
return False
|
||||
|
||||
|
||||
cdef class GenlistItem(ObjectItem):
|
||||
|
||||
cdef int _set_obj(self, Elm_Object_Item *item, params=None) except 0:
|
||||
assert self.item == NULL, "Object must be clean"
|
||||
self.item = item
|
||||
Py_INCREF(self)
|
||||
return 1
|
||||
|
||||
cdef void _unset_obj(self):
|
||||
assert self.item != NULL, "Object must wrap something"
|
||||
self.item = NULL
|
||||
|
||||
def __str__(self):
|
||||
return "%s(item_class=%s, func=%s, item_data=%s)" % \
|
||||
(self.__class__.__name__,
|
||||
self.params[0].__class__.__name__,
|
||||
self.params[2],
|
||||
self.params[1])
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
|
||||
"item_class=%s, func=%s, item_data=%r)") % \
|
||||
(self.__class__.__name__,
|
||||
<unsigned long><void*>self,
|
||||
PY_REFCOUNT(self),
|
||||
<unsigned long>self.item,
|
||||
self.params[0].__class__.__name__,
|
||||
self.params[2],
|
||||
self.params[1])
|
||||
|
||||
def data_get(self):
|
||||
return self.params[1]
|
||||
|
||||
property data:
|
||||
def __get__(self):
|
||||
return self.data_get()
|
||||
|
||||
def next_get(self):
|
||||
return _object_item_to_python(elm_genlist_item_next_get(self.item))
|
||||
|
||||
property next:
|
||||
def __get__(self):
|
||||
return self.next_get()
|
||||
|
||||
def prev_get(self):
|
||||
return _object_item_to_python(elm_genlist_item_prev_get(self.item))
|
||||
|
||||
property prev:
|
||||
def __get__(self):
|
||||
return self.prev_get()
|
||||
|
||||
def selected_set(self, selected):
|
||||
elm_genlist_item_selected_set(self.item, bool(selected))
|
||||
|
||||
def selected_get(self):
|
||||
return bool(elm_genlist_item_selected_get(self.item))
|
||||
|
||||
property selected:
|
||||
def __get__(self):
|
||||
return self.selected_get()
|
||||
|
||||
def __set__(self, selected):
|
||||
self.selected_set(selected)
|
||||
|
||||
def show(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
|
||||
elm_genlist_item_show(self.item, scrollto_type)
|
||||
|
||||
def bring_in(self, scrollto_type = ELM_GENLIST_ITEM_SCROLLTO_IN):
|
||||
elm_genlist_item_bring_in(self.item, scrollto_type)
|
||||
|
||||
def update(self):
|
||||
elm_genlist_item_update(self.item)
|
||||
|
||||
#def item_class_update(self, Elm_Genlist_Item_Class itc):
|
||||
#elm_genlist_item_item_class_update(self.item, itc)
|
||||
|
||||
#def item_class_get(self):
|
||||
#return elm_genlist_item_item_class_get(self.item)
|
||||
|
||||
def index_get(self):
|
||||
return elm_genlist_item_index_get(self.item)
|
||||
|
||||
def tooltip_text_set(self, char *text):
|
||||
elm_genlist_item_tooltip_text_set(self.item, _cfruni(text))
|
||||
|
||||
def tooltip_content_cb_set(self, func, *args, **kargs):
|
||||
if not callable(func):
|
||||
raise TypeError("func must be callable")
|
||||
|
||||
cdef void *cbdata
|
||||
|
||||
data = (func, self, args, kargs)
|
||||
Py_INCREF(data)
|
||||
cbdata = <void *>data
|
||||
elm_genlist_item_tooltip_content_cb_set(self.item,
|
||||
_tooltip_item_content_create,
|
||||
cbdata,
|
||||
_tooltip_item_data_del_cb)
|
||||
|
||||
def tooltip_unset(self):
|
||||
elm_genlist_item_tooltip_unset(self.item)
|
||||
|
||||
def tooltip_style_set(self, style=None):
|
||||
if style:
|
||||
elm_genlist_item_tooltip_style_set(self.item, _cfruni(style))
|
||||
else:
|
||||
elm_genlist_item_tooltip_style_set(self.item, NULL)
|
||||
|
||||
def tooltip_style_get(self):
|
||||
return _ctouni(elm_genlist_item_tooltip_style_get(self.item))
|
||||
|
||||
def tooltip_window_mode_set(self, disable):
|
||||
return bool(elm_genlist_item_tooltip_window_mode_set(self.item, disable))
|
||||
|
||||
def tooltip_window_mode_get(self):
|
||||
return bool(elm_genlist_item_tooltip_window_mode_get(self.item))
|
||||
|
||||
def cursor_set(self, cursor):
|
||||
elm_genlist_item_cursor_set(self.item, _cfruni(cursor))
|
||||
|
||||
def cursor_get(self):
|
||||
return _ctouni(elm_genlist_item_cursor_get(self.item))
|
||||
|
||||
def cursor_unset(self):
|
||||
elm_genlist_item_cursor_unset(self.item)
|
||||
|
||||
def cursor_style_set(self, style=None):
|
||||
if style:
|
||||
elm_genlist_item_cursor_style_set(self.item, _cfruni(style))
|
||||
else:
|
||||
elm_genlist_item_cursor_style_set(self.item, NULL)
|
||||
|
||||
def cursor_style_get(self):
|
||||
return _ctouni(elm_genlist_item_cursor_style_get(self.item))
|
||||
|
||||
def cursor_engine_only_set(self, engine_only):
|
||||
elm_genlist_item_cursor_engine_only_set(self.item, bool(engine_only))
|
||||
|
||||
def cursor_engine_only_get(self):
|
||||
return elm_genlist_item_cursor_engine_only_get(self.item)
|
||||
|
||||
def parent_get(self):
|
||||
return _object_item_to_python(elm_genlist_item_parent_get(self.item))
|
||||
|
||||
property parent:
|
||||
def __get__(self):
|
||||
return self.parent_get()
|
||||
|
||||
def subitems_clear(self):
|
||||
elm_genlist_item_subitems_clear(self.item)
|
||||
|
||||
def expanded_set(self, expanded):
|
||||
elm_genlist_item_expanded_set(self.item, bool(expanded))
|
||||
|
||||
def expanded_get(self, ):
|
||||
return bool(elm_genlist_item_expanded_get(self.item))
|
||||
|
||||
property expanded:
|
||||
def __get__(self):
|
||||
return self.expanded_get()
|
||||
|
||||
def __set__(self, expanded):
|
||||
self.expanded_set(expanded)
|
||||
|
||||
def expanded_depth_get(self):
|
||||
return elm_genlist_item_expanded_depth_get(self.item)
|
||||
|
||||
def all_contents_unset(self):
|
||||
cdef Eina_List *lst
|
||||
elm_genlist_item_all_contents_unset(self.item, &lst)
|
||||
return _object_item_list_to_python(lst)
|
||||
|
||||
def promote(self):
|
||||
elm_genlist_item_promote(self.item)
|
||||
|
||||
def demote(self):
|
||||
elm_genlist_item_demote(self.item)
|
||||
|
||||
def fields_update(self, parts, itf):
|
||||
elm_genlist_item_fields_update(self.item, _cfruni(parts), itf)
|
||||
|
||||
def decorate_mode_set(self, decorate_it_type, decorate_it_set):
|
||||
elm_genlist_item_decorate_mode_set(self.item, _cfruni(decorate_it_type), decorate_it_set)
|
||||
|
||||
def decorate_mode_get(self):
|
||||
return _ctouni(elm_genlist_item_decorate_mode_get(self.item))
|
||||
|
||||
def type_get(self):
|
||||
cdef Elm_Genlist_Item_Type ittype = elm_genlist_item_type_get(self.item)
|
||||
return <Elm_Genlist_Item_Type>ittype
|
||||
|
||||
def flip_set(self, flip):
|
||||
elm_genlist_item_flip_set(self.item, flip)
|
||||
|
||||
def flip_get(self):
|
||||
return bool(elm_genlist_item_flip_get(self.item))
|
||||
|
||||
def select_mode_set(self, mode):
|
||||
elm_genlist_item_select_mode_set(self.item, mode)
|
||||
|
||||
def select_mode_get(self):
|
||||
return elm_genlist_item_select_mode_get(self.item)
|
||||
|
||||
|
||||
cdef class Genlist(Object):
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_genlist_add(parent.obj))
|
||||
|
||||
def clear(self):
|
||||
elm_genlist_clear(self.obj)
|
||||
|
||||
def multi_select_set(self, multi):
|
||||
elm_genlist_multi_select_set(self.obj, bool(multi))
|
||||
|
||||
def multi_select_get(self):
|
||||
return bool(elm_genlist_multi_select_get(self.obj))
|
||||
|
||||
def mode_set(self, mode = ELM_LIST_COMPRESS):
|
||||
elm_genlist_mode_set(self.obj, mode)
|
||||
|
||||
def mode_get(self):
|
||||
return elm_genlist_mode_get(self.obj)
|
||||
|
||||
def bounce_set(self, h_bounce, v_bounce):
|
||||
elm_scroller_bounce_set(self.obj, bool(h_bounce), bool(v_bounce))
|
||||
|
||||
def bounce_get(self):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
|
||||
return (h_bounce, v_bounce)
|
||||
|
||||
def item_append(self,
|
||||
GenlistItemClass item_class not None,
|
||||
item_data,
|
||||
GenlistItem parent_item=None,
|
||||
int flags=ELM_GENLIST_ITEM_NONE,
|
||||
func=None):
|
||||
cdef GenlistItem ret = GenlistItem()
|
||||
cdef Elm_Object_Item *item, *parent
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
parent = _object_item_from_python(parent_item) if parent_item is not None else NULL
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_genlist_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_genlist_item_append( self.obj,
|
||||
&item_class.obj,
|
||||
<void*>ret,
|
||||
parent,
|
||||
<Elm_Genlist_Item_Type>flags,
|
||||
cb,
|
||||
<void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
def item_prepend( self,
|
||||
GenlistItemClass item_class not None,
|
||||
item_data,
|
||||
GenlistItem parent_item=None,
|
||||
int flags=ELM_GENLIST_ITEM_NONE,
|
||||
func=None):
|
||||
cdef GenlistItem ret = GenlistItem()
|
||||
cdef Elm_Object_Item *item, *parent
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
parent = _object_item_from_python(parent_item) if parent_item is not None else NULL
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_genlist_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_genlist_item_prepend(self.obj,
|
||||
&item_class.obj,
|
||||
<void*>ret,
|
||||
parent,
|
||||
<Elm_Genlist_Item_Type>flags,
|
||||
cb,
|
||||
<void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
def item_insert_before( self,
|
||||
GenlistItemClass item_class not None,
|
||||
item_data,
|
||||
#API XXX: parent
|
||||
GenlistItem before_item=None,
|
||||
int flags=ELM_GENLIST_ITEM_NONE,
|
||||
func=None
|
||||
#API XXX: *args, **kwargs
|
||||
):
|
||||
cdef GenlistItem ret = GenlistItem()
|
||||
cdef Elm_Object_Item *item, *before
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
before = _object_item_from_python(before_item)
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_genlist_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_genlist_item_insert_before( self.obj,
|
||||
&item_class.obj,
|
||||
<void*>ret,
|
||||
NULL,
|
||||
before,
|
||||
<Elm_Genlist_Item_Type>flags, cb,
|
||||
<void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
def item_insert_after( self,
|
||||
GenlistItemClass item_class not None,
|
||||
item_data,
|
||||
#API XXX: parent
|
||||
GenlistItem after_item=None,
|
||||
int flags=ELM_GENLIST_ITEM_NONE,
|
||||
func=None
|
||||
#API XXX: *args, **kwargs
|
||||
):
|
||||
cdef GenlistItem ret = GenlistItem()
|
||||
cdef Elm_Object_Item *item, *after
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
after = _object_item_from_python(after_item)
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _py_elm_genlist_item_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_genlist_item_insert_after(self.obj, &item_class.obj,
|
||||
<void*>ret,
|
||||
NULL,
|
||||
after,
|
||||
<Elm_Genlist_Item_Type>flags, cb,
|
||||
<void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
Py_DECREF(ret)
|
||||
return None
|
||||
|
||||
#Elm_Object_Item *elm_genlist_item_sorted_insert(self.obj, Elm_Genlist_Item_Class *itc, void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, void *func_data)
|
||||
|
||||
def selected_item_get(self):
|
||||
return _object_item_to_python(elm_genlist_selected_item_get(self.obj))
|
||||
|
||||
property selected_item:
|
||||
def __get__(self):
|
||||
return self.selected_item_get()
|
||||
|
||||
def selected_items_get(self):
|
||||
return _object_item_list_to_python(elm_genlist_selected_items_get(self.obj))
|
||||
|
||||
def realized_items_get(self):
|
||||
return _object_item_list_to_python(elm_genlist_realized_items_get(self.obj))
|
||||
|
||||
def first_item_get(self):
|
||||
return _object_item_to_python(elm_genlist_first_item_get(self.obj))
|
||||
|
||||
property first_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_genlist_first_item_get(self.obj))
|
||||
|
||||
def last_item_get(self):
|
||||
return _object_item_to_python(elm_genlist_last_item_get(self.obj))
|
||||
|
||||
property last_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_genlist_last_item_get(self.obj))
|
||||
|
||||
def scroller_policy_set(self, policy_h, policy_v):
|
||||
elm_scroller_policy_set(self.obj, policy_h, policy_v)
|
||||
|
||||
def scroller_policy_get(self):
|
||||
cdef Elm_Scroller_Policy policy_h, policy_v
|
||||
elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
|
||||
return (policy_h, policy_v)
|
||||
|
||||
def realized_items_update(self):
|
||||
elm_genlist_realized_items_update(self.obj)
|
||||
|
||||
def items_count(self):
|
||||
return elm_genlist_items_count(self.obj)
|
||||
|
||||
def homogeneous_set(self, homogeneous):
|
||||
elm_genlist_homogeneous_set(self.obj, bool(homogeneous))
|
||||
|
||||
def homogeneous_get(self):
|
||||
return bool(elm_genlist_homogeneous_get(self.obj))
|
||||
|
||||
def block_count_set(self, int n):
|
||||
elm_genlist_block_count_set(self.obj, n)
|
||||
|
||||
def block_count_get(self):
|
||||
return elm_genlist_block_count_get(self.obj)
|
||||
|
||||
def longpress_timeout_set(self, timeout):
|
||||
elm_genlist_longpress_timeout_set(self.obj, timeout)
|
||||
|
||||
def longpress_timeout_get(self):
|
||||
return elm_genlist_longpress_timeout_get(self.obj)
|
||||
|
||||
def at_xy_item_get(self, int x, int y):
|
||||
return _object_item_to_python(elm_genlist_at_xy_item_get(self.obj, x, y, NULL))
|
||||
|
||||
def decorated_item_get(self):
|
||||
return _object_item_to_python(elm_genlist_decorated_item_get(self.obj))
|
||||
|
||||
def reorder_mode_set(self, reorder_mode):
|
||||
elm_genlist_reorder_mode_set(self.obj, reorder_mode)
|
||||
|
||||
def reorder_mode_get(self):
|
||||
return bool(elm_genlist_reorder_mode_get(self.obj))
|
||||
|
||||
def decorate_mode_set(self, decorated):
|
||||
elm_genlist_decorate_mode_set(self.obj, decorated)
|
||||
|
||||
def decorate_mode_get(self):
|
||||
return bool(elm_genlist_decorate_mode_get(self.obj))
|
||||
|
||||
def tree_effect_enabled_set(self, enabled):
|
||||
elm_genlist_tree_effect_enabled_set(self.obj, enabled)
|
||||
|
||||
def tree_effect_enabled_get(self):
|
||||
return bool(elm_genlist_tree_effect_enabled_get(self.obj))
|
||||
|
||||
def highlight_mode_set(self, highlight):
|
||||
elm_genlist_highlight_mode_set(self.obj, highlight)
|
||||
|
||||
def highlight_mode_get(self):
|
||||
return bool(elm_genlist_highlight_mode_get(self.obj))
|
||||
|
||||
def select_mode_set(self, mode):
|
||||
elm_genlist_select_mode_set(self.obj, mode)
|
||||
|
||||
def select_mode_get(self):
|
||||
return elm_genlist_select_mode_get(self.obj)
|
||||
|
||||
def callback_activated_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("activated", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_activated_del(self, func):
|
||||
self._callback_del_full("activated", _cb_object_item_conv, func)
|
||||
|
||||
def callback_clicked_double_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("clicked,double", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_double_del(self, func):
|
||||
self._callback_del_full("clicked,double", _cb_object_item_conv, func)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("selected", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_unselected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("unselected", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_unselected_del(self, func):
|
||||
self._callback_del_full("unselected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_expanded_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("expanded", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_expanded_del(self, func):
|
||||
self._callback_del_full("expanded", _cb_object_item_conv, func)
|
||||
|
||||
def callback_contracted_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("contracted", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_contracted_del(self, func):
|
||||
self._callback_del_full("contracted", _cb_object_item_conv, func)
|
||||
|
||||
def callback_expand_request_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("expand,request", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_expand_request_del(self, func):
|
||||
self._callback_del_full("expand,request", _cb_object_item_conv, func)
|
||||
|
||||
def callback_contract_request_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("contract,request", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_contract_request_del(self, func):
|
||||
self._callback_del_full("contract,request", _cb_object_item_conv, func)
|
||||
|
||||
def callback_realized_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("realized", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_realized_del(self, func):
|
||||
self._callback_del_full("realized", _cb_object_item_conv, func)
|
||||
|
||||
def callback_unrealized_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("unrealized", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_unrealized_del(self, func):
|
||||
self._callback_del_full("unrealized", _cb_object_item_conv, func)
|
||||
|
||||
def callback_drag_start_up_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("drag,start,up", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_drag_start_up_del(self, func):
|
||||
self._callback_del_full("drag,start,up", _cb_object_item_conv, func)
|
||||
|
||||
def callback_drag_start_down_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("drag,start,down", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_drag_start_down_del(self, func):
|
||||
self._callback_del_full("drag,start,down", _cb_object_item_conv, func)
|
||||
|
||||
def callback_drag_start_left_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("drag,start,left", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_drag_start_left_del(self, func):
|
||||
self._callback_del_full("drag,start,left", _cb_object_item_conv, func)
|
||||
|
||||
def callback_drag_start_right_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("drag,start,right", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_drag_start_right_del(self, func):
|
||||
self._callback_del_full("drag,start,right", _cb_object_item_conv, func)
|
||||
|
||||
def callback_drag_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("drag,stop", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_drag_stop_del(self, func):
|
||||
self._callback_del_full("drag,stop", _cb_object_item_conv, func)
|
||||
|
||||
def callback_drag_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("drag", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_drag_del(self, func):
|
||||
self._callback_del_full("drag", _cb_object_item_conv, func)
|
||||
|
||||
def callback_longpressed_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("longpressed", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_longpressed_del(self, func):
|
||||
self._callback_del_full("longpressed", _cb_object_item_conv, func)
|
||||
|
||||
def callback_scroll_anim_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_start_del(self, func):
|
||||
self._callback_del("scroll,anim,start", func)
|
||||
|
||||
def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_stop_del(self, func):
|
||||
self._callback_del("scroll,anim,stop", func)
|
||||
|
||||
def callback_scroll_drag_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_start_del(self, func):
|
||||
self._callback_del("scroll,drag,start", func)
|
||||
|
||||
def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_stop_del(self, func):
|
||||
self._callback_del("scroll,drag,stop", func)
|
||||
|
||||
def callback_edge_top_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,top", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_top_del(self, func):
|
||||
self._callback_del("edge,top", func)
|
||||
|
||||
def callback_edge_bottom_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,bottom", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_bottom_del(self, func):
|
||||
self._callback_del("edge,bottom", func)
|
||||
|
||||
def callback_edge_left_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,left", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_left_del(self, func):
|
||||
self._callback_del("edge,left", func)
|
||||
|
||||
def callback_edge_right_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,right", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_right_del(self, func):
|
||||
self._callback_del("edge,right", func)
|
||||
|
||||
def callback_multi_swipe_left_add(self, func, *args, **kwargs):
|
||||
self._callback_add("multi,swipe,left", func, *args, **kwargs)
|
||||
|
||||
def callback_multi_swipe_left_del(self, func):
|
||||
self._callback_del("multi,swipe,left", func)
|
||||
|
||||
def callback_multi_swipe_right_add(self, func, *args, **kwargs):
|
||||
self._callback_add("multi,swipe,right", func, *args, **kwargs)
|
||||
|
||||
def callback_multi_swipe_right_del(self, func):
|
||||
self._callback_del("multi,swipe,right", func)
|
||||
|
||||
def callback_multi_swipe_up_add(self, func, *args, **kwargs):
|
||||
self._callback_add("multi,swipe,up", func, *args, **kwargs)
|
||||
|
||||
def callback_multi_swipe_up_del(self, func):
|
||||
self._callback_del("multi,swipe,up", func)
|
||||
|
||||
def callback_multi_swipe_down_add(self, func, *args, **kwargs):
|
||||
self._callback_add("multi,swipe,down", func, *args, **kwargs)
|
||||
|
||||
def callback_multi_swipe_down_del(self, func):
|
||||
self._callback_del("multi,swipe,down", func)
|
||||
|
||||
def callback_multi_pinch_out_add(self, func, *args, **kwargs):
|
||||
self._callback_add("multi,pinch,out", func, *args, **kwargs)
|
||||
|
||||
def callback_multi_pinch_out_del(self, func):
|
||||
self._callback_del("multi,pinch,out", func)
|
||||
|
||||
def callback_multi_pinch_in_add(self, func, *args, **kwargs):
|
||||
self._callback_add("multi,pinch,in", func, *args, **kwargs)
|
||||
|
||||
def callback_multi_pinch_in_del(self, func):
|
||||
self._callback_del("multi,pinch,in", func)
|
||||
|
||||
def callback_swipe_add(self, func, *args, **kwargs):
|
||||
self._callback_add("swipe", func, *args, **kwargs)
|
||||
|
||||
def callback_swipe_del(self, func):
|
||||
self._callback_del("swipe", func)
|
||||
|
||||
def callback_moved_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("moved", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_moved_del(self, func):
|
||||
self._callback_del_full("moved", _cb_object_item_conv, func)
|
||||
|
||||
def callback_moved_after_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("moved,after", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_moved_after_del(self, func):
|
||||
self._callback_del_full("moved,after", _cb_object_item_conv, func)
|
||||
|
||||
def callback_moved_before_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("moved,before", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_moved_before_del(self, func):
|
||||
self._callback_del_full("moved,before", _cb_object_item_conv, func)
|
||||
|
||||
def callback_language_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
def callback_tree_effect_finished_add(self, func, *args, **kwargs):
|
||||
self._callback_add("tree,effect,finished", func, *args, **kwargs)
|
||||
|
||||
def callback_tree_effect_finished_del(self, func):
|
||||
self._callback_del("tree,effect,finished", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_genlist", Genlist)
|
|
@ -1,74 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
from efl.evas import EVAS_EVENT_FLAG_NONE
|
||||
|
||||
cdef Evas_Event_Flags _gesture_layer_event_cb(void *data, void *event_info) with gil:
|
||||
try:
|
||||
(callback, args, kwargs) = <object>data
|
||||
ret = callback(args, kwargs)
|
||||
if ret is not None:
|
||||
return <Evas_Event_Flags>ret
|
||||
else:
|
||||
return EVAS_EVENT_FLAG_NONE
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return EVAS_EVENT_FLAG_NONE
|
||||
|
||||
|
||||
cdef class GestureLayer(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_gesture_layer_add(parent.obj))
|
||||
|
||||
def cb_set(self, Elm_Gesture_Type idx, callback, Elm_Gesture_State cb_type, *args, **kwargs):
|
||||
cdef Elm_Gesture_Event_Cb cb = NULL
|
||||
|
||||
if callback:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _gesture_layer_event_cb
|
||||
|
||||
data = (callback, args, kwargs)
|
||||
elm_gesture_layer_cb_set(self.obj, idx, cb_type, cb, <void *>data)
|
||||
|
||||
property hold_events:
|
||||
def __get__(self):
|
||||
return bool(elm_gesture_layer_hold_events_get(self.obj))
|
||||
|
||||
def __set__(self, hold_events):
|
||||
elm_gesture_layer_hold_events_set(self.obj, hold_events)
|
||||
|
||||
property zoom_step:
|
||||
def __set__(self, step):
|
||||
elm_gesture_layer_zoom_step_set(self.obj, step)
|
||||
|
||||
def __get__(self):
|
||||
return elm_gesture_layer_zoom_step_get(self.obj)
|
||||
|
||||
property rotate_step:
|
||||
def __set__(self, step):
|
||||
elm_gesture_layer_rotate_step_set(self.obj, step)
|
||||
|
||||
def __get__(self):
|
||||
return elm_gesture_layer_rotate_step_get(self.obj)
|
||||
|
||||
def attach(self, evasObject target):
|
||||
return bool(elm_gesture_layer_attach(self.obj, target.obj))
|
||||
|
||||
|
||||
_object_mapping_register("elm_gesture_layer", GestureLayer)
|
|
@ -1,68 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Grid(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
# Object.__init__(self, parent.evas)
|
||||
self._set_obj(elm_grid_add(parent.obj))
|
||||
|
||||
def size_set(self, w, h):
|
||||
elm_grid_size_set(self.obj, w, h)
|
||||
|
||||
def size_get(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_grid_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
property size:
|
||||
def __set__(self, value):
|
||||
w, h = value
|
||||
elm_grid_size_set(self.obj, w, h)
|
||||
|
||||
def __get__(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_grid_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
def pack(self, evasObject subobj, x, y, w, h):
|
||||
elm_grid_pack(self.obj, subobj.obj, x, y, w, h)
|
||||
|
||||
def unpack(self, evasObject subobj):
|
||||
elm_grid_unpack(self.obj, subobj.obj)
|
||||
|
||||
def clear(self, clear):
|
||||
elm_grid_clear(self.obj, clear)
|
||||
|
||||
def pack_set(self, evasObject subobj, x, y, w, h):
|
||||
elm_grid_pack_set(subobj.obj, x, y, w, h)
|
||||
|
||||
def pack_get(self, evasObject subobj):
|
||||
cdef Evas_Coord x, y, w, h
|
||||
elm_grid_pack_get(subobj.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
def children_get(self):
|
||||
return _object_list_to_python(elm_box_children_get(self.obj))
|
||||
|
||||
property children:
|
||||
def __get__(self):
|
||||
return _object_list_to_python(elm_box_children_get(self.obj))
|
||||
|
||||
|
||||
_object_mapping_register("elm_grid", Grid)
|
|
@ -1,72 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Hover(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent, obj = None):
|
||||
# TODO is this right ??
|
||||
if obj is None:
|
||||
self._set_obj(elm_hover_add(parent.obj))
|
||||
else:
|
||||
self._set_obj(<Evas_Object*>obj)
|
||||
|
||||
def target_set(self, evasObject target):
|
||||
elm_hover_target_set(self.obj, target.obj)
|
||||
|
||||
def target_get(self):
|
||||
return object_from_instance(elm_hover_target_get(self.obj))
|
||||
|
||||
property target:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_hover_target_get(self.obj))
|
||||
def __set__(self, evasObject target):
|
||||
elm_hover_target_set(self.obj, target.obj)
|
||||
|
||||
def parent_set(self, evasObject parent):
|
||||
elm_hover_parent_set(self.obj, parent.obj)
|
||||
|
||||
def parent_get(self):
|
||||
return object_from_instance(elm_hover_parent_get(self.obj))
|
||||
|
||||
property parent:
|
||||
def __set__(self, evasObject parent):
|
||||
elm_hover_parent_set(self.obj, parent.obj)
|
||||
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_hover_parent_get(self.obj))
|
||||
|
||||
def best_content_location_get(self, axis):
|
||||
return _ctouni(elm_hover_best_content_location_get(self.obj, axis))
|
||||
|
||||
def dismiss(self):
|
||||
elm_hover_dismiss(self.obj)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_smart_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("smart,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_smart_changed_del(self, func):
|
||||
self._callback_del("smart,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_hover", Hover)
|
|
@ -1,141 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class HoverselItem(ObjectItem):
|
||||
|
||||
def __init__(self, evasObject hoversel, label, icon_file, icon_type,
|
||||
callback, *args, **kargs):
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
|
||||
if callback:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
self.params = (callback, args, kargs)
|
||||
item = elm_hoversel_item_add( hoversel.obj,
|
||||
_cfruni(label) if label is not None else NULL,
|
||||
_cfruni(icon_file) if icon_file is not None else NULL,
|
||||
icon_type,
|
||||
cb,
|
||||
<void*>self)
|
||||
|
||||
if item != NULL:
|
||||
self._set_obj(item)
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
def icon_set(self, icon_file, icon_group, icon_type):
|
||||
elm_hoversel_item_icon_set(self.item, _cfruni(icon_file), _cfruni(icon_group), icon_type)
|
||||
|
||||
def icon_get(self):
|
||||
cdef const_char_ptr cicon_file, cicon_group
|
||||
cdef Elm_Icon_Type cicon_type
|
||||
elm_hoversel_item_icon_get(self.item, &cicon_file, &cicon_group, &cicon_type)
|
||||
return (_ctouni(cicon_file), _ctouni(cicon_group), cicon_type)
|
||||
|
||||
property icon:
|
||||
def __set__(self, value):
|
||||
icon_file, icon_group, icon_type = value
|
||||
elm_hoversel_item_icon_set(self.item, _cfruni(icon_file), _cfruni(icon_group), icon_type)
|
||||
|
||||
def __get__(self):
|
||||
cdef const_char_ptr cicon_file, cicon_group
|
||||
cdef Elm_Icon_Type cicon_type
|
||||
elm_hoversel_item_icon_get(self.item, &cicon_file, &cicon_group, &cicon_type)
|
||||
return (_ctouni(cicon_file), _ctouni(cicon_group), cicon_type)
|
||||
|
||||
|
||||
cdef class Hoversel(Button):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
# Object.__init__(self, parent.evas)
|
||||
self._set_obj(elm_hoversel_add(parent.obj))
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_hoversel_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_get(self):
|
||||
return bool(elm_hoversel_horizontal_get(self.obj))
|
||||
|
||||
property horizontal:
|
||||
def __set__(self, horizontal):
|
||||
elm_hoversel_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def __get__(self):
|
||||
return bool(elm_hoversel_horizontal_get(self.obj))
|
||||
|
||||
def hover_parent_set(self, evasObject parent):
|
||||
elm_hoversel_hover_parent_set(self.obj, parent.obj)
|
||||
|
||||
def hover_parent_get(self):
|
||||
return object_from_instance(elm_hoversel_hover_parent_get(self.obj))
|
||||
|
||||
property hover_parent:
|
||||
def __set__(self, evasObject parent):
|
||||
elm_hoversel_hover_parent_set(self.obj, parent.obj)
|
||||
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_hoversel_hover_parent_get(self.obj))
|
||||
|
||||
def hover_begin(self):
|
||||
elm_hoversel_hover_begin(self.obj)
|
||||
|
||||
def hover_end(self):
|
||||
elm_hoversel_hover_end(self.obj)
|
||||
|
||||
def expanded_get(self):
|
||||
return bool(elm_hoversel_expanded_get(self.obj))
|
||||
|
||||
property expanded:
|
||||
def __get__(self):
|
||||
return bool(elm_hoversel_expanded_get(self.obj))
|
||||
|
||||
def clear(self):
|
||||
elm_hoversel_clear(self.obj)
|
||||
|
||||
def items_get(self):
|
||||
return _object_item_list_to_python(elm_hoversel_items_get(self.obj))
|
||||
|
||||
property items:
|
||||
def __get__(self):
|
||||
return _object_item_list_to_python(elm_hoversel_items_get(self.obj))
|
||||
|
||||
def item_add(self, label = None, icon_file = None, icon_type = ELM_ICON_NONE, callback = None, *args, **kwargs):
|
||||
return HoverselItem(self, label, icon_file, icon_type, callback, *args, **kwargs)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("selected", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_dismissed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("dismissed", func, *args, **kwargs)
|
||||
|
||||
def callback_dismissed_del(self, func):
|
||||
self._callback_del("dismissed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_hoversel", Hoversel)
|
|
@ -1,78 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Icon(Image):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_icon_add(parent.obj))
|
||||
|
||||
def thumb_set(self, filename, group = None):
|
||||
if group == None:
|
||||
elm_icon_thumb_set(self.obj, _cfruni(filename), NULL)
|
||||
else:
|
||||
elm_icon_thumb_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
|
||||
property thumb:
|
||||
def __set__(self, value):
|
||||
if isinstance(value, tuple):
|
||||
filename, group = value
|
||||
else:
|
||||
filename = value
|
||||
group = None
|
||||
# TODO: check return value
|
||||
elm_icon_thumb_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
|
||||
def standard_set(self, name):
|
||||
return bool(elm_icon_standard_set(self.obj, _cfruni(name)))
|
||||
|
||||
def standard_get(self):
|
||||
return _ctouni(elm_icon_standard_get(self.obj))
|
||||
|
||||
property standard:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_icon_standard_get(self.obj))
|
||||
def __set__(self, name):
|
||||
# TODO: check return value
|
||||
elm_icon_standard_set(self.obj, _cfruni(name))
|
||||
|
||||
def order_lookup_set(self, order):
|
||||
elm_icon_order_lookup_set(self.obj, order)
|
||||
|
||||
def order_lookup_get(self):
|
||||
return elm_icon_order_lookup_get(self.obj)
|
||||
|
||||
property order_lookup:
|
||||
def __get__(self):
|
||||
return elm_icon_order_lookup_get(self.obj)
|
||||
def __set__(self, order):
|
||||
elm_icon_order_lookup_set(self.obj, order)
|
||||
|
||||
def callback_thumb_done_add(self, func, *args, **kwargs):
|
||||
self._callback_add("thumb,done", func, *args, **kwargs)
|
||||
|
||||
def callback_thumb_done_del(self, func):
|
||||
self._callback_del("thumb,done", func)
|
||||
|
||||
def callback_thumb_error_add(self, func, *args, **kwargs):
|
||||
self._callback_add("thumb,error", func, *args, **kwargs)
|
||||
|
||||
def callback_thumb_error_del(self, func):
|
||||
self._callback_del("thumb,error", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_icon", Icon)
|
|
@ -1,227 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Image(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_image_add(parent.obj))
|
||||
|
||||
#def memfile_set(self, img, size, format, key):
|
||||
#return bool(elm_image_memfile_set(self.obj, img, size, _cfruni(format), _cfruni(key)))
|
||||
|
||||
def file_set(self, filename, group = None):
|
||||
if group == None:
|
||||
elm_image_file_set(self.obj, _cfruni(filename), NULL)
|
||||
else:
|
||||
elm_image_file_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
|
||||
def file_get(self):
|
||||
cdef const_char_ptr filename, group
|
||||
elm_image_file_get(self.obj, &filename, &group)
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
property file:
|
||||
def __set__(self, value):
|
||||
if isinstance(value, tuple):
|
||||
filename, group = value
|
||||
else:
|
||||
filename = value
|
||||
group = None
|
||||
# TODO: check return value
|
||||
elm_image_file_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
|
||||
def __get__(self):
|
||||
cdef const_char_ptr filename, group
|
||||
elm_image_file_get(self.obj, &filename, &group)
|
||||
return (_ctouni(filename), _ctouni(group))
|
||||
|
||||
def smooth_set(self, smooth):
|
||||
elm_image_smooth_set(self.obj, smooth)
|
||||
|
||||
def smooth_get(self):
|
||||
return bool(elm_image_smooth_get(self.obj))
|
||||
|
||||
property smooth:
|
||||
def __get__(self):
|
||||
return bool(elm_image_smooth_get(self.obj))
|
||||
|
||||
def __set__(self, smooth):
|
||||
elm_image_smooth_set(self.obj, smooth)
|
||||
|
||||
def object_size_get(self):
|
||||
cdef int width, height
|
||||
elm_image_object_size_get(self.obj, &width, &height)
|
||||
return (width, height)
|
||||
|
||||
property object_size:
|
||||
def __get__(self):
|
||||
cdef int width, height
|
||||
elm_image_object_size_get(self.obj, &width, &height)
|
||||
return (width, height)
|
||||
|
||||
def no_scale_set(self, no_scale):
|
||||
elm_image_no_scale_set(self.obj, no_scale)
|
||||
|
||||
def no_scale_get(self):
|
||||
return bool(elm_image_no_scale_get(self.obj))
|
||||
|
||||
property no_scale:
|
||||
def __get__(self):
|
||||
return bool(elm_image_no_scale_get(self.obj))
|
||||
def __set__(self, no_scale):
|
||||
elm_image_no_scale_set(self.obj, no_scale)
|
||||
|
||||
def resizable_set(self, size_up, size_down):
|
||||
elm_image_resizable_set(self.obj, size_up, size_down)
|
||||
|
||||
def resizable_get(self):
|
||||
cdef Eina_Bool size_up, size_down
|
||||
elm_image_resizable_get(self.obj, &size_up, &size_down)
|
||||
return (size_up, size_down)
|
||||
|
||||
property resizable:
|
||||
def __get__(self):
|
||||
cdef Eina_Bool size_up, size_down
|
||||
elm_image_resizable_get(self.obj, &size_up, &size_down)
|
||||
return (size_up, size_down)
|
||||
|
||||
def __set__(self, value):
|
||||
size_up, size_down = value
|
||||
elm_image_resizable_set(self.obj, size_up, size_down)
|
||||
|
||||
def fill_outside_set(self, fill_outside):
|
||||
elm_image_fill_outside_set(self.obj, fill_outside)
|
||||
|
||||
def fill_outside_get(self):
|
||||
return bool(elm_image_fill_outside_get(self.obj))
|
||||
|
||||
property fill_outside:
|
||||
def __get__(self):
|
||||
return bool(elm_image_fill_outside_get(self.obj))
|
||||
|
||||
def __set__(self, fill_outside):
|
||||
elm_image_fill_outside_set(self.obj, fill_outside)
|
||||
|
||||
def preload_disabled_set(self, disabled):
|
||||
elm_image_preload_disabled_set(self.obj, disabled)
|
||||
|
||||
property preload_disabled:
|
||||
def __set__(self, disabled):
|
||||
elm_image_preload_disabled_set(self.obj, disabled)
|
||||
|
||||
def prescale_set(self, size):
|
||||
elm_image_prescale_set(self.obj, size)
|
||||
|
||||
def prescale_get(self):
|
||||
return elm_image_prescale_get(self.obj)
|
||||
|
||||
property prescale:
|
||||
def __get__(self):
|
||||
return elm_image_prescale_get(self.obj)
|
||||
def __set__(self, size):
|
||||
elm_image_prescale_set(self.obj, size)
|
||||
|
||||
def orient_set(self, orientation):
|
||||
elm_image_orient_set(self.obj, orientation)
|
||||
|
||||
def orient_get(self):
|
||||
return elm_image_orient_get(self.obj)
|
||||
|
||||
property orient:
|
||||
def __get__(self):
|
||||
return elm_image_orient_get(self.obj)
|
||||
def __set__(self, orientation):
|
||||
elm_image_orient_set(self.obj, orientation)
|
||||
|
||||
def editable_set(self, editable):
|
||||
elm_image_editable_set(self.obj, editable)
|
||||
|
||||
def editable_get(self):
|
||||
return bool(elm_image_editable_get(self.obj))
|
||||
|
||||
property editable:
|
||||
def __get__(self):
|
||||
return bool(elm_image_editable_get(self.obj))
|
||||
def __set__(self, editable):
|
||||
elm_image_editable_set(self.obj, editable)
|
||||
|
||||
def object_get(self):
|
||||
return object_from_instance(elm_image_object_get(self.obj))
|
||||
|
||||
property object:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_image_object_get(self.obj))
|
||||
|
||||
def aspect_fixed_set(self, fixed):
|
||||
elm_image_aspect_fixed_set(self.obj, fixed)
|
||||
|
||||
def aspect_fixed_get(self):
|
||||
return bool(elm_image_aspect_fixed_get(self.obj))
|
||||
|
||||
property aspect_fixed:
|
||||
def __get__(self):
|
||||
return bool(elm_image_aspect_fixed_get(self.obj))
|
||||
def __set__(self, fixed):
|
||||
elm_image_aspect_fixed_set(self.obj, fixed)
|
||||
|
||||
def animated_available_get(self):
|
||||
return bool(elm_image_animated_available_get(self.obj))
|
||||
|
||||
property animated_available:
|
||||
def __get__(self):
|
||||
return bool(elm_image_animated_available_get(self.obj))
|
||||
|
||||
def animated_set(self, animated):
|
||||
elm_image_animated_set(self.obj, animated)
|
||||
|
||||
def animated_get(self):
|
||||
return bool(elm_image_animated_get(self.obj))
|
||||
|
||||
property animated:
|
||||
def __get__(self):
|
||||
return bool(elm_image_animated_get(self.obj))
|
||||
def __set__(self, animated):
|
||||
elm_image_animated_set(self.obj, animated)
|
||||
|
||||
def animated_play_set(self, play):
|
||||
elm_image_animated_play_set(self.obj, play)
|
||||
|
||||
def animated_play_get(self):
|
||||
return bool(elm_image_animated_play_get(self.obj))
|
||||
|
||||
property animated_play:
|
||||
|
||||
def __get__(self):
|
||||
return bool(elm_image_animated_play_get(self.obj))
|
||||
def __set__(self, play):
|
||||
elm_image_animated_play_set(self.obj, play)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_drop_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("drop", _cb_string_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_drop_del(self, func):
|
||||
self._callback_del_full("drop", _cb_string_conv, func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_image", Image)
|
|
@ -1,192 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef enum Elm_Index_Item_Insert_Kind:
|
||||
ELM_INDEX_ITEM_INSERT_APPEND
|
||||
ELM_INDEX_ITEM_INSERT_PREPEND
|
||||
ELM_INDEX_ITEM_INSERT_BEFORE
|
||||
ELM_INDEX_ITEM_INSERT_AFTER
|
||||
ELM_INDEX_ITEM_INSERT_SORTED
|
||||
|
||||
|
||||
cdef class IndexItem(ObjectItem):
|
||||
def __init__(self, kind, evasObject index, letter, IndexItem before_after = None,
|
||||
callback = None, *args, **kargs):
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
self.params = (callback, args, kargs)
|
||||
|
||||
if kind == ELM_INDEX_ITEM_INSERT_APPEND:
|
||||
item = elm_index_item_append(index.obj, _cfruni(letter), cb, <void*>self)
|
||||
elif kind == ELM_INDEX_ITEM_INSERT_PREPEND:
|
||||
item = elm_index_item_prepend(index.obj, _cfruni(letter), cb, <void*>self)
|
||||
#elif kind == ELM_INDEX_ITEM_INSERT_SORTED:
|
||||
#item = elm_index_item_sorted_insert(index.obj, _cfruni(letter), cb, <void*>self, cmp_f, cmp_data_f)
|
||||
else:
|
||||
if before_after == None:
|
||||
raise ValueError("need a valid after object to add an item before/after another item")
|
||||
if kind == ELM_INDEX_ITEM_INSERT_BEFORE:
|
||||
item = elm_index_item_insert_before(index.obj, before_after.item, _cfruni(letter), cb, <void*>self)
|
||||
else:
|
||||
item = elm_index_item_insert_after(index.obj, before_after.item, _cfruni(letter), cb, <void*>self)
|
||||
|
||||
if item != NULL:
|
||||
self._set_obj(item)
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
def selected_set(self, selected):
|
||||
elm_index_item_selected_set(self.item, selected)
|
||||
|
||||
property selected:
|
||||
def __set__(self, selected):
|
||||
elm_index_item_selected_set(self.item, selected)
|
||||
|
||||
def letter_get(self):
|
||||
return _ctouni(elm_index_item_letter_get(self.item))
|
||||
|
||||
property letter:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_index_item_letter_get(self.item))
|
||||
|
||||
|
||||
cdef class Index(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_index_add(parent.obj))
|
||||
|
||||
def autohide_disabled_set(self, disabled):
|
||||
elm_index_autohide_disabled_set(self.obj, disabled)
|
||||
|
||||
def autohide_disabled_get(self):
|
||||
return bool(elm_index_autohide_disabled_get(self.obj))
|
||||
|
||||
property autohide_disabled:
|
||||
def __get__(self):
|
||||
return bool(elm_index_autohide_disabled_get(self.obj))
|
||||
|
||||
def __set__(self, disabled):
|
||||
elm_index_autohide_disabled_set(self.obj, disabled)
|
||||
|
||||
def item_level_set(self, level):
|
||||
elm_index_item_level_set(self.obj, level)
|
||||
|
||||
def item_level_get(self):
|
||||
return elm_index_item_level_get(self.obj)
|
||||
|
||||
property item_level:
|
||||
def __get__(self):
|
||||
return elm_index_item_level_get(self.obj)
|
||||
def __set__(self, level):
|
||||
elm_index_item_level_set(self.obj, level)
|
||||
|
||||
def selected_item_get(self, level):
|
||||
return _object_item_to_python(elm_index_selected_item_get(self.obj, level))
|
||||
|
||||
def item_append(self, letter, callback = None, *args, **kargs):
|
||||
return IndexItem(ELM_INDEX_ITEM_INSERT_APPEND, self, letter,
|
||||
None, callback, *args, **kargs)
|
||||
|
||||
def item_prepend(self, letter, callback = None, *args, **kargs):
|
||||
return IndexItem(ELM_INDEX_ITEM_INSERT_PREPEND, self, letter,
|
||||
None, callback, *args, **kargs)
|
||||
|
||||
def item_insert_after(self, IndexItem after, letter, callback = None, *args, **kargs):
|
||||
return IndexItem(ELM_INDEX_ITEM_INSERT_AFTER, self, letter,
|
||||
after, callback, *args, **kargs)
|
||||
|
||||
def item_insert_before(self, IndexItem before, letter, callback = None, *args, **kargs):
|
||||
return IndexItem(ELM_INDEX_ITEM_INSERT_BEFORE, self, letter,
|
||||
before, callback, *args, **kargs)
|
||||
|
||||
#def item_sorted_insert(self, letter, callback = None, *args, **kargs):
|
||||
#return IndexItem(ELM_INDEX_ITEM_INSERT_SORTED, self, letter,
|
||||
#None, callback, *args, **kargs)
|
||||
|
||||
def item_find(self, data):
|
||||
# XXX: This doesn't seem right.
|
||||
# return _object_item_to_python(elm_index_item_find(self.obj, <void*>data))
|
||||
pass
|
||||
|
||||
def item_clear(self):
|
||||
elm_index_item_clear(self.obj)
|
||||
|
||||
def level_go(self, level):
|
||||
elm_index_level_go(self.obj, level)
|
||||
|
||||
def indicator_disabled_set(self, disabled):
|
||||
elm_index_indicator_disabled_set(self.obj, disabled)
|
||||
|
||||
def indicator_disabled_get(self):
|
||||
return bool(elm_index_indicator_disabled_get(self.obj))
|
||||
|
||||
property indicator_disabled:
|
||||
def __get__(self):
|
||||
return bool(elm_index_indicator_disabled_get(self.obj))
|
||||
def __set__(self, disabled):
|
||||
elm_index_indicator_disabled_set(self.obj, disabled)
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_index_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_get(self):
|
||||
return bool(elm_index_horizontal_get(self.obj))
|
||||
|
||||
property horizontal:
|
||||
def __get__(self):
|
||||
return bool(elm_index_horizontal_get(self.obj))
|
||||
def __set__(self, horizontal):
|
||||
elm_index_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("changed", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del_full("changed", _cb_object_item_conv, func)
|
||||
|
||||
def callback_delay_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("delay,changed", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_delay_changed_del(self, func):
|
||||
self._callback_del_full("delay,changed", _cb_object_item_conv, func)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("selected", _cb_object_item_conv, func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_level_up_add(self, func, *args, **kwargs):
|
||||
self._callback_add("level,up", func, *args, **kwargs)
|
||||
|
||||
def callback_level_up_del(self, func):
|
||||
self._callback_del("level,up", func)
|
||||
|
||||
def callback_level_down_add(self, func, *args, **kwargs):
|
||||
self._callback_add("level,down", func, *args, **kwargs)
|
||||
|
||||
def callback_level_down_del(self, func):
|
||||
self._callback_del("level,down", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_index", Index)
|
|
@ -1,79 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Label(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_label_add(parent.obj))
|
||||
|
||||
def line_wrap_set(self, Elm_Wrap_Type wrap):
|
||||
elm_label_line_wrap_set(self.obj, wrap)
|
||||
|
||||
def line_wrap_get(self):
|
||||
return elm_label_line_wrap_get(self.obj)
|
||||
|
||||
property line_wrap:
|
||||
def __get__(self):
|
||||
return elm_label_line_wrap_get(self.obj)
|
||||
def __set__(self, wrap):
|
||||
elm_label_line_wrap_set(self.obj, wrap)
|
||||
|
||||
def wrap_width_set(self, int w):
|
||||
elm_label_wrap_width_set(self.obj, w)
|
||||
|
||||
def wrap_width_get(self):
|
||||
return elm_label_wrap_width_get(self.obj)
|
||||
|
||||
property wrap_width:
|
||||
def __get__(self):
|
||||
return elm_label_wrap_width_get(self.obj)
|
||||
def __set__(self, w):
|
||||
elm_label_wrap_width_set(self.obj, w)
|
||||
|
||||
def ellipsis_set(self, bool ellipsis):
|
||||
elm_label_ellipsis_set(self.obj, ellipsis)
|
||||
|
||||
def ellipsis_get(self):
|
||||
return elm_label_ellipsis_get(self.obj)
|
||||
|
||||
property ellipsis:
|
||||
def __get__(self):
|
||||
return elm_label_ellipsis_get(self.obj)
|
||||
def __set__(self, ellipsis):
|
||||
elm_label_ellipsis_set(self.obj, ellipsis)
|
||||
|
||||
def slide_duration_set(self, duration):
|
||||
elm_label_slide_duration_set(self.obj, duration)
|
||||
|
||||
def slide_duration_get(self):
|
||||
return elm_label_slide_duration_get(self.obj)
|
||||
|
||||
property slide_duration:
|
||||
def __get__(self):
|
||||
return elm_label_slide_duration_get(self.obj)
|
||||
def __set__(self, duration):
|
||||
elm_label_slide_duration_set(self.obj, duration)
|
||||
|
||||
def callback_language_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_label", Label)
|
|
@ -1,45 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Layout(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_layout_add(parent.obj))
|
||||
|
||||
def content_set(self, swallow, evasObject content):
|
||||
cdef Evas_Object *o
|
||||
if content is not None:
|
||||
o = content.obj
|
||||
else:
|
||||
o = NULL
|
||||
elm_layout_content_set(self.obj, _cfruni(swallow), o)
|
||||
|
||||
def content_get(self, swallow):
|
||||
return object_from_instance(elm_layout_content_get(self.obj, _cfruni(swallow)))
|
||||
|
||||
def content_unset(self, swallow):
|
||||
return object_from_instance(elm_layout_content_unset(self.obj, _cfruni(swallow)))
|
||||
|
||||
def text_set(self, part, text):
|
||||
elm_layout_text_set(self.obj, _cfruni(part), _cfruni(text))
|
||||
|
||||
def text_get(self, part):
|
||||
return _ctouni(elm_layout_text_get(self.obj, _cfruni(part)))
|
||||
|
||||
|
||||
_object_mapping_register("elm_layout", Layout)
|
|
@ -1,139 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class LayoutClass(Object):
|
||||
|
||||
def file_set(self, filename, group):
|
||||
return bool(elm_layout_file_set(self.obj, _cfruni(filename), _cfruni(group)))
|
||||
|
||||
property file:
|
||||
def __set__(self, value):
|
||||
filename, group = value
|
||||
# TODO: check return value
|
||||
elm_layout_file_set(self.obj, _cfruni(filename), _cfruni(group))
|
||||
|
||||
def theme_set(self, clas, group, style):
|
||||
return bool(elm_layout_theme_set(self.obj, _cfruni(clas), _cfruni(group), _cfruni(style)))
|
||||
|
||||
property theme:
|
||||
def __set__(self, theme):
|
||||
clas, group, style = theme
|
||||
# TODO: check return value
|
||||
elm_layout_theme_set(self.obj, _cfruni(clas), _cfruni(group), _cfruni(style))
|
||||
|
||||
def signal_emit(self, emission, source):
|
||||
elm_layout_signal_emit(self.obj, _cfruni(emission), _cfruni(source))
|
||||
|
||||
#def signal_callback_add(self, emission, source, func, data):
|
||||
#elm_layout_signal_callback_add(self.obj, _cfruni(emission), _cfruni(source), Edje_Signal_Cb func, voiddata)
|
||||
|
||||
#def signal_callback_del(self, emission, source, func):
|
||||
#elm_layout_signal_callback_del(self.obj, _cfruni(emission), _cfruni(source), Edje_Signal_Cb func)
|
||||
|
||||
def box_append(self, part, evasObject child):
|
||||
return bool(elm_layout_box_append(self.obj, _cfruni(part), child.obj))
|
||||
|
||||
def box_prepend(self, part, evasObject child):
|
||||
return bool(elm_layout_box_prepend(self.obj, _cfruni(part), child.obj))
|
||||
|
||||
def box_insert_before(self, part, evasObject child, evasObject reference):
|
||||
return bool(elm_layout_box_insert_before(self.obj, _cfruni(part), child.obj, reference.obj))
|
||||
|
||||
def box_insert_at(self, part, evasObject child, pos):
|
||||
return bool(elm_layout_box_insert_at(self.obj, _cfruni(part), child.obj, pos))
|
||||
|
||||
def box_remove(self, part, evasObject child):
|
||||
return object_from_instance(elm_layout_box_remove(self.obj, _cfruni(part), child.obj))
|
||||
|
||||
def box_remove_all(self, part, clear):
|
||||
return bool(elm_layout_box_remove_all(self.obj, _cfruni(part), clear))
|
||||
|
||||
def table_pack(self, part, evasObject child_obj, col, row, colspan, rowspan):
|
||||
return bool(elm_layout_table_pack(self.obj, _cfruni(part), child_obj.obj, col, row, colspan, rowspan))
|
||||
|
||||
def table_unpack(self, part, evasObject child_obj):
|
||||
return object_from_instance(elm_layout_table_unpack(self.obj, _cfruni(part), child_obj.obj))
|
||||
|
||||
def table_clear(self, part, clear):
|
||||
return bool(elm_layout_table_clear(self.obj, _cfruni(part), clear))
|
||||
|
||||
def edje_get(self):
|
||||
return object_from_instance(elm_layout_edje_get(self.obj))
|
||||
|
||||
property edje:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_layout_edje_get(self.obj))
|
||||
|
||||
def data_get(self, key):
|
||||
return _ctouni(elm_layout_data_get(self.obj, _cfruni(key)))
|
||||
|
||||
def sizing_eval(self):
|
||||
elm_layout_sizing_eval(self.obj)
|
||||
|
||||
def part_cursor_set(self, part_name, cursor):
|
||||
return bool(elm_layout_part_cursor_set(self.obj, _cfruni(part_name), _cfruni(cursor)))
|
||||
|
||||
def part_cursor_get(self, part_name):
|
||||
return _ctouni(elm_layout_part_cursor_get(self.obj, _cfruni(part_name)))
|
||||
|
||||
def part_cursor_unset(self, part_name):
|
||||
return bool(elm_layout_part_cursor_unset(self.obj, _cfruni(part_name)))
|
||||
|
||||
def part_cursor_style_set(self, part_name, style):
|
||||
return bool(elm_layout_part_cursor_style_set(self.obj, _cfruni(part_name), _cfruni(style)))
|
||||
|
||||
def part_cursor_style_get(self, part_name):
|
||||
return _ctouni(elm_layout_part_cursor_style_get(self.obj, _cfruni(part_name)))
|
||||
|
||||
def part_cursor_engine_only_set(self, part_name, engine_only):
|
||||
return bool(elm_layout_part_cursor_engine_only_set(self.obj, _cfruni(part_name), engine_only))
|
||||
|
||||
def part_cursor_engine_only_get(self, part_name):
|
||||
return bool(elm_layout_part_cursor_engine_only_get(self.obj, _cfruni(part_name)))
|
||||
|
||||
def icon_set(self, evasObject icon):
|
||||
elm_layout_icon_set(self.obj, icon.obj if icon else NULL)
|
||||
|
||||
def icon_get(self):
|
||||
return object_from_instance(elm_layout_icon_get(self.obj))
|
||||
|
||||
property icon:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_layout_icon_get(self.obj))
|
||||
|
||||
def __set__(self, evasObject icon):
|
||||
elm_layout_icon_set(self.obj, icon.obj if icon else NULL)
|
||||
|
||||
def end_set(self, evasObject end):
|
||||
elm_layout_end_set(self.obj, end.obj if end else NULL)
|
||||
|
||||
def end_get(self):
|
||||
return object_from_instance(elm_layout_end_get(self.obj))
|
||||
|
||||
property end:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_layout_end_get(self.obj))
|
||||
|
||||
def __set__(self, evasObject end):
|
||||
elm_layout_end_set(self.obj, end.obj if end else NULL)
|
||||
|
||||
def callback_theme_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("theme,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_theme_changed_del(self, func):
|
||||
self._callback_del("theme,changed", func)
|
|
@ -1,381 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef enum Elm_List_Item_Insert_Kind:
|
||||
ELM_LIST_ITEM_INSERT_APPEND
|
||||
ELM_LIST_ITEM_INSERT_PREPEND
|
||||
ELM_LIST_ITEM_INSERT_BEFORE
|
||||
ELM_LIST_ITEM_INSERT_AFTER
|
||||
ELM_LIST_ITEM_INSERT_SORTED
|
||||
|
||||
cdef class ListItem(ObjectItem):
|
||||
|
||||
def __init__(self, kind, evasObject list, label, evasObject icon = None,
|
||||
evasObject end = None, ListItem before_after = None,
|
||||
callback = None, *args, **kargs):
|
||||
|
||||
cdef Evas_Object* icon_obj = NULL
|
||||
cdef Evas_Object* end_obj = NULL
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
|
||||
if icon is not None:
|
||||
icon_obj = icon.obj
|
||||
if end is not None:
|
||||
end_obj = end.obj
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
self.params = (callback, args, kargs)
|
||||
|
||||
if kind == ELM_LIST_ITEM_INSERT_APPEND:
|
||||
item = elm_list_item_append( list.obj,
|
||||
_cfruni(label),
|
||||
icon_obj,
|
||||
end_obj,
|
||||
cb,
|
||||
<void*>self)
|
||||
|
||||
elif kind == ELM_LIST_ITEM_INSERT_PREPEND:
|
||||
item = elm_list_item_prepend( list.obj,
|
||||
_cfruni(label),
|
||||
icon_obj,
|
||||
end_obj,
|
||||
cb,
|
||||
<void*>self)
|
||||
|
||||
#elif kind == ELM_LIST_ITEM_INSERT_SORTED:
|
||||
#item = elm_list_item_sorted_insert( list.obj,
|
||||
#_cfruni(label),
|
||||
#icon_obj,
|
||||
#end_obj,
|
||||
#cb,
|
||||
#<void*>self,
|
||||
#cmp_f)
|
||||
|
||||
else:
|
||||
if before_after == None:
|
||||
raise ValueError("need a valid after object to add an item before/after another item")
|
||||
|
||||
if kind == ELM_LIST_ITEM_INSERT_BEFORE:
|
||||
item = elm_list_item_insert_before(list.obj,
|
||||
before_after.item,
|
||||
_cfruni(label),
|
||||
icon_obj,
|
||||
end_obj,
|
||||
cb,
|
||||
<void*>self)
|
||||
|
||||
else:
|
||||
item = elm_list_item_insert_after( list.obj,
|
||||
before_after.item,
|
||||
_cfruni(label),
|
||||
icon_obj,
|
||||
end_obj,
|
||||
cb,
|
||||
<void*>self)
|
||||
if item != NULL:
|
||||
self._set_obj(item)
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return ("%s(label=%r, icon=%s, end=%s, "
|
||||
"callback=%r, args=%r, kargs=%s)") % \
|
||||
(self.__class__.__name__, self.text_get(), bool(self.part_content_get("icon")),
|
||||
bool(self.part_content_get("end")), self.params[0], self.params[1], self.params[2])
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
|
||||
"label=%r, icon=%s, end=%s, "
|
||||
"callback=%r, args=%r, kargs=%s)") % \
|
||||
(self.__class__.__name__, <unsigned long><void *>self,
|
||||
PY_REFCOUNT(self), <unsigned long><void *>self.item,
|
||||
self.text_get(), bool(self.part_content_get("icon")),
|
||||
bool(self.part_content_get("end")), self.params[0], self.params[1], self.params[2])
|
||||
|
||||
def selected_set(self, selected):
|
||||
elm_list_item_selected_set(self.item, selected)
|
||||
|
||||
def selected_get(self):
|
||||
return bool(elm_list_item_selected_get(self.item))
|
||||
|
||||
property selected:
|
||||
def __get__(self):
|
||||
return bool(elm_list_item_selected_get(self.item))
|
||||
|
||||
def __set__(self, selected):
|
||||
elm_list_item_selected_set(self.item, selected)
|
||||
|
||||
def separator_set(self, separator):
|
||||
elm_list_item_separator_set(self.item, separator)
|
||||
|
||||
def separator_get(self):
|
||||
return bool(elm_list_item_separator_get(self.item))
|
||||
|
||||
property separator:
|
||||
def __get__(self):
|
||||
return bool(elm_list_item_separator_get(self.item))
|
||||
|
||||
def __set__(self, separator):
|
||||
elm_list_item_separator_set(self.item, separator)
|
||||
|
||||
def show(self):
|
||||
elm_list_item_show(self.item)
|
||||
|
||||
def bring_in(self):
|
||||
elm_list_item_bring_in(self.item)
|
||||
|
||||
def object_get(self):
|
||||
return object_from_instance(elm_list_item_object_get(self.item))
|
||||
|
||||
property object:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_list_item_object_get(self.item))
|
||||
|
||||
def prev_get(self):
|
||||
return _object_item_to_python(elm_list_item_prev(self.item))
|
||||
|
||||
property prev:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_list_item_prev(self.item))
|
||||
|
||||
def next_get(self):
|
||||
return _object_item_to_python(elm_list_item_next(self.item))
|
||||
|
||||
property next:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_list_item_next(self.item))
|
||||
|
||||
cdef class List(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_list_add(parent.obj))
|
||||
|
||||
def go(self):
|
||||
elm_list_go(self.obj)
|
||||
|
||||
def multi_select_set(self, multi):
|
||||
elm_list_multi_select_set(self.obj, multi)
|
||||
|
||||
def multi_select_get(self):
|
||||
return bool(elm_list_multi_select_get(self.obj))
|
||||
|
||||
property multi_select:
|
||||
def __get__(self):
|
||||
return elm_list_multi_select_get(self.obj)
|
||||
|
||||
def __set__(self, multi):
|
||||
elm_list_multi_select_set(self.obj, multi)
|
||||
|
||||
def mode_set(self, Elm_List_Mode mode):
|
||||
elm_list_mode_set(self.obj, mode)
|
||||
|
||||
def mode_get(self):
|
||||
return elm_list_mode_get(self.obj)
|
||||
|
||||
property mode:
|
||||
def __get__(self):
|
||||
return elm_list_mode_get(self.obj)
|
||||
|
||||
def __set__(self, Elm_List_Mode mode):
|
||||
elm_list_mode_set(self.obj, mode)
|
||||
|
||||
property horizontal:
|
||||
def __get__(self):
|
||||
return elm_list_horizontal_get(self.obj)
|
||||
|
||||
def __set__(self, horizontal):
|
||||
elm_list_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def select_mode_set(self, mode):
|
||||
elm_list_select_mode_set(self.obj, mode)
|
||||
|
||||
def select_mode_get(self):
|
||||
return elm_list_select_mode_get(self.obj)
|
||||
|
||||
property select_mode:
|
||||
def __set__(self, mode):
|
||||
elm_list_select_mode_set(self.obj, mode)
|
||||
|
||||
def __get__(self):
|
||||
return elm_list_select_mode_get(self.obj)
|
||||
|
||||
def bounce_set(self, h, v):
|
||||
elm_scroller_bounce_set(self.obj, h, v)
|
||||
|
||||
def bounce_get(self):
|
||||
cdef Eina_Bool h, v
|
||||
elm_scroller_bounce_get(self.obj, &h, &v)
|
||||
return (h, v)
|
||||
|
||||
property bounce:
|
||||
def __set__(self, value):
|
||||
h, v = value
|
||||
elm_scroller_bounce_set(self.obj, h, v)
|
||||
|
||||
def scroller_policy_set(self, policy_h, policy_v):
|
||||
elm_scroller_policy_set(self.obj, policy_h, policy_v)
|
||||
|
||||
def scroller_policy_get(self):
|
||||
cdef Elm_Scroller_Policy policy_h, policy_v
|
||||
elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
|
||||
return (policy_h, policy_v)
|
||||
|
||||
property scroller_policy:
|
||||
def __set__(self, value):
|
||||
policy_h, policy_v = value
|
||||
elm_scroller_policy_set(self.obj, policy_h, policy_v)
|
||||
|
||||
def __get__(self):
|
||||
cdef Elm_Scroller_Policy policy_h, policy_v
|
||||
elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
|
||||
return (policy_h, policy_v)
|
||||
|
||||
def item_append(self, label, evasObject icon = None,
|
||||
evasObject end = None, callback = None, *args, **kargs):
|
||||
return ListItem(ELM_LIST_ITEM_INSERT_APPEND, self, label, icon, end,
|
||||
None, callback, *args, **kargs)
|
||||
|
||||
def item_prepend(self, label, evasObject icon = None,
|
||||
evasObject end = None, callback = None, *args, **kargs):
|
||||
return ListItem(ELM_LIST_ITEM_INSERT_PREPEND, self, label, icon, end,
|
||||
None, callback, *args, **kargs)
|
||||
|
||||
def item_insert_before(self, ListItem before, label, evasObject icon = None,
|
||||
evasObject end = None, callback = None, *args, **kargs):
|
||||
return ListItem(ELM_LIST_ITEM_INSERT_BEFORE, self, label, icon, end,
|
||||
before, callback, *args, **kargs)
|
||||
|
||||
def item_insert_after(self, ListItem after, label, evasObject icon = None,
|
||||
evasObject end = None, callback = None, *args, **kargs):
|
||||
return ListItem(ELM_LIST_ITEM_INSERT_AFTER, self, label, icon, end,
|
||||
after, callback, *args, **kargs)
|
||||
|
||||
#def item_sorted_insert(self, label, evasObject icon = None,
|
||||
#evasObject end = None, callback = None, cmp_func=None, *args, **kargs):
|
||||
#return ListItem(ELM_LIST_ITEM_INSERT_SORTED, self, label, icon, end,
|
||||
#None, callback, *args, **kargs)
|
||||
|
||||
def clear(self):
|
||||
elm_list_clear(self.obj)
|
||||
|
||||
def items_get(self):
|
||||
return _object_item_list_to_python(elm_list_items_get(self.obj))
|
||||
|
||||
property items:
|
||||
def __get__(self):
|
||||
return _object_item_list_to_python(elm_list_items_get(self.obj))
|
||||
|
||||
def selected_item_get(self):
|
||||
return _object_item_to_python(elm_list_selected_item_get(self.obj))
|
||||
|
||||
property selected_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_list_selected_item_get(self.obj))
|
||||
|
||||
def selected_items_get(self):
|
||||
return _object_item_list_to_python(elm_list_selected_items_get(self.obj))
|
||||
|
||||
property selected_items:
|
||||
def __get__(self):
|
||||
return _object_item_list_to_python(elm_list_selected_items_get(self.obj))
|
||||
|
||||
def first_item_get(self):
|
||||
return _object_item_to_python(elm_list_first_item_get(self.obj))
|
||||
|
||||
property first_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_list_first_item_get(self.obj))
|
||||
|
||||
def last_item_get(self):
|
||||
return _object_item_to_python(elm_list_last_item_get(self.obj))
|
||||
|
||||
property last_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_list_last_item_get(self.obj))
|
||||
|
||||
def callback_activated_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("activated", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_activated_del(self, func):
|
||||
self._callback_del_full("activated", _cb_object_item_conv, func)
|
||||
|
||||
def callback_clicked_double_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("clicked,double", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_double_del(self, func):
|
||||
self._callback_del_full("clicked,double", _cb_object_item_conv, func)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("selected", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_unselected_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("unselected", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_unselected_del(self, func):
|
||||
self._callback_del_full("unselected", _cb_object_item_conv, func)
|
||||
|
||||
def callback_longpressed_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("longpressed", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_longpressed_del(self, func):
|
||||
self._callback_del_full("longpressed", _cb_object_item_conv, func)
|
||||
|
||||
def callback_edge_top_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,top", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_top_del(self, func):
|
||||
self._callback_del("edge,top", func)
|
||||
|
||||
def callback_edge_bottom_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,bottom", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_bottom_del(self, func):
|
||||
self._callback_del("edge,bottom", func)
|
||||
|
||||
def callback_edge_left_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,left", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_left_del(self, func):
|
||||
self._callback_del("edge,left", func)
|
||||
|
||||
def callback_edge_right_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,right", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_right_del(self, func):
|
||||
self._callback_del("edge,right", func)
|
||||
|
||||
def callback_language_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_list", List)
|
|
@ -1,189 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class NaviframeItem(ObjectItem):
|
||||
|
||||
def item_pop_to(self):
|
||||
_METHOD_DEPRECATED(self, "pop_to")
|
||||
elm_naviframe_item_pop_to(self.item)
|
||||
|
||||
def pop_to(self):
|
||||
elm_naviframe_item_pop_to(self.item)
|
||||
|
||||
def item_promote(self):
|
||||
_METHOD_DEPRECATED(self, "promote")
|
||||
elm_naviframe_item_promote(self.item)
|
||||
|
||||
def promote(self):
|
||||
elm_naviframe_item_promote(self.item)
|
||||
|
||||
def style_set(self, style):
|
||||
elm_naviframe_item_style_set(self.item, _cfruni(style))
|
||||
|
||||
def style_get(self):
|
||||
return _ctouni(elm_naviframe_item_style_get(self.item))
|
||||
|
||||
property style:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_naviframe_item_style_get(self.item))
|
||||
def __set__(self, style):
|
||||
elm_naviframe_item_style_set(self.item, _cfruni(style))
|
||||
|
||||
def title_visible_set(self, visible):
|
||||
elm_naviframe_item_title_visible_set(self.item, visible)
|
||||
|
||||
def title_visible_get(self):
|
||||
return bool(elm_naviframe_item_title_visible_get(self.item))
|
||||
|
||||
property title_visible:
|
||||
def __get__(self):
|
||||
return bool(elm_naviframe_item_title_visible_get(self.item))
|
||||
def __set__(self, visible):
|
||||
elm_naviframe_item_title_visible_set(self.item, visible)
|
||||
|
||||
|
||||
cdef class Naviframe(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_naviframe_add(parent.obj))
|
||||
|
||||
def item_push(self, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
|
||||
cdef NaviframeItem ret = NaviframeItem()
|
||||
cdef Elm_Object_Item *item
|
||||
|
||||
item = elm_naviframe_item_push(self.obj, _cfruni(title_label),
|
||||
prev_btn.obj if prev_btn else NULL,
|
||||
next_btn.obj if next_btn else NULL,
|
||||
content.obj if content else NULL,
|
||||
_cfruni(item_style) if item_style else NULL)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def item_insert_before(self, NaviframeItem before, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
|
||||
cdef NaviframeItem ret = NaviframeItem()
|
||||
cdef Elm_Object_Item *item
|
||||
|
||||
item = elm_naviframe_item_insert_before(self.obj, before.item, _cfruni(title_label), prev_btn.obj, next_btn.obj, content.obj, _cfruni(item_style))
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def item_insert_after(self, NaviframeItem after, title_label, evasObject prev_btn, evasObject next_btn, evasObject content, const_char_ptr item_style):
|
||||
cdef NaviframeItem ret = NaviframeItem()
|
||||
cdef Elm_Object_Item *item
|
||||
|
||||
item = elm_naviframe_item_insert_after(self.obj, after.item, _cfruni(title_label), prev_btn.obj, next_btn.obj, content.obj, _cfruni(item_style))
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def item_pop(self):
|
||||
return object_from_instance(elm_naviframe_item_pop(self.obj))
|
||||
|
||||
def content_preserve_on_pop_set(self, preserve):
|
||||
elm_naviframe_content_preserve_on_pop_set(self.obj, preserve)
|
||||
|
||||
def content_preserve_on_pop_get(self):
|
||||
return bool(elm_naviframe_content_preserve_on_pop_get(self.obj))
|
||||
|
||||
property content_preserve_on_pop:
|
||||
def __get__(self):
|
||||
return bool(elm_naviframe_content_preserve_on_pop_get(self.obj))
|
||||
def __set__(self, preserve):
|
||||
elm_naviframe_content_preserve_on_pop_set(self.obj, preserve)
|
||||
|
||||
def top_item_get(self):
|
||||
return _object_item_to_python(elm_naviframe_top_item_get(self.obj))
|
||||
|
||||
property top_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_naviframe_top_item_get(self.obj))
|
||||
|
||||
def bottom_item_get(self):
|
||||
return _object_item_to_python(elm_naviframe_bottom_item_get(self.obj))
|
||||
|
||||
property bottom_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_naviframe_bottom_item_get(self.obj))
|
||||
|
||||
def prev_btn_auto_pushed_set(self, auto_pushed):
|
||||
elm_naviframe_prev_btn_auto_pushed_set(self.obj, auto_pushed)
|
||||
|
||||
def prev_btn_auto_pushed_get(self):
|
||||
return bool(elm_naviframe_prev_btn_auto_pushed_get(self.obj))
|
||||
|
||||
property prev_btn_auto_pushed:
|
||||
def __get__(self):
|
||||
return bool(elm_naviframe_prev_btn_auto_pushed_get(self.obj))
|
||||
def __set__(self, auto_pushed):
|
||||
elm_naviframe_prev_btn_auto_pushed_set(self.obj, auto_pushed)
|
||||
|
||||
def items_get(self):
|
||||
return _object_item_list_to_python(elm_naviframe_items_get(self.obj))
|
||||
|
||||
property items:
|
||||
def __get__(self):
|
||||
return _object_item_list_to_python(elm_naviframe_items_get(self.obj))
|
||||
|
||||
def event_enabled_set(self, enabled):
|
||||
elm_naviframe_event_enabled_set(self.obj, enabled)
|
||||
|
||||
def event_enabled_get(self):
|
||||
return bool(elm_naviframe_event_enabled_get(self.obj))
|
||||
|
||||
property event_enabled:
|
||||
def __get__(self):
|
||||
return bool(elm_naviframe_event_enabled_get(self.obj))
|
||||
def __set__(self, enabled):
|
||||
elm_naviframe_event_enabled_set(self.obj, enabled)
|
||||
|
||||
def item_simple_push(self, evasObject content):
|
||||
cdef NaviframeItem ret = NaviframeItem()
|
||||
cdef Elm_Object_Item *item
|
||||
|
||||
item = elm_naviframe_item_simple_push(self.obj, content.obj)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def item_simple_promote(self, evasObject content):
|
||||
elm_naviframe_item_simple_promote(self.obj, content.obj)
|
||||
|
||||
def callback_transition_finished_add(self, func, *args, **kwargs):
|
||||
self._callback_add("transition,finished", func, *args, **kwargs)
|
||||
|
||||
def callback_transition_finished_del(self, func):
|
||||
self._callback_del("transition,finished", func)
|
||||
|
||||
def callback_title_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("title,clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_title_clicked_del(self, func):
|
||||
self._callback_del("title,clicked", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_naviframe", Naviframe)
|
|
@ -1,83 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Notify(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_notify_add(parent.obj))
|
||||
|
||||
def parent_set(self, evasObject parent):
|
||||
cdef Evas_Object *o
|
||||
if parent is not None:
|
||||
o = parent.obj
|
||||
else:
|
||||
o = NULL
|
||||
elm_notify_parent_set(self.obj, o)
|
||||
|
||||
def parent_get(self):
|
||||
return object_from_instance(elm_notify_parent_get(self.obj))
|
||||
|
||||
property parent:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_notify_parent_get(self.obj))
|
||||
def __set__(self, evasObject parent):
|
||||
cdef Evas_Object *o
|
||||
if parent is not None:
|
||||
o = parent.obj
|
||||
else:
|
||||
o = NULL
|
||||
elm_notify_parent_set(self.obj, o)
|
||||
|
||||
def timeout_set(self, double timeout):
|
||||
elm_notify_timeout_set(self.obj, timeout)
|
||||
|
||||
def timeout_get(self):
|
||||
return elm_notify_timeout_get(self.obj)
|
||||
|
||||
property timeout:
|
||||
def __get__(self):
|
||||
return elm_notify_timeout_get(self.obj)
|
||||
def __set__(self, timeout):
|
||||
elm_notify_timeout_set(self.obj, timeout)
|
||||
|
||||
def allow_events_set(self, repeat):
|
||||
elm_notify_allow_events_set(self.obj, repeat)
|
||||
|
||||
def allow_events_get(self):
|
||||
return bool(elm_notify_allow_events_get(self.obj))
|
||||
|
||||
property allow_events:
|
||||
def __get__(self):
|
||||
return bool(elm_notify_allow_events_get(self.obj))
|
||||
def __set__(self, allow_events):
|
||||
elm_notify_allow_events_set(self.obj, allow_events)
|
||||
|
||||
def callback_timeout_add(self, func, *args, **kwargs):
|
||||
self._callback_add("timeout", func, *args, **kwargs)
|
||||
|
||||
def callback_timeout_del(self, func):
|
||||
self._callback_del("timeout", func)
|
||||
|
||||
def callback_block_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("block,clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_block_clicked_del(self, func):
|
||||
self._callback_del("block,clicked", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_notify", Notify)
|
|
@ -1,563 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from efl.evas cimport Object as evasObject
|
||||
from efl.evas cimport EventKeyDown, EventKeyUp
|
||||
from efl.evas cimport evas_object_smart_callback_add
|
||||
from efl.evas cimport evas_object_smart_callback_del
|
||||
from efl.evas import EVAS_CALLBACK_KEY_DOWN
|
||||
from efl.evas import EVAS_CALLBACK_KEY_UP
|
||||
|
||||
|
||||
#API XXX: Callbacks!
|
||||
cdef void _object_callback(void *data,
|
||||
Evas_Object *o, void *event_info) with gil:
|
||||
cdef Object obj
|
||||
cdef object event, ei
|
||||
|
||||
obj = object_from_instance(o)
|
||||
event = <object>data
|
||||
lst = tuple(obj._elmcallbacks[event])
|
||||
for event_conv, func, args, kargs in lst:
|
||||
try:
|
||||
if event_conv is None:
|
||||
func(obj, *args, **kargs)
|
||||
else:
|
||||
ei = event_conv(<long>event_info)
|
||||
func(obj, ei, *args, **kargs)
|
||||
except Exception, e:
|
||||
traceback.print_exc()
|
||||
|
||||
cdef Evas_Object *_tooltip_content_create(void *data, Evas_Object *o, Evas_Object *t) with gil:
|
||||
cdef Object ret, obj, tooltip
|
||||
|
||||
obj = object_from_instance(o)
|
||||
tooltip = object_from_instance(t)
|
||||
(func, args, kargs) = <object>data
|
||||
ret = func(obj, tooltip, *args, **kargs)
|
||||
if not ret:
|
||||
return NULL
|
||||
return ret.obj
|
||||
|
||||
cdef void _tooltip_data_del_cb(void *data, Evas_Object *o, void *event_info) with gil:
|
||||
Py_DECREF(<object>data)
|
||||
|
||||
cdef Eina_Bool _event_dispatcher(o, src, Evas_Callback_Type t, event_info):
|
||||
cdef Object obj = o
|
||||
cdef object ret
|
||||
for func, args, kargs in obj._elm_event_cbs:
|
||||
try:
|
||||
ret = func(obj, src, t, event_info, *args, **kargs)
|
||||
except Exception, e:
|
||||
traceback.print_exc()
|
||||
else:
|
||||
if ret:
|
||||
return True
|
||||
return False
|
||||
|
||||
#TODO: More event types
|
||||
cdef Eina_Bool _event_callback(void *data, Evas_Object *o, Evas_Object *src, Evas_Callback_Type t, void *event_info) with gil:
|
||||
cdef Object obj = object_from_instance(o)
|
||||
cdef Object src_obj = object_from_instance(src)
|
||||
cdef Eina_Bool ret = False
|
||||
cdef EventKeyDown down_event
|
||||
cdef EventKeyUp up_event
|
||||
if t == EVAS_CALLBACK_KEY_DOWN:
|
||||
down_event = EventKeyDown()
|
||||
down_event._set_obj(event_info)
|
||||
ret = _event_dispatcher(obj, src_obj, t, down_event)
|
||||
down_event._unset_obj()
|
||||
elif t == EVAS_CALLBACK_KEY_UP:
|
||||
up_event = EventKeyUp()
|
||||
up_event._set_obj(event_info)
|
||||
ret = _event_dispatcher(obj, src_obj, t, up_event)
|
||||
up_event._unset_obj()
|
||||
|
||||
|
||||
|
||||
def _cb_string_conv(long addr):
|
||||
cdef const_char_ptr s = <const_char_ptr>addr
|
||||
if s == NULL:
|
||||
return None
|
||||
else:
|
||||
return s
|
||||
|
||||
|
||||
cdef class Object(evasObject):
|
||||
|
||||
def part_text_set(self, part, text):
|
||||
elm_object_part_text_set(self.obj, _cfruni(part) if part is not None else NULL, _cfruni(text))
|
||||
|
||||
def text_set(self, text):
|
||||
elm_object_text_set(self.obj, _cfruni(text))
|
||||
|
||||
def part_text_get(self, part):
|
||||
return _ctouni(elm_object_part_text_get(self.obj, _cfruni(part) if part is not None else NULL))
|
||||
|
||||
def text_get(self):
|
||||
return _ctouni(elm_object_text_get(self.obj))
|
||||
|
||||
property text:
|
||||
def __get__(self):
|
||||
return self.text_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.text_set(value)
|
||||
|
||||
def part_content_set(self, part, evasObject content):
|
||||
elm_object_part_content_set(self.obj, _cfruni(part), content.obj)
|
||||
|
||||
def content_set(self, evasObject obj):
|
||||
elm_object_part_content_set(self.obj, NULL, obj.obj)
|
||||
|
||||
def part_content_get(self, part):
|
||||
return object_from_instance(elm_object_part_content_get(self.obj, _cfruni(part)))
|
||||
|
||||
def content_get(self):
|
||||
return object_from_instance(elm_object_content_get(self.obj))
|
||||
|
||||
def part_content_unset(self, part):
|
||||
return object_from_instance(elm_object_part_content_unset(self.obj, _cfruni(part)))
|
||||
|
||||
def content_unset(self):
|
||||
return object_from_instance(elm_object_content_unset(self.obj))
|
||||
|
||||
property content:
|
||||
def __get__(self):
|
||||
return self.content_get()
|
||||
def __set__(self, content):
|
||||
self.content_set(content)
|
||||
def __del__(self):
|
||||
self.content_unset()
|
||||
|
||||
def access_info_set(self, txt):
|
||||
elm_object_access_info_set(self.obj, _cfruni(txt))
|
||||
|
||||
def name_find(self, name not None, int recurse = 0):
|
||||
return object_from_instance(elm_object_name_find(self.obj, _cfruni(name), recurse))
|
||||
|
||||
def style_set(self, style):
|
||||
elm_object_style_set(self.obj, _cfruni(style))
|
||||
|
||||
def style_get(self):
|
||||
return _ctouni(elm_object_style_get(self.obj))
|
||||
|
||||
property style:
|
||||
def __get__(self):
|
||||
return self.style_get()
|
||||
def __set__(self, value):
|
||||
self.style_set(value)
|
||||
|
||||
def disabled_set(self, disabled):
|
||||
elm_object_disabled_set(self.obj, disabled)
|
||||
|
||||
def disabled_get(self):
|
||||
return bool(elm_object_disabled_get(self.obj))
|
||||
|
||||
property disabled:
|
||||
def __get__(self):
|
||||
return self.disabled_get()
|
||||
def __set__(self, disabled):
|
||||
self.disabled_set(disabled)
|
||||
|
||||
def widget_check(self):
|
||||
return bool(elm_object_widget_check(self.obj))
|
||||
|
||||
def parent_widget_get(self):
|
||||
return object_from_instance(elm_object_parent_widget_get(self.obj))
|
||||
|
||||
property parent_widget:
|
||||
def __get__(self):
|
||||
return self.parent_widget_get()
|
||||
|
||||
def top_widget_get(self):
|
||||
return object_from_instance(elm_object_top_widget_get(self.obj))
|
||||
|
||||
property top_widget:
|
||||
def __get__(self):
|
||||
return self.top_widget_get()
|
||||
|
||||
def widget_type_get(self):
|
||||
return elm_object_widget_type_get(self.obj)
|
||||
|
||||
property widget_type:
|
||||
def __get__(self):
|
||||
return elm_object_widget_type_get(self.obj)
|
||||
|
||||
def signal_emit(self, emission, source):
|
||||
elm_object_signal_emit(self.obj, _cfruni(emission), _cfruni(source))
|
||||
|
||||
#def signal_callback_add(self, emission, source, func, data):
|
||||
#elm_object_signal_callback_add(self.obj, emission, source, func, data)
|
||||
|
||||
#def signal_callback_del(self, emission, source, func):
|
||||
#elm_object_signal_callback_del(self.obj, emission, source, func)
|
||||
|
||||
# XXX: Clashes badly with evas event_callback_*
|
||||
def elm_event_callback_add(self, func, *args, **kargs):
|
||||
if not callable(func):
|
||||
raise TypeError("func must be callable")
|
||||
|
||||
if self._elm_event_cbs is None:
|
||||
self._elm_event_cbs = []
|
||||
|
||||
if not self._elm_event_cbs:
|
||||
elm_object_event_callback_add(self.obj, _event_callback, NULL)
|
||||
|
||||
data = (func, args, kargs)
|
||||
self._elm_event_cbs.append(data)
|
||||
|
||||
def elm_event_callback_del(self, func, *args, **kargs):
|
||||
data = (func, args, kargs)
|
||||
self._elm_event_cbs.remove(data)
|
||||
|
||||
if not self._elm_event_cbs:
|
||||
elm_object_event_callback_del(self.obj, _event_callback, NULL)
|
||||
|
||||
# Cursors
|
||||
def cursor_set(self, cursor):
|
||||
elm_object_cursor_set(self.obj, _cfruni(cursor))
|
||||
|
||||
def cursor_get(self):
|
||||
return _ctouni(elm_object_cursor_get(self.obj))
|
||||
|
||||
def cursor_unset(self):
|
||||
elm_object_cursor_unset(self.obj)
|
||||
|
||||
property cursor:
|
||||
def __get__(self):
|
||||
return self.cursor_get()
|
||||
def __set__(self, value):
|
||||
self.cursor_set(value)
|
||||
def __del__(self):
|
||||
self.cursor_unset()
|
||||
|
||||
def cursor_style_set(self, style=None):
|
||||
elm_object_cursor_style_set(self.obj, _cfruni(style) if style is not None else NULL)
|
||||
|
||||
def cursor_style_get(self):
|
||||
return _ctouni(elm_object_cursor_style_get(self.obj))
|
||||
|
||||
property cursor_style:
|
||||
def __get__(self):
|
||||
return self.cursor_style_get()
|
||||
def __set__(self, value):
|
||||
self.cursor_style_set(value)
|
||||
|
||||
def cursor_theme_search_enabled_set(self, engine_only):
|
||||
elm_object_cursor_theme_search_enabled_set(self.obj, bool(engine_only))
|
||||
|
||||
def cursor_theme_search_enabled_get(self):
|
||||
return elm_object_cursor_theme_search_enabled_get(self.obj)
|
||||
|
||||
property cursor_theme_search_enabled:
|
||||
def __get__(self):
|
||||
return self.cursor_theme_search_enabled_get()
|
||||
def __set__(self, value):
|
||||
self.cursor_theme_search_enabled_set(value)
|
||||
|
||||
# Focus
|
||||
def focus_get(self):
|
||||
return bool(elm_object_focus_get(self.obj))
|
||||
|
||||
def focus_set(self, focus):
|
||||
elm_object_focus_set(self.obj, focus)
|
||||
|
||||
def focus_allow_set(self, allow):
|
||||
elm_object_focus_allow_set(self.obj, allow)
|
||||
|
||||
def focus_allow_get(self):
|
||||
return elm_object_focus_allow_get(self.obj)
|
||||
|
||||
property focus_allow:
|
||||
def __get__(self):
|
||||
return self.focus_allow_get()
|
||||
def __set__(self, value):
|
||||
self.focus_allow_set(value)
|
||||
|
||||
def focus_custom_chain_set(self, objs):
|
||||
elm_object_focus_custom_chain_unset(self.obj)
|
||||
cdef Object obj
|
||||
for obj in objs:
|
||||
elm_object_focus_custom_chain_append(self.obj, obj.obj, NULL)
|
||||
|
||||
def focus_custom_chain_unset(self):
|
||||
elm_object_focus_custom_chain_unset(self.obj)
|
||||
|
||||
def focus_custom_chain_get(self):
|
||||
return _object_list_to_python(elm_object_focus_custom_chain_get(self.obj))
|
||||
|
||||
property focus_custom_chain:
|
||||
def __get__(self):
|
||||
return self.focus_custom_chain_get()
|
||||
def __set__(self, value):
|
||||
self.focus_custom_chain_set(value)
|
||||
def __del__(self):
|
||||
self.focus_custom_chain_unset()
|
||||
|
||||
def focus_custom_chain_append(self, Object child, Object relative_child=None):
|
||||
cdef Evas_Object *rel = NULL
|
||||
if relative_child:
|
||||
rel = relative_child.obj
|
||||
elm_object_focus_custom_chain_append(self.obj, child.obj, rel)
|
||||
|
||||
def focus_custom_chain_prepend(self, Object child, Object relative_child=None):
|
||||
cdef Evas_Object *rel = NULL
|
||||
if relative_child:
|
||||
rel = relative_child.obj
|
||||
elm_object_focus_custom_chain_prepend(self.obj, child.obj, rel)
|
||||
|
||||
#def focus_next(self, direction):
|
||||
#elm_object_focus_next(self.obj, direction)
|
||||
|
||||
def tree_focus_allow_set(self, focusable):
|
||||
elm_object_tree_focus_allow_set(self.obj, focusable)
|
||||
|
||||
def tree_focus_allow_get(self):
|
||||
return bool(elm_object_tree_focus_allow_get(self.obj))
|
||||
|
||||
property tree_focus_allow:
|
||||
def __get__(self):
|
||||
return self.tree_focus_allow_get()
|
||||
def __set__(self, value):
|
||||
self.tree_focus_allow_set(value)
|
||||
|
||||
# Mirroring
|
||||
def mirrored_get(self):
|
||||
return bool(elm_object_mirrored_get(self.obj))
|
||||
|
||||
def mirrored_set(self, mirrored):
|
||||
elm_object_mirrored_set(self.obj, mirrored)
|
||||
|
||||
property mirrored:
|
||||
def __get__(self):
|
||||
return self.mirrored_get()
|
||||
def __set__(self, value):
|
||||
self.mirrored_set(value)
|
||||
|
||||
def mirrored_automatic_get(self):
|
||||
return bool(elm_object_mirrored_automatic_get(self.obj))
|
||||
|
||||
def mirrored_automatic_set(self, automatic):
|
||||
elm_object_mirrored_automatic_set(self.obj, automatic)
|
||||
|
||||
property mirrored_automatic:
|
||||
def __get__(self):
|
||||
return self.mirrored_automatic_get()
|
||||
def __set__(self, value):
|
||||
self.mirrored_automatic_set(value)
|
||||
|
||||
# Scaling
|
||||
def scale_set(self, scale):
|
||||
elm_object_scale_set(self.obj, scale)
|
||||
|
||||
def scale_get(self):
|
||||
return elm_object_scale_get(self.obj)
|
||||
|
||||
property scale:
|
||||
def __get__(self):
|
||||
return self.scale_get()
|
||||
def __set__(self, value):
|
||||
self.scale_set(value)
|
||||
|
||||
# Scrollhints
|
||||
def scroll_hold_push(self):
|
||||
elm_object_scroll_hold_push(self.obj)
|
||||
|
||||
def scroll_hold_pop(self):
|
||||
elm_object_scroll_hold_pop(self.obj)
|
||||
|
||||
def scroll_freeze_push(self):
|
||||
elm_object_scroll_freeze_push(self.obj)
|
||||
|
||||
def scroll_freeze_pop(self):
|
||||
elm_object_scroll_freeze_pop(self.obj)
|
||||
|
||||
def scroll_lock_x_set(self, lock):
|
||||
elm_object_scroll_lock_x_set(self.obj, lock)
|
||||
|
||||
def scroll_lock_y_set(self, lock):
|
||||
elm_object_scroll_lock_y_set(self.obj, lock)
|
||||
|
||||
def scroll_lock_x_get(self):
|
||||
return bool(elm_object_scroll_lock_x_get(self.obj))
|
||||
|
||||
def scroll_lock_y_get(self):
|
||||
return bool(elm_object_scroll_lock_y_get(self.obj))
|
||||
|
||||
property scroll_lock_x:
|
||||
def __get__(self):
|
||||
return self.scroll_lock_x_get()
|
||||
def __set__(self, value):
|
||||
self.scroll_lock_x_set(value)
|
||||
|
||||
property scroll_lock_y:
|
||||
def __get__(self):
|
||||
return self.scroll_lock_y_get()
|
||||
def __set__(self, value):
|
||||
self.scroll_lock_y_set(value)
|
||||
|
||||
# Theme
|
||||
# property theme:
|
||||
# """A theme to be used for this object and its children.
|
||||
#
|
||||
# This sets a specific theme that will be used for the given object and any
|
||||
# child objects it has. If @p th is NULL then the theme to be used is
|
||||
# cleared and the object will inherit its theme from its parent (which
|
||||
# ultimately will use the default theme if no specific themes are set).
|
||||
#
|
||||
# Use special themes with great care as this will annoy users and make
|
||||
# configuration difficult. Avoid any custom themes at all if it can be
|
||||
# helped.
|
||||
#
|
||||
# @type: L{Theme}
|
||||
#
|
||||
# """
|
||||
# def __set__(self, Theme th):
|
||||
# elm_object_theme_set(self.obj, th.th)
|
||||
# def __get__(self):
|
||||
# cdef Theme th = Theme()
|
||||
# th.th = elm_object_theme_get(self.obj)
|
||||
# return th
|
||||
|
||||
# Tooltips
|
||||
def tooltip_show(self):
|
||||
elm_object_tooltip_show(self.obj)
|
||||
|
||||
def tooltip_hide(self):
|
||||
elm_object_tooltip_hide(self.obj)
|
||||
|
||||
def tooltip_text_set(self, text):
|
||||
elm_object_tooltip_text_set(self.obj, _cfruni(text))
|
||||
|
||||
def tooltip_domain_translatable_text_set(self, domain, text):
|
||||
elm_object_tooltip_domain_translatable_text_set(self.obj, _cfruni(domain), _cfruni(text))
|
||||
|
||||
def tooltip_translatable_text_set(self, text):
|
||||
elm_object_tooltip_translatable_text_set(self.obj, _cfruni(text))
|
||||
|
||||
def tooltip_content_cb_set(self, func, *args, **kargs):
|
||||
if not callable(func):
|
||||
raise TypeError("func must be callable")
|
||||
|
||||
cdef void *cbdata
|
||||
|
||||
data = (func, args, kargs)
|
||||
Py_INCREF(data)
|
||||
cbdata = <void *>data
|
||||
elm_object_tooltip_content_cb_set(self.obj, _tooltip_content_create,
|
||||
cbdata, _tooltip_data_del_cb)
|
||||
|
||||
def tooltip_unset(self):
|
||||
elm_object_tooltip_unset(self.obj)
|
||||
|
||||
def tooltip_style_set(self, style=None):
|
||||
elm_object_tooltip_style_set(self.obj, _cfruni(style) if style is not None else NULL)
|
||||
|
||||
def tooltip_style_get(self):
|
||||
return _ctouni(elm_object_tooltip_style_get(self.obj))
|
||||
|
||||
property tooltip_style:
|
||||
def __get__(self):
|
||||
return self.tooltip_style_get()
|
||||
def __set__(self, value):
|
||||
self.tooltip_style_set(value)
|
||||
|
||||
def tooltip_window_mode_set(self, disable):
|
||||
return bool(elm_object_tooltip_window_mode_set(self.obj, disable))
|
||||
|
||||
def tooltip_window_mode_get(self):
|
||||
return bool(elm_object_tooltip_window_mode_get(self.obj))
|
||||
|
||||
property tooltip_window_mode:
|
||||
def __get__(self):
|
||||
return self.tooltip_window_mode_get()
|
||||
def __set__(self, value):
|
||||
self.tooltip_window_mode_set(value)
|
||||
|
||||
#Translatable text
|
||||
def domain_translatable_part_text_set(self, part, domain, text):
|
||||
elm_object_domain_translatable_part_text_set(self.obj, _cfruni(part), _cfruni(domain), _cfruni(text))
|
||||
|
||||
def domain_translatable_text_set(self, domain, text):
|
||||
elm_object_domain_translatable_text_set(self.obj, _cfruni(domain), _cfruni(text))
|
||||
|
||||
def translatable_text_set(self, text):
|
||||
elm_object_translatable_text_set(self.obj, _cfruni(text))
|
||||
|
||||
def translatable_text_part_get(self, part):
|
||||
return _ctouni(elm_object_translatable_text_part_get(self.obj, _cfruni(part)))
|
||||
|
||||
def translatable_text_get(self):
|
||||
return _ctouni(elm_object_translatable_text_get(self.obj))
|
||||
|
||||
property translatable_text:
|
||||
def __get__(self):
|
||||
return self.translatable_text_get()
|
||||
def __set__(self, value):
|
||||
self.translatable_text_set(value)
|
||||
|
||||
# Callbacks
|
||||
def _callback_add_full(self, event, event_conv, func, *args, **kargs):
|
||||
if not callable(func):
|
||||
raise TypeError("func must be callable")
|
||||
if event_conv is not None and not callable(event_conv):
|
||||
raise TypeError("event_conv must be None or callable")
|
||||
|
||||
if self._elmcallbacks is None:
|
||||
self._elmcallbacks = {}
|
||||
|
||||
e = intern(event)
|
||||
lst = self._elmcallbacks.setdefault(e, [])
|
||||
if not lst:
|
||||
evas_object_smart_callback_add(self.obj, _fruni(event),
|
||||
_object_callback, <void *>e)
|
||||
lst.append((event_conv, func, args, kargs))
|
||||
|
||||
def _callback_del_full(self, event, event_conv, func):
|
||||
try:
|
||||
lst = self._elmcallbacks[event]
|
||||
except KeyError as e:
|
||||
raise ValueError("Unknown event %r" % event)
|
||||
|
||||
i = -1
|
||||
ec = None
|
||||
f = None
|
||||
for i, (ec, f, a, k) in enumerate(lst):
|
||||
if event_conv == ec and func == f:
|
||||
break
|
||||
|
||||
if f != func or ec != event_conv:
|
||||
raise ValueError("Callback %s was not registered with event %r" %
|
||||
(func, event))
|
||||
|
||||
lst.pop(i)
|
||||
if lst:
|
||||
return
|
||||
self._elmcallbacks.pop(event)
|
||||
evas_object_smart_callback_del(self.obj, _fruni(event), _object_callback)
|
||||
|
||||
def _callback_add(self, event, func, *args, **kargs):
|
||||
return self._callback_add_full(event, None, func, *args, **kargs)
|
||||
|
||||
def _callback_del(self, event, func):
|
||||
return self._callback_del_full(event, None, func)
|
||||
|
||||
def _get_obj_addr(self):
|
||||
return <long>self.obj
|
||||
|
|
@ -1,252 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef Evas_Object *_tooltip_item_content_create(void *data, Evas_Object *o, Evas_Object *t, void *it) with gil:
|
||||
cdef Object ret, obj, tooltip
|
||||
|
||||
# obj = <Object>evas_object_data_get(o, "python-evas")
|
||||
obj = object_from_instance(o)
|
||||
tooltip = object_from_instance(t)
|
||||
(func, item, args, kargs) = <object>data
|
||||
ret = func(obj, item, *args, **kargs)
|
||||
if not ret:
|
||||
return NULL
|
||||
return ret.obj
|
||||
|
||||
cdef void _tooltip_item_data_del_cb(void *data, Evas_Object *o, void *event_info) with gil:
|
||||
Py_DECREF(<object>data)
|
||||
|
||||
cdef class ObjectItem
|
||||
|
||||
def _cb_object_item_conv(long addr):
|
||||
cdef Elm_Object_Item *it = <Elm_Object_Item *>addr
|
||||
return _object_item_to_python(it)
|
||||
|
||||
cdef Elm_Object_Item * _object_item_from_python(ObjectItem item) except NULL:
|
||||
if item is None or item.item is NULL:
|
||||
raise TypeError("Invalid item!")
|
||||
return item.item
|
||||
|
||||
cdef _object_item_to_python(Elm_Object_Item *it):
|
||||
cdef void *data
|
||||
cdef object item
|
||||
|
||||
if it == NULL:
|
||||
return None
|
||||
|
||||
data = elm_object_item_data_get(it)
|
||||
if data == NULL:
|
||||
return None
|
||||
|
||||
item = <object>data
|
||||
return item
|
||||
|
||||
cdef _object_item_list_to_python(const_Eina_List *lst):
|
||||
cdef Elm_Object_Item *it
|
||||
ret = []
|
||||
ret_append = ret.append
|
||||
while lst:
|
||||
it = <Elm_Object_Item *>lst.data
|
||||
lst = lst.next
|
||||
o = _object_item_to_python(it)
|
||||
if o is not None:
|
||||
ret_append(o)
|
||||
return ret
|
||||
|
||||
cdef void _object_item_del_cb(void *data, Evas_Object *o, void *event_info) with gil:
|
||||
cdef ObjectItem d = <object>data
|
||||
d.item = NULL
|
||||
Py_DECREF(d)
|
||||
|
||||
cdef void _object_item_callback(void *data, Evas_Object *obj, void *event_info) with gil:
|
||||
cdef ObjectItem item = <object>data
|
||||
(callback, a, ka) = item.params
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
callback(o, item, *a, **ka)
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
|
||||
cdef class ObjectItem(object):
|
||||
|
||||
# Notes to bindings' developers:
|
||||
# ==============================
|
||||
#
|
||||
# After calling _set_obj, Elm_Object_Item's "data" contains the python item
|
||||
# instance pointer, and the attribute "item", that you see below, contains
|
||||
# a pointer to Elm_Object_Item.
|
||||
#
|
||||
# The variable params holds callback data, usually the tuple
|
||||
# (callback, args, kwargs). Note that some of the generic object item
|
||||
# functions expect this tuple. Use custom functions if you assign the
|
||||
# params differently.
|
||||
#
|
||||
# Gen type widgets MUST set the params BEFORE adding the item as the
|
||||
# items need their data immediately when adding them.
|
||||
|
||||
cdef Elm_Object_Item *item
|
||||
cdef object params
|
||||
|
||||
def __dealloc__(self):
|
||||
if self.item != NULL:
|
||||
elm_object_item_del_cb_set(self.item, NULL)
|
||||
elm_object_item_del(self.item)
|
||||
self.item = NULL
|
||||
|
||||
cdef int _set_obj(self, Elm_Object_Item *item) except 0:
|
||||
assert self.item == NULL, "Object must be clean"
|
||||
self.item = item
|
||||
elm_object_item_data_set(item, <void*>self)
|
||||
elm_object_item_del_cb_set(item, _object_item_del_cb)
|
||||
Py_INCREF(self)
|
||||
return 1
|
||||
|
||||
def widget_get(self):
|
||||
return object_from_instance(elm_object_item_widget_get(self.item))
|
||||
|
||||
def part_content_set(self, part, Object content not None):
|
||||
elm_object_item_part_content_set(self.item, _cfruni(part), content.obj)
|
||||
|
||||
def content_set(self, Object content not None):
|
||||
elm_object_item_content_set(self.item, content.obj)
|
||||
|
||||
def part_content_get(self, part):
|
||||
return object_from_instance(elm_object_item_part_content_get(self.item, _cfruni(part)))
|
||||
|
||||
def content_get(self):
|
||||
return object_from_instance(elm_object_item_content_get(self.item))
|
||||
|
||||
def part_content_unset(self, part):
|
||||
return object_from_instance(elm_object_item_part_content_unset(self.item, _cfruni(part)))
|
||||
|
||||
def content_unset(self):
|
||||
return object_from_instance(elm_object_item_content_unset(self.item))
|
||||
|
||||
def part_text_set(self, part, text):
|
||||
elm_object_item_part_text_set(self.item, _cfruni(part), _cfruni(text))
|
||||
|
||||
def text_set(self, text):
|
||||
elm_object_item_text_set(self.item, _cfruni(text))
|
||||
|
||||
def part_text_get(self, part):
|
||||
return _ctouni(elm_object_item_part_text_get(self.item, _cfruni(part)))
|
||||
|
||||
def text_get(self):
|
||||
return _ctouni(elm_object_item_text_get(self.item))
|
||||
|
||||
property text:
|
||||
def __get__(self):
|
||||
return self.text_get()
|
||||
|
||||
def __set__(self, value):
|
||||
self.text_set(value)
|
||||
|
||||
def access_info_set(self, txt):
|
||||
elm_object_item_access_info_set(self.item, _cfruni(txt))
|
||||
|
||||
def data_get(self):
|
||||
(callback, a, ka) = self.params
|
||||
return (a, ka)
|
||||
|
||||
def data_set(self, *args, **kwargs):
|
||||
(callback, a, ka) = self.params
|
||||
self.params = tuple(callback, *args, **kwargs)
|
||||
|
||||
property data:
|
||||
def __get__(self):
|
||||
return self.data_get()
|
||||
#def __set__(self, data):
|
||||
#self.data_set(data)
|
||||
|
||||
def signal_emit(self, emission, source):
|
||||
elm_object_item_signal_emit(self.item, _cfruni(emission), _cfruni(source))
|
||||
|
||||
def disabled_set(self, disabled):
|
||||
elm_object_item_disabled_set(self.item, disabled)
|
||||
|
||||
def disabled_get(self):
|
||||
return bool(elm_object_item_disabled_get(self.item))
|
||||
|
||||
property disabled:
|
||||
def __get__(self):
|
||||
return self.disabled_get()
|
||||
def __set__(self, disabled):
|
||||
self.disabled_set(disabled)
|
||||
|
||||
#def delete_cb_set(self, del_cb):
|
||||
#elm_object_item_del_cb_set(self.item, del_cb)
|
||||
|
||||
def delete(self):
|
||||
if self.item == NULL:
|
||||
raise ValueError("Object already deleted")
|
||||
elm_object_item_del(self.item)
|
||||
Py_DECREF(self)
|
||||
|
||||
def tooltip_text_set(self, char *text):
|
||||
elm_object_item_tooltip_text_set(self.item, _cfruni(text))
|
||||
|
||||
def tooltip_window_mode_set(self, disable):
|
||||
return bool(elm_object_item_tooltip_window_mode_set(self.item, disable))
|
||||
|
||||
def tooltip_window_mode_get(self):
|
||||
return bool(elm_object_item_tooltip_window_mode_get(self.item))
|
||||
|
||||
def tooltip_content_cb_set(self, func, *args, **kargs):
|
||||
if not callable(func):
|
||||
raise TypeError("func must be callable")
|
||||
|
||||
cdef void *cbdata
|
||||
|
||||
data = (func, args, kargs)
|
||||
Py_INCREF(data)
|
||||
cbdata = <void *>data
|
||||
elm_object_item_tooltip_content_cb_set(self.item, _tooltip_item_content_create,
|
||||
cbdata, _tooltip_item_data_del_cb)
|
||||
|
||||
def tooltip_unset(self):
|
||||
elm_object_item_tooltip_unset(self.item)
|
||||
|
||||
def tooltip_style_set(self, style=None):
|
||||
elm_object_item_tooltip_style_set(self.item, _cfruni(style) if style is not None else NULL)
|
||||
|
||||
def tooltip_style_get(self):
|
||||
return _ctouni(elm_object_item_tooltip_style_get(self.item))
|
||||
|
||||
def cursor_set(self, char *cursor):
|
||||
elm_object_item_cursor_set(self.item, _cfruni(cursor))
|
||||
|
||||
def cursor_get(self):
|
||||
return _ctouni(elm_object_item_cursor_get(self.item))
|
||||
|
||||
def cursor_unset(self):
|
||||
elm_object_item_cursor_unset(self.item)
|
||||
|
||||
def cursor_style_set(self, style=None):
|
||||
elm_object_item_cursor_style_set(self.item, _cfruni(style) if style is not None else NULL)
|
||||
|
||||
def cursor_style_get(self):
|
||||
return _ctouni(elm_object_item_cursor_style_get(self.item))
|
||||
|
||||
def cursor_engine_only_set(self, engine_only):
|
||||
elm_object_item_cursor_engine_only_set(self.item, bool(engine_only))
|
||||
|
||||
def cursor_engine_only_get(self):
|
||||
return elm_object_item_cursor_engine_only_get(self.item)
|
||||
|
||||
|
||||
_object_mapping_register("elm_object_item", ObjectItem)
|
|
@ -1,73 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Panes(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_panes_add(parent.obj))
|
||||
|
||||
property fixed:
|
||||
def __set__(self, fixed):
|
||||
elm_panes_fixed_set(self.obj, fixed)
|
||||
def __get__(self):
|
||||
return bool(elm_panes_fixed_get(self.obj))
|
||||
|
||||
property content_left_size:
|
||||
def __get__(self):
|
||||
return elm_panes_content_left_size_get(self.obj)
|
||||
def __set__(self, size):
|
||||
elm_panes_content_left_size_set(self.obj, size)
|
||||
|
||||
property content_right_size:
|
||||
def __get__(self):
|
||||
return elm_panes_content_right_size_get(self.obj)
|
||||
def __set__(self, size):
|
||||
elm_panes_content_right_size_set(self.obj, size)
|
||||
|
||||
property horizontal:
|
||||
def __set__(self, horizontal):
|
||||
elm_panes_horizontal_set(self.obj, horizontal)
|
||||
def __get__(self):
|
||||
return bool(elm_panes_horizontal_get(self.obj))
|
||||
|
||||
def callback_press_add(self, func, *args, **kwargs):
|
||||
self._callback_add("press", func, *args, **kwargs)
|
||||
|
||||
def callback_press_del(self, func):
|
||||
self._callback_del("press", func)
|
||||
|
||||
def callback_unpress_add(self, func, *args, **kwargs):
|
||||
self._callback_add("unpress", func, *args, **kwargs)
|
||||
|
||||
def callback_unpress_del(self, func):
|
||||
self._callback_del("unpress", func)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_clicked_double_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked,double", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_double_del(self, func):
|
||||
self._callback_del("clicked,double", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_panes", Panes)
|
|
@ -1,188 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
from efl.evas cimport Image as evasImage
|
||||
|
||||
cdef class Photocam(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_photocam_add(parent.obj))
|
||||
|
||||
property file:
|
||||
def __set__(self, file):
|
||||
elm_photocam_file_set(self.obj, _cfruni(file))
|
||||
#TODO: handle errors from return status
|
||||
def __get__(self):
|
||||
return _ctouni(elm_photocam_file_get(self.obj))
|
||||
|
||||
property zoom:
|
||||
def __set__(self, zoom):
|
||||
elm_photocam_zoom_set(self.obj, zoom)
|
||||
def __get__(self):
|
||||
return elm_photocam_zoom_get(self.obj)
|
||||
|
||||
property zoom_mode:
|
||||
def __set__(self, mode):
|
||||
elm_photocam_zoom_mode_set(self.obj, mode)
|
||||
def __get__(self):
|
||||
return elm_photocam_zoom_mode_get(self.obj)
|
||||
|
||||
property image_size:
|
||||
def __get__(self):
|
||||
cdef int w, h
|
||||
elm_photocam_image_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
property image_region:
|
||||
def __get__(self):
|
||||
cdef int x, y, w, h
|
||||
elm_photocam_image_region_get(self.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
def image_region_show(self, x, y, w, h):
|
||||
elm_photocam_image_region_show(self.obj, x, y, w, h)
|
||||
|
||||
def image_region_bring_in(self, x, y, w, h):
|
||||
elm_photocam_image_region_bring_in(self.obj, x, y, w, h)
|
||||
|
||||
property paused:
|
||||
def __set__(self, paused):
|
||||
elm_photocam_paused_set(self.obj, paused)
|
||||
def __get__(self):
|
||||
return bool(elm_photocam_paused_get(self.obj))
|
||||
|
||||
property internal_image:
|
||||
def __get__(self):
|
||||
cdef evasImage img = evasImage()
|
||||
cdef Evas_Object *obj = elm_photocam_internal_image_get(self.obj)
|
||||
img.obj = obj
|
||||
return img
|
||||
|
||||
property bounce:
|
||||
def __set__(self, value):
|
||||
h_bounce, v_bounce = value
|
||||
elm_scroller_bounce_set(self.obj, h_bounce, v_bounce)
|
||||
def __get__(self):
|
||||
cdef Eina_Bool h_bounce, v_bounce
|
||||
elm_scroller_bounce_get(self.obj, &h_bounce, &v_bounce)
|
||||
return (h_bounce, v_bounce)
|
||||
|
||||
property gesture_enabled:
|
||||
def __set__(self, gesture):
|
||||
elm_photocam_gesture_enabled_set(self.obj, gesture)
|
||||
def __get__(self):
|
||||
return bool(elm_photocam_gesture_enabled_get(self.obj))
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_press_add(self, func, *args, **kwargs):
|
||||
self._callback_add("press", func, *args, **kwargs)
|
||||
|
||||
def callback_press_del(self, func):
|
||||
self._callback_del("press", func)
|
||||
|
||||
def callback_longpressed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("longpressed", func, *args, **kwargs)
|
||||
|
||||
def callback_longpressed_del(self, func):
|
||||
self._callback_del("longpressed", func)
|
||||
|
||||
def callback_clicked_double_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked,double", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_double_del(self, func):
|
||||
self._callback_del("clicked,double", func)
|
||||
|
||||
def callback_load_add(self, func, *args, **kwargs):
|
||||
self._callback_add("load", func, *args, **kwargs)
|
||||
|
||||
def callback_load_del(self, func):
|
||||
self._callback_del("load", func)
|
||||
|
||||
def callback_loaded_add(self, func, *args, **kwargs):
|
||||
self._callback_add("loaded", func, *args, **kwargs)
|
||||
|
||||
def callback_loaded_del(self, func):
|
||||
self._callback_del("loaded", func)
|
||||
|
||||
def callback_load_detail_add(self, func, *args, **kwargs):
|
||||
self._callback_add("load,detail", func, *args, **kwargs)
|
||||
|
||||
def callback_load_detail_del(self, func):
|
||||
self._callback_del("load,detail", func)
|
||||
|
||||
def callback_loaded_detail_add(self, func, *args, **kwargs):
|
||||
self._callback_add("loaded,detail", func, *args, **kwargs)
|
||||
|
||||
def callback_loaded_detail_del(self, func):
|
||||
self._callback_del("loaded,detail", func)
|
||||
|
||||
def callback_zoom_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("zoom,start", func, *args, **kwargs)
|
||||
|
||||
def callback_zoom_start_del(self, func):
|
||||
self._callback_del("zoom,start", func)
|
||||
|
||||
def callback_zoom_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("zoom,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_zoom_stop_del(self, func):
|
||||
self._callback_del("zoom,stop", func)
|
||||
|
||||
def callback_zoom_change_add(self, func, *args, **kwargs):
|
||||
self._callback_add("zoom,change", func, *args, **kwargs)
|
||||
|
||||
def callback_zoom_change_del(self, func):
|
||||
self._callback_del("zoom,change", func)
|
||||
|
||||
def callback_scroll_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_del(self, func):
|
||||
self._callback_del("scroll", func)
|
||||
|
||||
def callback_scroll_anim_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_start_del(self, func):
|
||||
self._callback_del("scroll,anim,start", func)
|
||||
|
||||
def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_stop_del(self, func):
|
||||
self._callback_del("scroll,anim,stop", func)
|
||||
|
||||
def callback_scroll_drag_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_start_del(self, func):
|
||||
self._callback_del("scroll,drag,start", func)
|
||||
|
||||
def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_stop_del(self, func):
|
||||
self._callback_del("scroll,drag,stop", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_photocam", Photocam)
|
|
@ -1,104 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class PopupItem(ObjectItem):
|
||||
|
||||
def __init__(self, evasObject popup, label = None, evasObject icon = None, func = None, *args, **kwargs):
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Evas_Smart_Cb cb
|
||||
|
||||
if func is None:
|
||||
cb = NULL
|
||||
elif callable(func):
|
||||
cb = _object_item_callback
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
self.params = (func, args, kwargs)
|
||||
item = elm_popup_item_append(popup.obj, _cfruni(label),
|
||||
icon.obj if icon else NULL,
|
||||
cb, <void *>self)
|
||||
|
||||
if item != NULL:
|
||||
self._set_obj(item)
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
def __str__(self):
|
||||
return "%s(func=%s, item_data=%s)" % \
|
||||
(self.__class__.__name__,
|
||||
self.params[0],
|
||||
self.params[1])
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
|
||||
"item_class=%s, func=%s, item_data=%r)") % \
|
||||
(self.__class__.__name__,
|
||||
<unsigned long><void*>self,
|
||||
PY_REFCOUNT(self),
|
||||
<unsigned long>self.item,
|
||||
self.params[0],
|
||||
self.params[1])
|
||||
|
||||
|
||||
cdef class Popup(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_popup_add(parent.obj))
|
||||
|
||||
def item_append(self, label = None, evasObject icon = None, func = None, *args, **kwargs):
|
||||
return PopupItem(self, label, icon, func, *args, **kwargs)
|
||||
|
||||
property content_text_wrap_type:
|
||||
def __set__(self, wrap):
|
||||
elm_popup_content_text_wrap_type_set(self.obj, wrap)
|
||||
def __get__(self):
|
||||
return elm_popup_content_text_wrap_type_get(self.obj)
|
||||
|
||||
property orient:
|
||||
def __set__(self, orient):
|
||||
elm_popup_orient_set(self.obj, orient)
|
||||
def __get__(self):
|
||||
return elm_popup_orient_get(self.obj)
|
||||
|
||||
property timeout:
|
||||
def __set__(self, timeout):
|
||||
elm_popup_timeout_set(self.obj, timeout)
|
||||
def __get__(self):
|
||||
return elm_popup_timeout_get(self.obj)
|
||||
|
||||
property allow_events:
|
||||
def __set__(self, allow):
|
||||
elm_popup_allow_events_set(self.obj, allow)
|
||||
def __get__(self):
|
||||
return bool(elm_popup_allow_events_get(self.obj))
|
||||
|
||||
def callback_timeout_add(self, func, *args, **kwargs):
|
||||
self._callback_add("timeout", func, *args, **kwargs)
|
||||
|
||||
def callback_timeout_del(self, func):
|
||||
self._callback_del("timeout", func)
|
||||
|
||||
def callback_block_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("block,clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_block_clicked_del(self, func):
|
||||
self._callback_del("block,clicked", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_popup", Popup)
|
|
@ -1,119 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Progressbar(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_progressbar_add(parent.obj))
|
||||
|
||||
def pulse_set(self, pulse):
|
||||
elm_progressbar_pulse_set(self.obj, pulse)
|
||||
|
||||
def pulse_get(self):
|
||||
return elm_progressbar_pulse_get(self.obj)
|
||||
|
||||
def pulse(self, state):
|
||||
elm_progressbar_pulse(self.obj, state)
|
||||
|
||||
def value_set(self, value):
|
||||
elm_progressbar_value_set(self.obj, value)
|
||||
|
||||
def value_get(self):
|
||||
return elm_progressbar_value_get(self.obj)
|
||||
|
||||
property value:
|
||||
def __get__(self):
|
||||
return elm_progressbar_value_get(self.obj)
|
||||
|
||||
def __set__(self, value):
|
||||
elm_progressbar_value_set(self.obj, value)
|
||||
|
||||
def span_size_set(self, size):
|
||||
elm_progressbar_span_size_set(self.obj, size)
|
||||
|
||||
def span_size_get(self):
|
||||
return elm_progressbar_span_size_get(self.obj)
|
||||
|
||||
property span_size:
|
||||
def __get__(self):
|
||||
return elm_progressbar_span_size_get(self.obj)
|
||||
|
||||
def __set__(self, size):
|
||||
elm_progressbar_span_size_set(self.obj, size)
|
||||
|
||||
def unit_format_set(self, format):
|
||||
if format is None:
|
||||
elm_progressbar_unit_format_set(self.obj, NULL)
|
||||
else:
|
||||
elm_progressbar_unit_format_set(self.obj, _cfruni(format))
|
||||
|
||||
def unit_format_get(self):
|
||||
return _ctouni(elm_progressbar_unit_format_get(self.obj))
|
||||
|
||||
property unit_format:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_progressbar_unit_format_get(self.obj))
|
||||
|
||||
def __set__(self, format):
|
||||
if format is None:
|
||||
elm_progressbar_unit_format_set(self.obj, NULL)
|
||||
else:
|
||||
elm_progressbar_unit_format_set(self.obj, _cfruni(format))
|
||||
|
||||
property unit_format_function:
|
||||
def __set__(self, func not None):
|
||||
pass
|
||||
#if not callable(func):
|
||||
#raise TypeError("func is not callable")
|
||||
#TODO: char * func(double value)
|
||||
#elm_progressbar_unit_format_function_set(self.obj, func, NULL)
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_progressbar_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_get(self):
|
||||
return bool(elm_progressbar_horizontal_get(self.obj))
|
||||
|
||||
property horizontal:
|
||||
def __get__(self):
|
||||
return bool(elm_progressbar_horizontal_get(self.obj))
|
||||
|
||||
def __set__(self, horizontal):
|
||||
elm_progressbar_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def inverted_set(self, inverted):
|
||||
elm_progressbar_inverted_set(self.obj, inverted)
|
||||
|
||||
def inverted_get(self):
|
||||
return bool(elm_progressbar_inverted_get(self.obj))
|
||||
|
||||
property inverted:
|
||||
def __get__(self):
|
||||
return bool(elm_progressbar_inverted_get(self.obj))
|
||||
|
||||
def __set__(self, inverted):
|
||||
elm_progressbar_inverted_set(self.obj, inverted)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_progressbar", Progressbar)
|
|
@ -1,85 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Radio(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent, obj=None):
|
||||
if obj is None:
|
||||
self._set_obj(elm_radio_add(parent.obj))
|
||||
else:
|
||||
self._set_obj(<Evas_Object*>obj)
|
||||
|
||||
def group_add(self, evasObject group):
|
||||
elm_radio_group_add(self.obj, group.obj)
|
||||
|
||||
def state_value_set(self, value):
|
||||
elm_radio_state_value_set(self.obj, value)
|
||||
|
||||
def state_value_get(self):
|
||||
return elm_radio_state_value_get(self.obj)
|
||||
|
||||
property state_value:
|
||||
def __get__(self):
|
||||
return elm_radio_state_value_get(self.obj)
|
||||
def __set__(self, value):
|
||||
elm_radio_state_value_set(self.obj, value)
|
||||
|
||||
def value_set(self, value):
|
||||
elm_radio_value_set(self.obj, value)
|
||||
|
||||
def value_get(self):
|
||||
return elm_radio_value_get(self.obj)
|
||||
|
||||
property value:
|
||||
def __get__(self):
|
||||
return elm_radio_value_get(self.obj)
|
||||
def __set__(self, value):
|
||||
elm_radio_value_set(self.obj, value)
|
||||
|
||||
#TODO: Check whether this actually works
|
||||
def value_pointer_set(self, value):
|
||||
cdef int valuep = value
|
||||
elm_radio_value_pointer_set(self.obj, &valuep)
|
||||
|
||||
def selected_object_get(self):
|
||||
cdef Radio r = Radio()
|
||||
cdef Evas_Object *selected = elm_radio_selected_object_get(self.obj)
|
||||
if selected == NULL:
|
||||
return None
|
||||
else:
|
||||
r.obj = selected
|
||||
return r
|
||||
|
||||
property selected_object:
|
||||
def __get__(self):
|
||||
cdef Radio r = Radio()
|
||||
cdef Evas_Object *selected = elm_radio_selected_object_get(self.obj)
|
||||
if selected == NULL:
|
||||
return None
|
||||
else:
|
||||
r.obj = selected
|
||||
return r
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_radio", Radio)
|
|
@ -1,233 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Scroller(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_scroller_add(parent.obj))
|
||||
|
||||
def content_min_limit(self, w, h):
|
||||
elm_scroller_content_min_limit(self.obj, w, h)
|
||||
|
||||
def region_show(self, x, y, w, h):
|
||||
elm_scroller_region_show(self.obj, x, y, w, h)
|
||||
|
||||
def policy_set(self, policy_h, policy_v):
|
||||
elm_scroller_policy_set(self.obj, policy_h, policy_v)
|
||||
|
||||
def policy_get(self):
|
||||
cdef Elm_Scroller_Policy policy_h, policy_v
|
||||
elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
|
||||
return (policy_h, policy_v)
|
||||
|
||||
property policy:
|
||||
def __get__(self):
|
||||
cdef Elm_Scroller_Policy policy_h, policy_v
|
||||
elm_scroller_policy_get(self.obj, &policy_h, &policy_v)
|
||||
return (policy_h, policy_v)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef Elm_Scroller_Policy policy_h, policy_v
|
||||
policy_h, policy_v = value
|
||||
elm_scroller_policy_set(self.obj, policy_h, policy_v)
|
||||
|
||||
def region_get(self):
|
||||
cdef Evas_Coord x, y, w, h
|
||||
elm_scroller_region_get(self.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
property region:
|
||||
def __get__(self):
|
||||
cdef Evas_Coord x, y, w, h
|
||||
elm_scroller_region_get(self.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
def child_size_get(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_scroller_child_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
property child_size:
|
||||
def __get__(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_scroller_child_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
def bounce_set(self, h, v):
|
||||
elm_scroller_bounce_set(self.obj, h, v)
|
||||
|
||||
def bounce_get(self):
|
||||
cdef Eina_Bool h, v
|
||||
elm_scroller_bounce_get(self.obj, &h, &v)
|
||||
return (h, v)
|
||||
|
||||
property bounce:
|
||||
def __get__(self):
|
||||
cdef Eina_Bool h, v
|
||||
elm_scroller_bounce_get(self.obj, &h, &v)
|
||||
return (h, v)
|
||||
|
||||
def __set__(self, value):
|
||||
cdef Eina_Bool h, v
|
||||
h, v = value
|
||||
elm_scroller_bounce_set(self.obj, h, v)
|
||||
|
||||
def page_relative_set(self, h_pagerel, v_pagerel):
|
||||
elm_scroller_page_relative_set(self.obj, h_pagerel, v_pagerel)
|
||||
|
||||
def page_relative_get(self):
|
||||
cdef double h_pagerel, v_pagerel
|
||||
elm_scroller_page_relative_get(self.obj, &h_pagerel, &v_pagerel)
|
||||
return (h_pagerel, v_pagerel)
|
||||
|
||||
property page_relative:
|
||||
def __set__(self, value):
|
||||
h_pagerel, v_pagerel = value
|
||||
elm_scroller_page_relative_set(self.obj, h_pagerel, v_pagerel)
|
||||
|
||||
def __get__(self):
|
||||
cdef double h_pagerel, v_pagerel
|
||||
elm_scroller_page_relative_get(self.obj, &h_pagerel, &v_pagerel)
|
||||
return (h_pagerel, v_pagerel)
|
||||
|
||||
def page_size_set(self, h_pagesize, v_pagesize):
|
||||
elm_scroller_page_size_set(self.obj, h_pagesize, v_pagesize)
|
||||
|
||||
property page_size:
|
||||
def __set__(self, value):
|
||||
h_pagesize, v_pagesize = value
|
||||
elm_scroller_page_size_set(self.obj, h_pagesize, v_pagesize)
|
||||
|
||||
def current_page_get(self):
|
||||
cdef int h_pagenumber, v_pagenumber
|
||||
elm_scroller_current_page_get(self.obj, &h_pagenumber, &v_pagenumber)
|
||||
return (h_pagenumber, v_pagenumber)
|
||||
|
||||
property current_page:
|
||||
def __get__(self):
|
||||
cdef int h_pagenumber, v_pagenumber
|
||||
elm_scroller_current_page_get(self.obj, &h_pagenumber, &v_pagenumber)
|
||||
return (h_pagenumber, v_pagenumber)
|
||||
|
||||
def last_page_get(self):
|
||||
cdef int h_pagenumber, v_pagenumber
|
||||
elm_scroller_last_page_get(self.obj, &h_pagenumber, &v_pagenumber)
|
||||
return (h_pagenumber, v_pagenumber)
|
||||
|
||||
property last_page:
|
||||
def __get__(self):
|
||||
cdef int h_pagenumber, v_pagenumber
|
||||
elm_scroller_last_page_get(self.obj, &h_pagenumber, &v_pagenumber)
|
||||
return (h_pagenumber, v_pagenumber)
|
||||
|
||||
def page_show(self, h_pagenumber, v_pagenumber):
|
||||
elm_scroller_page_show(self.obj, h_pagenumber, v_pagenumber)
|
||||
|
||||
def page_bring_in(self, h_pagenumber, v_pagenumber):
|
||||
elm_scroller_page_bring_in(self.obj, h_pagenumber, v_pagenumber)
|
||||
|
||||
def region_bring_in(self, x, y, w, h):
|
||||
elm_scroller_region_bring_in(self.obj, x, y, w, h)
|
||||
|
||||
def propagate_events_set(self, propagation):
|
||||
elm_scroller_propagate_events_set(self.obj, propagation)
|
||||
|
||||
def propagate_events_get(self):
|
||||
return bool(elm_scroller_propagate_events_get(self.obj))
|
||||
|
||||
property propagate_events:
|
||||
def __get__(self):
|
||||
return bool(elm_scroller_propagate_events_get(self.obj))
|
||||
|
||||
def __set__(self, propagation):
|
||||
elm_scroller_propagate_events_set(self.obj, propagation)
|
||||
|
||||
def gravity_set(self, x, y):
|
||||
elm_scroller_gravity_set(self.obj, x, y)
|
||||
|
||||
def gravity_get(self):
|
||||
cdef double x, y
|
||||
elm_scroller_gravity_get(self.obj, &x, &y)
|
||||
return (x, y)
|
||||
|
||||
property gravity:
|
||||
def __get__(self):
|
||||
cdef double x, y
|
||||
elm_scroller_gravity_get(self.obj, &x, &y)
|
||||
return (x, y)
|
||||
|
||||
def __set__(self, value):
|
||||
x, y = value
|
||||
elm_scroller_gravity_set(self.obj, x, y)
|
||||
|
||||
def callback_edge_left_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,left", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_left_del(self, func):
|
||||
self._callback_del("edge,left", func)
|
||||
|
||||
def callback_edge_right_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,right", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_right_del(self, func):
|
||||
self._callback_del("edge,right", func)
|
||||
|
||||
def callback_edge_top_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,top", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_top_del(self, func):
|
||||
self._callback_del("edge,top", func)
|
||||
|
||||
def callback_edge_bottom_add(self, func, *args, **kwargs):
|
||||
self._callback_add("edge,bottom", func, *args, **kwargs)
|
||||
|
||||
def callback_edge_bottom_del(self, func):
|
||||
self._callback_del("edge,bottom", func)
|
||||
|
||||
def callback_scroll_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_del(self, func):
|
||||
self._callback_del("scroll", func)
|
||||
|
||||
def callback_scroll_anim_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_start_del(self, func):
|
||||
self._callback_del("scroll,anim,start", func)
|
||||
|
||||
def callback_scroll_anim_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,anim,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_anim_stop_del(self, func):
|
||||
self._callback_del("scroll,anim,stop", func)
|
||||
|
||||
def callback_scroll_drag_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,start", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_start_del(self, func):
|
||||
self._callback_del("scroll,drag,start", func)
|
||||
|
||||
def callback_scroll_drag_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("scroll,drag,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_scroll_drag_stop_del(self, func):
|
||||
self._callback_del("scroll,drag,stop", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_scroller", Scroller)
|
|
@ -1,102 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class SegmentControlItem(ObjectItem):
|
||||
|
||||
def index_get(self):
|
||||
return elm_segment_control_item_index_get(self.item)
|
||||
|
||||
property index:
|
||||
def __get__(self):
|
||||
return elm_segment_control_item_index_get(self.item)
|
||||
|
||||
def object_get(self):
|
||||
return object_from_instance(elm_segment_control_item_object_get(self.item))
|
||||
|
||||
property object:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_segment_control_item_object_get(self.item))
|
||||
|
||||
def selected_set(self, select):
|
||||
elm_segment_control_item_selected_set(self.item, select)
|
||||
|
||||
property selected:
|
||||
def __set__(self, select):
|
||||
elm_segment_control_item_selected_set(self.item, select)
|
||||
|
||||
|
||||
cdef class SegmentControl(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_segment_control_add(parent.obj))
|
||||
|
||||
def item_add(self, evasObject icon, label = None):
|
||||
cdef SegmentControlItem ret = SegmentControlItem()
|
||||
cdef Elm_Object_Item *item
|
||||
|
||||
item = elm_segment_control_item_add(self.obj,
|
||||
icon.obj if icon else NULL,
|
||||
_cfruni(label))
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def item_insert_at(self, evasObject icon, label = None, index = 0):
|
||||
cdef SegmentControlItem ret = SegmentControlItem()
|
||||
cdef Elm_Object_Item *item
|
||||
|
||||
item = elm_segment_control_item_insert_at(self.obj,
|
||||
icon.obj if icon else NULL,
|
||||
_cfruni(label), index)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def item_del_at(self, index):
|
||||
elm_segment_control_item_del_at(self.obj, index)
|
||||
|
||||
property item_count:
|
||||
def __get__(self):
|
||||
return elm_segment_control_item_count_get(self.obj)
|
||||
|
||||
def item_get(self, index):
|
||||
return _object_item_to_python(elm_segment_control_item_get(self.obj, index))
|
||||
|
||||
def item_label_get(self, index):
|
||||
return _ctouni(elm_segment_control_item_label_get(self.obj, index))
|
||||
|
||||
def item_icon_get(self, index):
|
||||
return object_from_instance(elm_segment_control_item_icon_get(self.obj, index))
|
||||
|
||||
property item_selected:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_segment_control_item_selected_get(self.obj))
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("changed", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del_full("changed", _cb_object_item_conv, func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_segment_control", SegmentControl)
|
|
@ -1,186 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Slider(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_slider_add(parent.obj))
|
||||
|
||||
def span_size_set(self, size):
|
||||
elm_slider_span_size_set(self.obj, size)
|
||||
|
||||
def span_size_get(self):
|
||||
return elm_slider_span_size_get(self.obj)
|
||||
|
||||
property span_size:
|
||||
def __get__(self):
|
||||
return elm_slider_span_size_get(self.obj)
|
||||
|
||||
def __set__(self, size):
|
||||
elm_slider_span_size_set(self.obj, size)
|
||||
|
||||
def unit_format_set(self, format):
|
||||
elm_slider_unit_format_set(self.obj, _cfruni(format))
|
||||
|
||||
def unit_format_get(self):
|
||||
return _ctouni(elm_slider_unit_format_get(self.obj))
|
||||
|
||||
property unit_format:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_slider_unit_format_get(self.obj))
|
||||
|
||||
def __set__(self, format):
|
||||
elm_slider_unit_format_set(self.obj, _cfruni(format))
|
||||
|
||||
def indicator_format_set(self, format):
|
||||
elm_slider_indicator_format_set(self.obj, _cfruni(format))
|
||||
|
||||
def indicator_format_get(self):
|
||||
return _ctouni(elm_slider_indicator_format_get(self.obj))
|
||||
|
||||
property indicator_format:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_slider_indicator_format_get(self.obj))
|
||||
|
||||
def __set__(self, format):
|
||||
elm_slider_indicator_format_set(self.obj, _cfruni(format))
|
||||
|
||||
#TODO: def indicator_format_function_set(self, func, free_func)
|
||||
#~ """Set the format function pointer for the indicator label
|
||||
#~
|
||||
#~ Set the callback function to format the indicator string.
|
||||
#~
|
||||
#~ @see: L{indicator_format_set()} for more info on how this works.
|
||||
#~
|
||||
#~ @param func: The indicator format function.
|
||||
#~ @type func: function
|
||||
#~ @param free_func: The freeing function for the format string.
|
||||
#~ @type free_func: function
|
||||
#~
|
||||
#~ """
|
||||
#elm_slider_indicator_format_function_set(self.obj, char(*func)(double val), void (*free_func)(charstr))
|
||||
|
||||
#TODO: def units_format_function_set(self, func, free_func)
|
||||
#~ """Set the format function pointer for the units label
|
||||
#~
|
||||
#~ Set the callback function to format the units string.
|
||||
#~
|
||||
#~ @see: L{units_format_set() for more info on how this works.
|
||||
#~
|
||||
#~ @param func: The units format function.
|
||||
#~ @type func: function
|
||||
#~ @param free_func: The freeing function for the format string.
|
||||
#~ @type free_func: function
|
||||
#~
|
||||
#~ """
|
||||
#elm_slider_units_format_function_set(self.obj, char(*func)(double val), void (*free_func)(charstr))
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_slider_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_get(self):
|
||||
return bool(elm_slider_horizontal_get(self.obj))
|
||||
|
||||
property horizontal:
|
||||
def __get__(self):
|
||||
return bool(elm_slider_horizontal_get(self.obj))
|
||||
def __set__(self, horizontal):
|
||||
elm_slider_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def min_max_set(self, min, max):
|
||||
elm_slider_min_max_set(self.obj, min, max)
|
||||
|
||||
def min_max_get(self):
|
||||
cdef double min, max
|
||||
elm_slider_min_max_get(self.obj, &min, &max)
|
||||
return (min, max)
|
||||
|
||||
property min_max:
|
||||
def __get__(self):
|
||||
cdef double min, max
|
||||
elm_slider_min_max_get(self.obj, &min, &max)
|
||||
return (min, max)
|
||||
|
||||
def __set__(self, value):
|
||||
min, max = value
|
||||
elm_slider_min_max_set(self.obj, min, max)
|
||||
|
||||
def value_set(self, value):
|
||||
elm_slider_value_set(self.obj, value)
|
||||
|
||||
def value_get(self):
|
||||
return elm_slider_value_get(self.obj)
|
||||
|
||||
property value:
|
||||
def __get__(self):
|
||||
return elm_slider_value_get(self.obj)
|
||||
def __set__(self, value):
|
||||
elm_slider_value_set(self.obj, value)
|
||||
|
||||
def inverted_set(self, inverted):
|
||||
elm_slider_inverted_set(self.obj, inverted)
|
||||
|
||||
def inverted_get(self):
|
||||
return bool(elm_slider_inverted_get(self.obj))
|
||||
|
||||
property inverted:
|
||||
def __get__(self):
|
||||
return bool(elm_slider_inverted_get(self.obj))
|
||||
|
||||
def __set__(self, inverted):
|
||||
elm_slider_inverted_set(self.obj, inverted)
|
||||
|
||||
def indicator_show_set(self, show):
|
||||
elm_slider_indicator_show_set(self.obj, show)
|
||||
|
||||
def indicator_show_get(self):
|
||||
return bool(elm_slider_indicator_show_get(self.obj))
|
||||
|
||||
property indicator_show:
|
||||
def __get__(self):
|
||||
return bool(elm_slider_indicator_show_get(self.obj))
|
||||
|
||||
def __set__(self, show):
|
||||
elm_slider_indicator_show_set(self.obj, show)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
def callback_slider_drag_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("slider,drag,start", func, *args, **kwargs)
|
||||
|
||||
def callback_slider_drag_start_del(self, func):
|
||||
self._callback_del("slider,drag,start", func)
|
||||
|
||||
def callback_slider_drag_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("slider,drag,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_slider_drag_stop_del(self, func):
|
||||
self._callback_del("slider,drag,stop", func)
|
||||
|
||||
def callback_delay_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("delay,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_delay_changed_del(self, func):
|
||||
self._callback_del("delay,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_slider", Slider)
|
|
@ -1,293 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef _py_elm_slideshow_item_call(func, Evas_Object *obj, data) with gil:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
(args, kwargs) = data
|
||||
return func(o, *args, **kwargs)
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return None
|
||||
|
||||
cdef Evas_Object *_py_elm_slideshow_item_get(void *data, Evas_Object *obj) with gil:
|
||||
cdef SlideshowItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef evasObject icon
|
||||
cdef SlideshowItemClass itc = params[0]
|
||||
|
||||
func = itc._get_func
|
||||
if func is None:
|
||||
return NULL
|
||||
|
||||
ret = _py_elm_slideshow_item_call(func, obj, params[1])
|
||||
if ret is not None:
|
||||
try:
|
||||
icon = ret
|
||||
return icon.obj
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return NULL
|
||||
else:
|
||||
return NULL
|
||||
|
||||
cdef void _py_elm_slideshow_item_del(void *data, Evas_Object *obj) with gil:
|
||||
cdef SlideshowItem item = <object>data
|
||||
cdef object params = item.params
|
||||
cdef SlideshowItemClass itc = params[0]
|
||||
|
||||
func = itc._del_func
|
||||
if func is not None:
|
||||
try:
|
||||
o = object_from_instance(obj)
|
||||
func(o, params[1])
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
item._unset_obj()
|
||||
Py_DECREF(item)
|
||||
|
||||
cdef int _py_elm_slideshow_compare_func(const_void *data1, const_void *data2) with gil:
|
||||
cdef SlideshowItem item1 = <object>data1
|
||||
cdef SlideshowItem item2 = <object>data2
|
||||
cdef object params = item1.params
|
||||
cdef object func = params[2]
|
||||
|
||||
if func is None:
|
||||
return 0
|
||||
|
||||
ret = func(item1, item2)
|
||||
if ret is not None:
|
||||
try:
|
||||
return ret
|
||||
except Exception as e:
|
||||
traceback.print_exc()
|
||||
return 0
|
||||
else:
|
||||
return 0
|
||||
|
||||
|
||||
cdef class SlideshowItemClass(object):
|
||||
cdef Elm_Slideshow_Item_Class obj
|
||||
cdef readonly object _get_func
|
||||
cdef readonly object _del_func
|
||||
|
||||
def __cinit__(self, *a, **ka):
|
||||
self._get_func = None
|
||||
self._del_func = None
|
||||
|
||||
self.obj.func.get = _py_elm_slideshow_item_get
|
||||
self.obj.func.del_ = _py_elm_slideshow_item_del
|
||||
|
||||
def __init__(self, get_func=None, del_func=None):
|
||||
if get_func and not callable(get_func):
|
||||
raise TypeError("get_func is not callable!")
|
||||
elif get_func:
|
||||
self._get_func = get_func
|
||||
else:
|
||||
self._get_func = self.get
|
||||
|
||||
if del_func and not callable(del_func):
|
||||
raise TypeError("del_func is not callable!")
|
||||
elif del_func:
|
||||
self._del_func = del_func
|
||||
else:
|
||||
try:
|
||||
self._del_func = self.delete
|
||||
except AttributeError:
|
||||
pass
|
||||
|
||||
def __str__(self):
|
||||
return ("%s(get_func=%s, del_func=%s)") % \
|
||||
(self.__class__.__name__,
|
||||
self._get_func,
|
||||
self._del_func)
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Slideshow_Item_Class=%#x, "
|
||||
"get_func=%s, del_func=%s)") % \
|
||||
(self.__class__.__name__,
|
||||
<unsigned long><void *>self,
|
||||
PY_REFCOUNT(self),
|
||||
<unsigned long>&self.obj,
|
||||
self._get_func,
|
||||
self._del_func)
|
||||
|
||||
def get(self, evasObject obj, item_data):
|
||||
return None
|
||||
|
||||
|
||||
cdef class SlideshowItem(ObjectItem):
|
||||
|
||||
cdef int _set_obj(self, Elm_Object_Item *item, params=None) except 0:
|
||||
assert self.item == NULL, "Object must be clean"
|
||||
self.item = item
|
||||
Py_INCREF(self)
|
||||
return 1
|
||||
|
||||
cdef void _unset_obj(self):
|
||||
assert self.item != NULL, "Object must wrap something"
|
||||
self.item = NULL
|
||||
|
||||
def __str__(self):
|
||||
return "%s(item_class=%s, func=%s, item_data=%s)" % \
|
||||
(self.__class__.__name__,
|
||||
self.params[0].__class__.__name__,
|
||||
self.params[3],
|
||||
self.params[1])
|
||||
|
||||
def __repr__(self):
|
||||
return ("%s(%#x, refcount=%d, Elm_Object_Item=%#x, "
|
||||
"item_class=%s, func=%s, item_data=%r)") % \
|
||||
(self.__class__.__name__,
|
||||
<unsigned long><void*>self,
|
||||
PY_REFCOUNT(self),
|
||||
<unsigned long>self.obj,
|
||||
self.params[0].__class__.__name__,
|
||||
self.params[3],
|
||||
self.params[1])
|
||||
|
||||
property object:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_slideshow_item_object_get(self.item))
|
||||
|
||||
def show(self):
|
||||
elm_slideshow_item_show(self.item)
|
||||
|
||||
|
||||
cdef class Slideshow(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_slideshow_add(parent.obj))
|
||||
|
||||
def item_add(self, SlideshowItemClass item_class not None, *args, **kwargs):
|
||||
cdef SlideshowItem ret = SlideshowItem()
|
||||
cdef Elm_Object_Item *item
|
||||
|
||||
item_data = (args, kwargs)
|
||||
ret.params = (item_class, item_data)
|
||||
item = elm_slideshow_item_add(self.obj, &item_class.obj, <void*>ret)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def item_sorted_insert(self, SlideshowItemClass item_class not None,
|
||||
func not None, *args, **kwargs):
|
||||
cdef SlideshowItem ret = SlideshowItem()
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Eina_Compare_Cb compare
|
||||
|
||||
if callable(func):
|
||||
compare = _py_elm_slideshow_compare_func
|
||||
else:
|
||||
raise TypeError("func is not None or callable")
|
||||
|
||||
item_data = (args, kwargs)
|
||||
ret.params = (item_class, item_data, func)
|
||||
item = elm_slideshow_item_sorted_insert(self.obj, &item_class.obj, <void*>ret, compare)
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return None
|
||||
|
||||
def next(self):
|
||||
elm_slideshow_next(self.obj)
|
||||
|
||||
def previous(self):
|
||||
elm_slideshow_previous(self.obj)
|
||||
|
||||
property transitions:
|
||||
def __get__(self):
|
||||
return tuple(_strings_to_python(elm_slideshow_transitions_get(self.obj)))
|
||||
|
||||
property transition:
|
||||
def __set__(self, transition):
|
||||
elm_slideshow_transition_set(self.obj, _cfruni(transition))
|
||||
def __get__(self):
|
||||
return _ctouni(elm_slideshow_transition_get(self.obj))
|
||||
|
||||
property timeout:
|
||||
def __set__(self, timeout):
|
||||
elm_slideshow_timeout_set(self.obj, timeout)
|
||||
def __get__(self):
|
||||
return elm_slideshow_timeout_get(self.obj)
|
||||
|
||||
property loop:
|
||||
def __set__(self, loop):
|
||||
elm_slideshow_loop_set(self.obj, loop)
|
||||
def __get__(self):
|
||||
return bool(elm_slideshow_loop_get(self.obj))
|
||||
|
||||
def clear(self):
|
||||
elm_slideshow_clear(self.obj)
|
||||
|
||||
property items:
|
||||
def __get__(self):
|
||||
return tuple(_object_item_list_to_python(elm_slideshow_items_get(self.obj)))
|
||||
|
||||
property current_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_slideshow_item_current_get(self.obj))
|
||||
|
||||
def nth_item_get(self, nth):
|
||||
return _object_item_to_python(elm_slideshow_item_nth_get(self.obj, nth))
|
||||
|
||||
property layout:
|
||||
def __set__(self, layout):
|
||||
elm_slideshow_layout_set(self.obj, _cfruni(layout))
|
||||
def __get__(self):
|
||||
return _ctouni(elm_slideshow_layout_get(self.obj))
|
||||
|
||||
property layouts:
|
||||
def __get__(self):
|
||||
return tuple(_strings_to_python(elm_slideshow_layouts_get(self.obj)))
|
||||
|
||||
property cache_before:
|
||||
def __set__(self, count):
|
||||
elm_slideshow_cache_before_set(self.obj, count)
|
||||
def __get__(self):
|
||||
return elm_slideshow_cache_before_get(self.obj)
|
||||
|
||||
property cache_after:
|
||||
def __set__(self, count):
|
||||
elm_slideshow_cache_after_set(self.obj, count)
|
||||
def __get__(self):
|
||||
return elm_slideshow_cache_after_get(self.obj)
|
||||
|
||||
property count:
|
||||
def __get__(self):
|
||||
return elm_slideshow_count_get(self.obj)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("changed", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del_full("changed", _cb_object_item_conv, func)
|
||||
|
||||
def callback_transition_end_add(self, func, *args, **kwargs):
|
||||
self._callback_add_full("transition,end", _cb_object_item_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_transition_end_del(self, func):
|
||||
self._callback_del_full("transition,end", _cb_object_item_conv, func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_slideshow", Slideshow)
|
|
@ -1,159 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Spinner(LayoutClass):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_spinner_add(parent.obj))
|
||||
|
||||
def label_format_set(self, format):
|
||||
elm_spinner_label_format_set(self.obj, _cfruni(format))
|
||||
|
||||
def label_format_get(self):
|
||||
return _ctouni(elm_spinner_label_format_get(self.obj))
|
||||
|
||||
property label_format:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_spinner_label_format_get(self.obj))
|
||||
|
||||
def __set__(self, format):
|
||||
elm_spinner_label_format_set(self.obj, _cfruni(format))
|
||||
|
||||
def min_max_set(self, min, max):
|
||||
elm_spinner_min_max_set(self.obj, min, max)
|
||||
|
||||
def min_max_get(self):
|
||||
cdef double min, max
|
||||
elm_spinner_min_max_get(self.obj, &min, &max)
|
||||
return (min, max)
|
||||
|
||||
property min_max:
|
||||
def __get__(self):
|
||||
cdef double min, max
|
||||
elm_spinner_min_max_get(self.obj, &min, &max)
|
||||
return (min, max)
|
||||
|
||||
def __set__(self, value):
|
||||
min, max = value
|
||||
elm_spinner_min_max_set(self.obj, min, max)
|
||||
|
||||
def step_set(self, step):
|
||||
elm_spinner_step_set(self.obj, step)
|
||||
|
||||
def step_get(self):
|
||||
return elm_spinner_step_get(self.obj)
|
||||
|
||||
property step:
|
||||
def __get__(self):
|
||||
return elm_spinner_step_get(self.obj)
|
||||
|
||||
def __set__(self, step):
|
||||
elm_spinner_step_set(self.obj, step)
|
||||
|
||||
def value_set(self, value):
|
||||
elm_spinner_value_set(self.obj, value)
|
||||
|
||||
def value_get(self):
|
||||
return elm_spinner_value_get(self.obj)
|
||||
|
||||
property value:
|
||||
def __get__(self):
|
||||
return elm_spinner_value_get(self.obj)
|
||||
def __set__(self, value):
|
||||
elm_spinner_value_set(self.obj, value)
|
||||
|
||||
def wrap_set(self, wrap):
|
||||
elm_spinner_wrap_set(self.obj, wrap)
|
||||
|
||||
def wrap_get(self):
|
||||
return elm_spinner_wrap_get(self.obj)
|
||||
|
||||
property wrap:
|
||||
def __get__(self):
|
||||
return elm_spinner_wrap_get(self.obj)
|
||||
def __set__(self, wrap):
|
||||
elm_spinner_wrap_set(self.obj, wrap)
|
||||
|
||||
def editable_set(self, editable):
|
||||
elm_spinner_editable_set(self.obj, editable)
|
||||
|
||||
def editable_get(self):
|
||||
return elm_spinner_editable_get(self.obj)
|
||||
|
||||
property editable:
|
||||
def __get__(self):
|
||||
return elm_spinner_editable_get(self.obj)
|
||||
def __set__(self, editable):
|
||||
elm_spinner_editable_set(self.obj, editable)
|
||||
|
||||
def special_value_add(self, value, label):
|
||||
elm_spinner_special_value_add(self.obj, value, _cfruni(label))
|
||||
|
||||
def interval_set(self, interval):
|
||||
elm_spinner_interval_set(self.obj, interval)
|
||||
|
||||
def interval_get(self):
|
||||
return elm_spinner_interval_get(self.obj)
|
||||
|
||||
property interval:
|
||||
def __get__(self):
|
||||
return elm_spinner_interval_get(self.obj)
|
||||
|
||||
def __set__(self, interval):
|
||||
elm_spinner_interval_set(self.obj, interval)
|
||||
|
||||
def base_set(self, base):
|
||||
elm_spinner_base_set(self.obj, base)
|
||||
|
||||
def base_get(self):
|
||||
return elm_spinner_base_get(self.obj)
|
||||
|
||||
property base:
|
||||
def __get__(self):
|
||||
return elm_spinner_base_get(self.obj)
|
||||
|
||||
def __set__(self, base):
|
||||
elm_spinner_base_set(self.obj, base)
|
||||
|
||||
def round_set(self, rnd):
|
||||
elm_spinner_round_set(self.obj, rnd)
|
||||
|
||||
def round_get(self):
|
||||
return elm_spinner_round_get(self.obj)
|
||||
|
||||
property round:
|
||||
def __get__(self):
|
||||
return elm_spinner_round_get(self.obj)
|
||||
|
||||
def __set__(self, rnd):
|
||||
elm_spinner_round_set(self.obj, rnd)
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
def callback_delay_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("delay,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_delay_changed_del(self, func):
|
||||
self._callback_del("delay,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_spinner", Spinner)
|
|
@ -1,73 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Table(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_table_add(parent.obj))
|
||||
|
||||
def homogeneous_set(self, homogeneous):
|
||||
elm_table_homogeneous_set(self.obj, homogeneous)
|
||||
|
||||
def homogeneous_get(self):
|
||||
return elm_table_homogeneous_get(self.obj)
|
||||
|
||||
property homogeneous:
|
||||
def __get__(self):
|
||||
return elm_table_homogeneous_get(self.obj)
|
||||
|
||||
def __set__(self, homogeneous):
|
||||
elm_table_homogeneous_set(self.obj, homogeneous)
|
||||
|
||||
def padding_set(self, horizontal, vertical):
|
||||
elm_table_padding_set(self.obj, horizontal, vertical)
|
||||
|
||||
def padding_get(self):
|
||||
cdef Evas_Coord horizontal, vertical
|
||||
elm_table_padding_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
property padding:
|
||||
def __get__(self):
|
||||
cdef Evas_Coord horizontal, vertical
|
||||
elm_table_padding_get(self.obj, &horizontal, &vertical)
|
||||
return (horizontal, vertical)
|
||||
|
||||
def __set__(self, value):
|
||||
horizontal, vertical = value
|
||||
elm_table_padding_set(self.obj, horizontal, vertical)
|
||||
|
||||
def pack(self, evasObject subobj, x, y, w, h):
|
||||
elm_table_pack(self.obj, subobj.obj, x, y, w, h)
|
||||
|
||||
def unpack(self, evasObject subobj):
|
||||
elm_table_unpack(self.obj, subobj.obj)
|
||||
|
||||
def clear(self, clear):
|
||||
elm_table_clear(self.obj, clear)
|
||||
|
||||
def pack_set(evasObject subobj, x, y, w, h):
|
||||
elm_table_pack_set(subobj.obj, x, y, w, h)
|
||||
|
||||
def pack_get(evasObject subobj):
|
||||
cdef int x, y, w, h
|
||||
elm_table_pack_get(subobj.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
|
||||
_object_mapping_register("elm_table", Table)
|
|
@ -1,110 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Theme(object):
|
||||
|
||||
cdef Elm_Theme *th
|
||||
|
||||
def __cinit__(self):
|
||||
self.th = NULL
|
||||
|
||||
def __init__(self, default=False):
|
||||
cdef Elm_Theme *th
|
||||
if default:
|
||||
th = elm_theme_default_get()
|
||||
else:
|
||||
th = elm_theme_new()
|
||||
|
||||
if th != NULL:
|
||||
self.th = th
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
def __dealloc__(self):
|
||||
if self.th != NULL:
|
||||
elm_theme_free(self.th)
|
||||
self.th = NULL
|
||||
|
||||
def copy(self, Theme thdst):
|
||||
elm_theme_copy(self.th, thdst.th)
|
||||
|
||||
property reference:
|
||||
def __set__(self, Theme thref):
|
||||
elm_theme_ref_set(self.th, thref.th)
|
||||
|
||||
def __get__(self):
|
||||
cdef Theme thref = Theme()
|
||||
thref.th = elm_theme_ref_get(self.th)
|
||||
return thref
|
||||
|
||||
def overlay_add(self, item):
|
||||
elm_theme_overlay_add(self.th, _cfruni(item))
|
||||
|
||||
def overlay_del(self, item):
|
||||
elm_theme_overlay_del(self.th, _cfruni(item))
|
||||
|
||||
property overlay_list:
|
||||
def __get__(self):
|
||||
return tuple(_strings_to_python(elm_theme_overlay_list_get(self.th)))
|
||||
|
||||
def extension_add(self, item):
|
||||
elm_theme_extension_add(self.th, _cfruni(item))
|
||||
|
||||
def extension_del(self, item):
|
||||
elm_theme_extension_del(self.th, _cfruni(item))
|
||||
|
||||
property extension_list:
|
||||
def __get__(self):
|
||||
return tuple(_strings_to_python(elm_theme_extension_list_get(self.th)))
|
||||
|
||||
property order:
|
||||
def __set__(self, theme):
|
||||
elm_theme_set(self.th, _cfruni(theme))
|
||||
|
||||
def __get__(self):
|
||||
return _ctouni(elm_theme_get(self.th))
|
||||
|
||||
property elements:
|
||||
def __get__(self):
|
||||
return tuple(_strings_to_python(elm_theme_list_get(self.th)))
|
||||
|
||||
def flush(self):
|
||||
elm_theme_flush(self.th)
|
||||
|
||||
def data_get(self, key):
|
||||
return _ctouni(elm_theme_data_get(self.th, _cfruni(key)))
|
||||
|
||||
def theme_list_item_path_get(f, in_search_path):
|
||||
cdef Eina_Bool path = in_search_path
|
||||
return _ctouni(elm_theme_list_item_path_get(_cfruni(f), &path))
|
||||
|
||||
def theme_full_flush():
|
||||
elm_theme_full_flush()
|
||||
|
||||
def theme_name_available_list():
|
||||
cdef Eina_List *lst = elm_theme_name_available_list_new()
|
||||
elements = tuple(_strings_to_python(lst))
|
||||
elm_theme_name_available_list_free(lst)
|
||||
return elements
|
||||
|
||||
# for compatibility
|
||||
def theme_overlay_add(item):
|
||||
elm_theme_overlay_add(NULL, item)
|
||||
|
||||
def theme_extension_add(item):
|
||||
elm_theme_extension_add(NULL, item)
|
|
@ -1,110 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Thumb(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_thumb_add(parent.obj))
|
||||
|
||||
def reload(self):
|
||||
elm_thumb_reload(self.obj)
|
||||
|
||||
property file:
|
||||
def __set__(self, value):
|
||||
if isinstance(value, tuple) or isinstance(value, list):
|
||||
file, key = value
|
||||
else:
|
||||
file = value
|
||||
key = None
|
||||
elm_thumb_file_set( self.obj,
|
||||
_cfruni(file) if file is not None else NULL,
|
||||
_cfruni(key) if key is not None else NULL)
|
||||
def __get__(self):
|
||||
cdef const_char_ptr file, key
|
||||
elm_thumb_file_get(self.obj, &file, &key)
|
||||
return(_ctouni(file), _ctouni(key))
|
||||
|
||||
property path:
|
||||
def __get__(self):
|
||||
cdef const_char_ptr path, key
|
||||
elm_thumb_path_get(self.obj, &path, &key)
|
||||
return(_ctouni(path), _ctouni(key))
|
||||
|
||||
property animate:
|
||||
def __set__(self, s):
|
||||
elm_thumb_animate_set(self.obj, s)
|
||||
def __get__(self):
|
||||
return elm_thumb_animate_get(self.obj)
|
||||
|
||||
def ethumb_client_get(self):
|
||||
return None
|
||||
#return elm_thumb_ethumb_client_get(void)
|
||||
|
||||
def ethumb_client_connected_get(self):
|
||||
return bool(elm_thumb_ethumb_client_connected_get())
|
||||
|
||||
property editable:
|
||||
def __set__(self, edit):
|
||||
elm_thumb_editable_set(self.obj, edit)
|
||||
def __get__(self):
|
||||
return bool(elm_thumb_editable_get(self.obj))
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_clicked_double_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked,double", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_double_del(self, func):
|
||||
self._callback_del("clicked,double", func)
|
||||
|
||||
def callback_press_add(self, func, *args, **kwargs):
|
||||
self._callback_add("press", func, *args, **kwargs)
|
||||
|
||||
def callback_press_del(self, func):
|
||||
self._callback_del("press", func)
|
||||
|
||||
def callback_generate_start_add(self, func, *args, **kwargs):
|
||||
self._callback_add("generate,start", func, *args, **kwargs)
|
||||
|
||||
def callback_generate_start_del(self, func):
|
||||
self._callback_del("generate,start", func)
|
||||
|
||||
def callback_generate_stop_add(self, func, *args, **kwargs):
|
||||
self._callback_add("generate,stop", func, *args, **kwargs)
|
||||
|
||||
def callback_generate_stop_del(self, func):
|
||||
self._callback_del("generate,stop", func)
|
||||
|
||||
def callback_generate_error_add(self, func, *args, **kwargs):
|
||||
self._callback_add("generate,error", func, *args, **kwargs)
|
||||
|
||||
def callback_generate_error_del(self, func):
|
||||
self._callback_del("generate,error", func)
|
||||
|
||||
def callback_load_error_add(self, func, *args, **kwargs):
|
||||
self._callback_add("load,error", func, *args, **kwargs)
|
||||
|
||||
def callback_load_error_del(self, func):
|
||||
self._callback_del("load,error", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_thumb", Thumb)
|
|
@ -1,395 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class ToolbarItemState(object):
|
||||
|
||||
cdef Elm_Toolbar_Item_State *obj
|
||||
cdef object params
|
||||
|
||||
def __init__(self, ObjectItem it, icon = None, label = None, callback = None, *args, **kwargs):
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
|
||||
if callback:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
self.params = (callback, args, kwargs)
|
||||
|
||||
self.obj = elm_toolbar_item_state_add(it.item, _cfruni(icon), _cfruni(label), cb, <void*>self)
|
||||
if self.obj == NULL:
|
||||
Py_DECREF(self)
|
||||
|
||||
|
||||
cdef class ToolbarItem(ObjectItem):
|
||||
|
||||
def __init__(self, evasObject toolbar, icon, label,
|
||||
callback, *args, **kargs):
|
||||
cdef Evas_Object *ic = NULL
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
|
||||
if callback:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
self.params = (callback, args, kargs)
|
||||
|
||||
item = elm_toolbar_item_append(toolbar.obj, icon, _cfruni(label), cb, <void*>self)
|
||||
|
||||
if item != NULL:
|
||||
self._set_obj(item)
|
||||
else:
|
||||
Py_DECREF(self)
|
||||
|
||||
def next_get(self):
|
||||
return _object_item_to_python(elm_toolbar_item_next_get(self.item))
|
||||
|
||||
property next:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_toolbar_item_next_get(self.item))
|
||||
|
||||
def prev_get(self):
|
||||
return _object_item_to_python(elm_toolbar_item_prev_get(self.item))
|
||||
|
||||
property prev:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_toolbar_item_prev_get(self.item))
|
||||
|
||||
def priority_set(self, priority):
|
||||
elm_toolbar_item_priority_set(self.item, priority)
|
||||
|
||||
def priority_get(self):
|
||||
return elm_toolbar_item_priority_get(self.item)
|
||||
|
||||
property priority:
|
||||
def __get__(self):
|
||||
return elm_toolbar_item_priority_get(self.item)
|
||||
|
||||
def __set__(self, priority):
|
||||
elm_toolbar_item_priority_set(self.item, priority)
|
||||
|
||||
def selected_get(self):
|
||||
return elm_toolbar_item_selected_get(self.item)
|
||||
|
||||
def selected_set(self, selected):
|
||||
elm_toolbar_item_selected_set(self.item, selected)
|
||||
|
||||
property selected:
|
||||
def __set__(self, selected):
|
||||
elm_toolbar_item_selected_set(self.item, selected)
|
||||
|
||||
def __get__(self):
|
||||
return elm_toolbar_item_selected_get(self.item)
|
||||
|
||||
def icon_set(self, ic):
|
||||
elm_toolbar_item_icon_set(self.item, _cfruni(ic))
|
||||
|
||||
def icon_get(self):
|
||||
return _ctouni(elm_toolbar_item_icon_get(self.item))
|
||||
|
||||
property icon:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_toolbar_item_icon_get(self.item))
|
||||
|
||||
def __set__(self, ic):
|
||||
elm_toolbar_item_icon_set(self.item, _cfruni(ic))
|
||||
|
||||
def object_get(self):
|
||||
return object_from_instance(elm_toolbar_item_object_get(self.item))
|
||||
|
||||
property object:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_toolbar_item_object_get(self.item))
|
||||
|
||||
def icon_object_get(self):
|
||||
return object_from_instance(elm_toolbar_item_icon_object_get(self.item))
|
||||
|
||||
property icon_object:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_toolbar_item_icon_object_get(self.item))
|
||||
|
||||
def icon_memfile_set(self, img, size, format, key):
|
||||
return False
|
||||
#TODO: return bool(elm_toolbar_item_icon_memfile_set(self.item, img, size, format, key))
|
||||
|
||||
def icon_file_set(self, file, key):
|
||||
return bool(elm_toolbar_item_icon_file_set(self.item, _cfruni(file), _cfruni(key)))
|
||||
|
||||
property icon_file:
|
||||
def __set__(self, value):
|
||||
if isinstance(value, tuple):
|
||||
file, key = value
|
||||
else:
|
||||
file = value
|
||||
key = None
|
||||
# TODO: check return status
|
||||
elm_toolbar_item_icon_file_set(self.item, _cfruni(file), _cfruni(key))
|
||||
|
||||
def separator_set(self, separator):
|
||||
elm_toolbar_item_separator_set(self.item, separator)
|
||||
|
||||
def separator_get(self):
|
||||
return elm_toolbar_item_separator_get(self.item)
|
||||
|
||||
property separator:
|
||||
def __set__(self, separator):
|
||||
elm_toolbar_item_separator_set(self.item, separator)
|
||||
|
||||
def __get__(self):
|
||||
return elm_toolbar_item_separator_get(self.item)
|
||||
|
||||
def menu_set(self, menu):
|
||||
elm_toolbar_item_menu_set(self.item, menu)
|
||||
|
||||
def menu_get(self):
|
||||
cdef Evas_Object *menu
|
||||
menu = elm_toolbar_item_menu_get(self.item)
|
||||
if menu == NULL:
|
||||
return None
|
||||
else:
|
||||
return Menu(None, <object>menu)
|
||||
|
||||
property menu:
|
||||
def __get__(self):
|
||||
cdef Evas_Object *menu
|
||||
menu = elm_toolbar_item_menu_get(self.item)
|
||||
if menu == NULL:
|
||||
return None
|
||||
else:
|
||||
return Menu(None, <object>menu)
|
||||
|
||||
def __set__(self, menu):
|
||||
elm_toolbar_item_menu_set(self.item, menu)
|
||||
|
||||
def state_add(self, icon = None, label = None, func = None, *args, **kwargs):
|
||||
return ToolbarItemState(self, icon, label, func, *args, **kwargs)
|
||||
|
||||
def state_del(self, ToolbarItemState state):
|
||||
return bool(elm_toolbar_item_state_del(self.item, state.obj))
|
||||
|
||||
property state:
|
||||
def __set__(self, ToolbarItemState state):
|
||||
# TODO: check return value bool for errors
|
||||
elm_toolbar_item_state_set(self.item, state.obj)
|
||||
|
||||
def __del__(self):
|
||||
elm_toolbar_item_state_unset(self.item)
|
||||
|
||||
def __get__(self):
|
||||
return None
|
||||
# TODO: C api doesn't have data_get() for states so we can't get
|
||||
# the py object from there. Store it in the item instead?
|
||||
#elm_toolbar_item_state_get(self.item)
|
||||
|
||||
property state_next:
|
||||
def __get__(self):
|
||||
return None
|
||||
# TODO: keep a list of the states?
|
||||
#return elm_toolbar_item_state_next(self.item)
|
||||
|
||||
property state_prev:
|
||||
def __get__(self):
|
||||
return None
|
||||
# TODO: keep a list of the states?
|
||||
#return elm_toolbar_item_state_prev(self.item)
|
||||
|
||||
|
||||
cdef class Toolbar(Object):
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_toolbar_add(parent.obj))
|
||||
|
||||
def icon_size_set(self, icon_size):
|
||||
elm_toolbar_icon_size_set(self.obj, icon_size)
|
||||
|
||||
def icon_size_get(self):
|
||||
return elm_toolbar_icon_size_get(self.obj)
|
||||
|
||||
property icon_size:
|
||||
def __set__(self, icon_size):
|
||||
elm_toolbar_icon_size_set(self.obj, icon_size)
|
||||
|
||||
def __get__(self):
|
||||
return elm_toolbar_icon_size_get(self.obj)
|
||||
|
||||
def icon_order_lookup_set(self, order):
|
||||
elm_toolbar_icon_order_lookup_set(self.obj, order)
|
||||
|
||||
def icon_order_lookup_get(self):
|
||||
return elm_toolbar_icon_order_lookup_get(self.obj)
|
||||
|
||||
property icon_order_lookup:
|
||||
def __set__(self, order):
|
||||
elm_toolbar_icon_order_lookup_set(self.obj, order)
|
||||
|
||||
def __get__(self):
|
||||
return elm_toolbar_icon_order_lookup_get(self.obj)
|
||||
|
||||
def item_append(self, icon, label, callback = None, *args, **kargs):
|
||||
# Everything is done in the ToolbarItem class, because of wrapping the
|
||||
# C structures in python classes
|
||||
return ToolbarItem(self, icon, label, callback, *args, **kargs)
|
||||
|
||||
#TODO: def item_prepend(self, icon, label, callback = None, *args, **kargs):
|
||||
#return ToolbarItem(self, icon, label, callback, *args, **kargs)
|
||||
|
||||
#TODO: def item_insert_before(self, before, icon, label, callback = None, *args, **kargs):
|
||||
#return ToolbarItem(self, icon, label, callback, *args, **kargs)
|
||||
|
||||
#TODO: def item_insert_after(self, after, icon, label, callback = None, *args, **kargs):
|
||||
#return ToolbarItem(self, icon, label, callback, *args, **kargs)
|
||||
|
||||
def first_item_get(self):
|
||||
return _object_item_to_python(elm_toolbar_first_item_get(self.obj))
|
||||
|
||||
property first_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_toolbar_first_item_get(self.obj))
|
||||
|
||||
def last_item_get(self):
|
||||
return _object_item_to_python(elm_toolbar_last_item_get(self.obj))
|
||||
|
||||
property last_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_toolbar_last_item_get(self.obj))
|
||||
|
||||
def item_find_by_label(self, label):
|
||||
return _object_item_to_python(elm_toolbar_item_find_by_label(self.obj, _cfruni(label)))
|
||||
|
||||
def selected_item_get(self):
|
||||
return _object_item_to_python(elm_toolbar_selected_item_get(self.obj))
|
||||
|
||||
property selected_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_toolbar_selected_item_get(self.obj))
|
||||
|
||||
def more_item_get(self):
|
||||
return _object_item_to_python(elm_toolbar_more_item_get(self.obj))
|
||||
|
||||
property more_item:
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_toolbar_more_item_get(self.obj))
|
||||
|
||||
def shrink_mode_set(self, mode):
|
||||
elm_toolbar_shrink_mode_set(self.obj, mode)
|
||||
|
||||
def shrink_mode_get(self):
|
||||
return elm_toolbar_shrink_mode_get(self.obj)
|
||||
|
||||
property shrink_mode:
|
||||
def __get__(self):
|
||||
return elm_toolbar_shrink_mode_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_toolbar_shrink_mode_set(self.obj, mode)
|
||||
|
||||
def homogeneous_set(self, homogeneous):
|
||||
elm_toolbar_homogeneous_set(self.obj, homogeneous)
|
||||
|
||||
def homogeneous_get(self):
|
||||
return elm_toolbar_homogeneous_get(self.obj)
|
||||
|
||||
property homogeneous:
|
||||
def __set__(self, homogeneous):
|
||||
elm_toolbar_homogeneous_set(self.obj, homogeneous)
|
||||
|
||||
def __get__(self):
|
||||
return elm_toolbar_homogeneous_get(self.obj)
|
||||
|
||||
def menu_parent_set(self, evasObject parent):
|
||||
elm_toolbar_menu_parent_set(self.obj, parent.obj)
|
||||
|
||||
def menu_parent_get(self):
|
||||
return object_from_instance(elm_toolbar_menu_parent_get(self.obj))
|
||||
|
||||
property menu_parent:
|
||||
def __get__(self):
|
||||
return object_from_instance(elm_toolbar_menu_parent_get(self.obj))
|
||||
|
||||
def __set__(self, evasObject parent):
|
||||
elm_toolbar_menu_parent_set(self.obj, parent.obj)
|
||||
|
||||
def align_set(self, align):
|
||||
elm_toolbar_align_set(self.obj, align)
|
||||
|
||||
def align_get(self):
|
||||
return elm_toolbar_align_get(self.obj)
|
||||
|
||||
property align:
|
||||
def __set__(self, align):
|
||||
elm_toolbar_align_set(self.obj, align)
|
||||
|
||||
def __get__(self):
|
||||
return elm_toolbar_align_get(self.obj)
|
||||
|
||||
def horizontal_set(self, horizontal):
|
||||
elm_toolbar_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def horizontal_get(self):
|
||||
return elm_toolbar_horizontal_get(self.obj)
|
||||
|
||||
property horizontal:
|
||||
def __set__(self, horizontal):
|
||||
elm_toolbar_horizontal_set(self.obj, horizontal)
|
||||
|
||||
def __get__(self):
|
||||
return elm_toolbar_horizontal_get(self.obj)
|
||||
|
||||
def items_count(self):
|
||||
return elm_toolbar_items_count(self.obj)
|
||||
|
||||
property standard_priority:
|
||||
def __set__(self, priority):
|
||||
elm_toolbar_standard_priority_set(self.obj, priority)
|
||||
def __get__(self):
|
||||
return elm_toolbar_standard_priority_get(self.obj)
|
||||
|
||||
def select_mode_set(self, mode):
|
||||
elm_toolbar_select_mode_set(self.obj, mode)
|
||||
|
||||
def select_mode_get(self):
|
||||
return elm_toolbar_select_mode_get(self.obj)
|
||||
|
||||
property select_mode:
|
||||
def __get__(self):
|
||||
return elm_toolbar_select_mode_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_toolbar_select_mode_set(self.obj, mode)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_longpressed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("longpressed", func, *args, **kwargs)
|
||||
|
||||
def callback_longpressed_del(self, func):
|
||||
self._callback_del("longpressed", func)
|
||||
|
||||
def callback_language_changed_add(self, func, *args, **kwargs):
|
||||
self._callback_add("language,changed", func, *args, **kwargs)
|
||||
|
||||
def callback_language_changed_del(self, func):
|
||||
self._callback_del("language,changed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_toolbar", Toolbar)
|
|
@ -1,154 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Transit(object):
|
||||
|
||||
cdef Elm_Transit* obj
|
||||
|
||||
def __cinit__(self, *a, **ka):
|
||||
self.obj = NULL
|
||||
|
||||
def __init__(self):
|
||||
self.obj = elm_transit_add()
|
||||
|
||||
def delete(self):
|
||||
elm_transit_del(self.obj)
|
||||
|
||||
#def effect_add(self, Elm_Transit_Effect_Transition_Cb transition_cb, effect, Elm_Transit_Effect_End_Cb end_cb):
|
||||
#elm_transit_effect_add(self.obj, transition_cb, effect, end_cb)
|
||||
|
||||
#def effect_del(self, Elm_Transit_Effect_Transition_Cb transition_cb, effect):
|
||||
#elm_transit_effect_del(self.obj, transition_cb, effect)
|
||||
|
||||
def object_add(self, evasObject obj):
|
||||
elm_transit_object_add(self.obj, obj.obj)
|
||||
|
||||
def object_remove(self, evasObject obj):
|
||||
elm_transit_object_remove(self.obj, obj.obj)
|
||||
|
||||
property objects:
|
||||
def __get__(self):
|
||||
return _object_list_to_python(elm_transit_objects_get(self.obj))
|
||||
|
||||
property objects_final_state_keep:
|
||||
def __set__(self, state_keep):
|
||||
elm_transit_objects_final_state_keep_set(self.obj, state_keep)
|
||||
|
||||
def __get__(self):
|
||||
return bool(elm_transit_objects_final_state_keep_get(self.obj))
|
||||
|
||||
property event_enabled:
|
||||
def __set__(self, enabled):
|
||||
elm_transit_event_enabled_set(self.obj, enabled)
|
||||
def __get__(self):
|
||||
return bool(elm_transit_event_enabled_get(self.obj))
|
||||
|
||||
def del_cb_set(self, cb, *args, **kwargs):
|
||||
pass
|
||||
#elm_transit_del_cb_set(self.obj, cb, data)
|
||||
|
||||
property auto_reverse:
|
||||
def __set__(self, reverse):
|
||||
elm_transit_auto_reverse_set(self.obj, reverse)
|
||||
def __get__(self):
|
||||
return bool(elm_transit_auto_reverse_get(self.obj))
|
||||
|
||||
property repeat_times:
|
||||
def __set__(self, repeat):
|
||||
elm_transit_repeat_times_set(self.obj, repeat)
|
||||
def __get__(self):
|
||||
return elm_transit_repeat_times_get(self.obj)
|
||||
|
||||
property tween_mode:
|
||||
def __set__(self, tween_mode):
|
||||
elm_transit_tween_mode_set(self.obj, tween_mode)
|
||||
def __get__(self):
|
||||
return elm_transit_tween_mode_get(self.obj)
|
||||
|
||||
property duration:
|
||||
def __set__(self, duration):
|
||||
elm_transit_duration_set(self.obj, duration)
|
||||
def __get__(self):
|
||||
return elm_transit_duration_get(self.obj)
|
||||
|
||||
def go(self):
|
||||
elm_transit_go(self.obj)
|
||||
|
||||
property paused:
|
||||
def __set__(self, paused):
|
||||
elm_transit_paused_set(self.obj, paused)
|
||||
def __get__(self):
|
||||
return bool(elm_transit_paused_get(self.obj))
|
||||
|
||||
property progress_value:
|
||||
def __get__(self):
|
||||
return elm_transit_progress_value_get(self.obj)
|
||||
|
||||
def chain_transit_add(self, Transit chain_transit):
|
||||
elm_transit_chain_transit_add(self.obj, chain_transit.obj)
|
||||
|
||||
def chain_transit_del(self, Transit chain_transit):
|
||||
elm_transit_chain_transit_del(self.obj, chain_transit.obj)
|
||||
|
||||
property chain_transits:
|
||||
def __get__(self):
|
||||
return _object_list_to_python(elm_transit_chain_transits_get(self.obj))
|
||||
|
||||
def effect_resizing_add(self, Evas_Coord from_w, Evas_Coord from_h, Evas_Coord to_w, Evas_Coord to_h):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_resizing_add(self.obj, from_w, from_h, to_w, to_h)
|
||||
|
||||
def effect_translation_add(self, Evas_Coord from_dx, Evas_Coord from_dy, Evas_Coord to_dx, Evas_Coord to_dy):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_translation_add(self.obj, from_dx, from_dy, to_dx, to_dy)
|
||||
|
||||
def effect_zoom_add(self, float from_rate, float to_rate):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_zoom_add(self.obj, from_rate, to_rate)
|
||||
|
||||
def effect_flip_add(self, Elm_Transit_Effect_Flip_Axis axis, Eina_Bool cw):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_flip_add(self.obj, axis, cw)
|
||||
|
||||
def effect_resizable_flip_add(self, Elm_Transit_Effect_Flip_Axis axis, Eina_Bool cw):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_resizable_flip_add(self.obj, axis, cw)
|
||||
|
||||
def effect_wipe_add(self, Elm_Transit_Effect_Wipe_Type type, Elm_Transit_Effect_Wipe_Dir dir):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_wipe_add(self.obj, type, dir)
|
||||
|
||||
def effect_color_add(self, unsigned int from_r, unsigned int from_g, unsigned int from_b, unsigned int from_a, unsigned int to_r, unsigned int to_g, unsigned int to_b, unsigned int to_a):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_color_add(self.obj, from_r, from_g, from_b, from_a, to_r, to_g, to_b, to_a)
|
||||
|
||||
def effect_fade_add(self):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_fade_add(self.obj)
|
||||
|
||||
def effect_blend_add(self):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_blend_add(self.obj)
|
||||
|
||||
def effect_rotation_add(self, float from_degree, float to_degree):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_rotation_add(self.obj, from_degree, to_degree)
|
||||
|
||||
def effect_image_animation_add(self, images):
|
||||
#TODO: can the return value Elm_Transit_Effect be used somehow?
|
||||
elm_transit_effect_image_animation_add(self.obj, _strings_from_python(images))
|
|
@ -1,610 +0,0 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
|
||||
cdef class Window(Object):
|
||||
|
||||
def __init__(self, name, type):
|
||||
self._set_obj(elm_win_add(NULL, _cfruni(name), type))
|
||||
|
||||
def resize_object_add(self, evasObject subobj):
|
||||
elm_win_resize_object_add(self.obj, subobj.obj)
|
||||
|
||||
def resize_object_del(self, evasObject subobj):
|
||||
elm_win_resize_object_del(self.obj, subobj.obj)
|
||||
|
||||
def title_set(self, title):
|
||||
elm_win_title_set(self.obj, _cfruni(title))
|
||||
|
||||
def title_get(self):
|
||||
return _ctouni(elm_win_title_get(self.obj))
|
||||
|
||||
property title:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_win_title_get(self.obj))
|
||||
def __set__(self, title):
|
||||
elm_win_title_set(self.obj, _cfruni(title))
|
||||
|
||||
def icon_name_set(self, icon_name):
|
||||
elm_win_icon_name_set(self.obj, _cfruni(icon_name))
|
||||
|
||||
def icon_name_get(self):
|
||||
return _ctouni(elm_win_icon_name_get(self.obj))
|
||||
|
||||
property icon_name:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_win_icon_name_get(self.obj))
|
||||
def __set__(self, icon_name):
|
||||
elm_win_icon_name_set(self.obj, _cfruni(icon_name))
|
||||
|
||||
def role_set(self, role):
|
||||
elm_win_role_set(self.obj, _cfruni(role))
|
||||
|
||||
def role_get(self):
|
||||
return _ctouni(elm_win_role_get(self.obj))
|
||||
|
||||
property role:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_win_role_get(self.obj))
|
||||
def __set__(self, role):
|
||||
elm_win_role_set(self.obj, _cfruni(role))
|
||||
|
||||
def icon_object_set(self, evasObject icon):
|
||||
elm_win_icon_object_set(self.obj, icon.obj)
|
||||
|
||||
def icon_object_get(self):
|
||||
cdef Evas_Object *obj
|
||||
|
||||
obj = <Evas_Object *>elm_win_icon_object_get(self.obj)
|
||||
return object_from_instance(obj)
|
||||
|
||||
property icon_object:
|
||||
def __get__(self):
|
||||
return self.icon_object_get()
|
||||
def __set__(self, evasObject icon):
|
||||
self.icon_object_set(icon)
|
||||
|
||||
def autodel_set(self, autodel):
|
||||
elm_win_autodel_set(self.obj, autodel)
|
||||
|
||||
def autodel_get(self):
|
||||
return elm_win_autodel_get(self.obj)
|
||||
|
||||
property autodel:
|
||||
def __get__(self):
|
||||
return elm_win_autodel_get(self.obj)
|
||||
def __set__(self, autodel):
|
||||
elm_win_autodel_set(self.obj, autodel)
|
||||
|
||||
def activate(self):
|
||||
elm_win_activate(self.obj)
|
||||
|
||||
def lower(self):
|
||||
elm_win_lower(self.obj)
|
||||
|
||||
def _raise(self):
|
||||
elm_win_raise(self.obj)
|
||||
|
||||
def center(self, h, v):
|
||||
elm_win_center(self.obj, h, v)
|
||||
|
||||
def borderless_set(self, borderless):
|
||||
elm_win_borderless_set(self.obj, borderless)
|
||||
|
||||
def borderless_get(self):
|
||||
return bool(elm_win_borderless_get(self.obj))
|
||||
|
||||
property borderless:
|
||||
def __get__(self):
|
||||
return self.borderless_get()
|
||||
def __set__(self, borderless):
|
||||
self.borderless_set(borderless)
|
||||
|
||||
def shaped_set(self,shaped):
|
||||
elm_win_shaped_set(self.obj, shaped)
|
||||
|
||||
def shaped_get(self):
|
||||
return bool(elm_win_shaped_get(self.obj))
|
||||
|
||||
property shaped:
|
||||
def __get__(self):
|
||||
return bool(elm_win_shaped_get(self.obj))
|
||||
def __set__(self, shaped):
|
||||
elm_win_shaped_set(self.obj, shaped)
|
||||
|
||||
def alpha_set(self,alpha):
|
||||
elm_win_alpha_set(self.obj, alpha)
|
||||
|
||||
def alpha_get(self):
|
||||
return bool(elm_win_alpha_get(self.obj))
|
||||
|
||||
property alpha:
|
||||
def __get__(self):
|
||||
return bool(elm_win_alpha_get(self.obj))
|
||||
def __set__(self, alpha):
|
||||
elm_win_alpha_set(self.obj, alpha)
|
||||
|
||||
def override_set(self, override):
|
||||
elm_win_override_set(self.obj, override)
|
||||
|
||||
def override_get(self):
|
||||
return bool(elm_win_override_get(self.obj))
|
||||
|
||||
property override:
|
||||
def __get__(self):
|
||||
return bool(elm_win_override_get(self.obj))
|
||||
def __set__(self, override):
|
||||
elm_win_override_set(self.obj, override)
|
||||
|
||||
def fullscreen_set(self, fullscreen):
|
||||
elm_win_fullscreen_set(self.obj, fullscreen)
|
||||
|
||||
def fullscreen_get(self):
|
||||
return bool(elm_win_fullscreen_get(self.obj))
|
||||
|
||||
property fullscreen:
|
||||
def __get__(self):
|
||||
return bool(elm_win_fullscreen_get(self.obj))
|
||||
def __set__(self, fullscreen):
|
||||
elm_win_fullscreen_set(self.obj, fullscreen)
|
||||
|
||||
def maximized_set(self, maximized):
|
||||
elm_win_maximized_set(self.obj, maximized)
|
||||
|
||||
def maximized_get(self):
|
||||
return bool(elm_win_maximized_get(self.obj))
|
||||
|
||||
property maximized:
|
||||
def __get__(self):
|
||||
return bool(elm_win_maximized_get(self.obj))
|
||||
def __set__(self, maximized):
|
||||
elm_win_maximized_set(self.obj, maximized)
|
||||
|
||||
def iconified_set(self, iconified):
|
||||
elm_win_iconified_set(self.obj, iconified)
|
||||
|
||||
def iconified_get(self):
|
||||
return bool(elm_win_iconified_get(self.obj))
|
||||
|
||||
property iconified:
|
||||
def __get__(self):
|
||||
return bool(elm_win_iconified_get(self.obj))
|
||||
def __set__(self, iconified):
|
||||
elm_win_iconified_set(self.obj, iconified)
|
||||
|
||||
def withdrawn_set(self, withdrawn):
|
||||
elm_win_withdrawn_set(self.obj, withdrawn)
|
||||
|
||||
def withdrawn_get(self):
|
||||
return bool(elm_win_withdrawn_get(self.obj))
|
||||
|
||||
property withdrawn:
|
||||
def __get__(self):
|
||||
return bool(elm_win_withdrawn_get(self.obj))
|
||||
def __set__(self, withdrawn):
|
||||
elm_win_withdrawn_set(self.obj, withdrawn)
|
||||
|
||||
def urgent_set(self, urgent):
|
||||
elm_win_urgent_set(self.obj, urgent)
|
||||
|
||||
def urgent_get(self):
|
||||
return bool(elm_win_urgent_get(self.obj))
|
||||
|
||||
property urgent:
|
||||
def __get__(self):
|
||||
return bool(elm_win_urgent_get(self.obj))
|
||||
def __set__(self, urgent):
|
||||
elm_win_urgent_set(self.obj, urgent)
|
||||
|
||||
def demand_attention_set(self, demand_attention):
|
||||
elm_win_demand_attention_set(self.obj, demand_attention)
|
||||
|
||||
def demand_attention_get(self):
|
||||
return bool(elm_win_demand_attention_get(self.obj))
|
||||
|
||||
property demand_attention:
|
||||
def __get__(self):
|
||||
return bool(elm_win_demand_attention_get(self.obj))
|
||||
def __set__(self, demand_attention):
|
||||
elm_win_demand_attention_set(self.obj, demand_attention)
|
||||
|
||||
def modal_set(self, modal):
|
||||
elm_win_modal_set(self.obj, modal)
|
||||
|
||||
def modal_get(self):
|
||||
return bool(elm_win_modal_get(self.obj))
|
||||
|
||||
property modal:
|
||||
def __get__(self):
|
||||
return bool(elm_win_modal_get(self.obj))
|
||||
def __set__(self, modal):
|
||||
elm_win_modal_set(self.obj, modal)
|
||||
|
||||
def aspect_set(self, aspect):
|
||||
elm_win_aspect_set(self.obj, aspect)
|
||||
|
||||
def aspect_get(self):
|
||||
return elm_win_aspect_get(self.obj)
|
||||
|
||||
property aspect:
|
||||
def __get__(self):
|
||||
return elm_win_aspect_get(self.obj)
|
||||
def __set__(self, aspect):
|
||||
elm_win_aspect_set(self.obj, aspect)
|
||||
|
||||
property size_base:
|
||||
def __set__(self, value):
|
||||
w, h = value
|
||||
elm_win_size_base_set(self.obj, w, h)
|
||||
|
||||
def __get__(self):
|
||||
cdef int w, h
|
||||
elm_win_size_base_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
property size_step:
|
||||
def __set__(self, value):
|
||||
w, h = value
|
||||
elm_win_size_step_set(self.obj, w, h)
|
||||
|
||||
def __get__(self):
|
||||
cdef int w, h
|
||||
elm_win_size_step_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
def layer_set(self, layer):
|
||||
elm_win_layer_set(self.obj, layer)
|
||||
|
||||
def layer_get(self):
|
||||
return elm_win_layer_get(self.obj)
|
||||
|
||||
property layer:
|
||||
def __get__(self):
|
||||
return elm_win_layer_get(self.obj)
|
||||
def __set__(self, layer):
|
||||
elm_win_layer_set(self.obj, layer)
|
||||
|
||||
def rotation_set(self, rotation):
|
||||
elm_win_rotation_set(self.obj, rotation)
|
||||
|
||||
def rotation_get(self):
|
||||
return elm_win_rotation_get(self.obj)
|
||||
|
||||
property rotation:
|
||||
def __get__(self):
|
||||
return elm_win_rotation_get(self.obj)
|
||||
def __set__(self, rotation):
|
||||
elm_win_rotation_set(self.obj, rotation)
|
||||
|
||||
def rotation_with_resize_set(self, rotation):
|
||||
elm_win_rotation_set(self.obj, rotation)
|
||||
|
||||
property rotation_with_resize:
|
||||
def __set__(self, rotation):
|
||||
elm_win_rotation_set(self.obj, rotation)
|
||||
|
||||
def sticky_set(self, sticky):
|
||||
elm_win_sticky_set(self.obj, sticky)
|
||||
|
||||
def sticky_get(self):
|
||||
return bool(elm_win_sticky_get(self.obj))
|
||||
|
||||
property sticky:
|
||||
def __get__(self):
|
||||
return bool(elm_win_sticky_get(self.obj))
|
||||
def __set__(self, sticky):
|
||||
elm_win_sticky_set(self.obj, sticky)
|
||||
|
||||
def conformant_set(self, conformant):
|
||||
elm_win_conformant_set(self.obj, conformant)
|
||||
|
||||
def conformant_get(self):
|
||||
return bool(elm_win_conformant_get(self.obj))
|
||||
|
||||
property conformant:
|
||||
def __get__(self):
|
||||
return bool(elm_win_conformant_get(self.obj))
|
||||
def __set__(self, conformant):
|
||||
elm_win_conformant_set(self.obj, conformant)
|
||||
|
||||
def quickpanel_set(self, quickpanel):
|
||||
elm_win_quickpanel_set(self.obj, quickpanel)
|
||||
|
||||
def quickpanel_get(self):
|
||||
return bool(elm_win_quickpanel_get(self.obj))
|
||||
|
||||
property quickpanel:
|
||||
def __get__(self):
|
||||
return bool(elm_win_quickpanel_get(self.obj))
|
||||
def __set__(self, quickpanel):
|
||||
elm_win_quickpanel_set(self.obj, quickpanel)
|
||||
|
||||
def quickpanel_priority_major_set(self, priority):
|
||||
elm_win_quickpanel_priority_major_set(self.obj, priority)
|
||||
|
||||
def quickpanel_priority_major_get(self):
|
||||
return elm_win_quickpanel_priority_major_get(self.obj)
|
||||
|
||||
property quickpanel_priority_major:
|
||||
def __get__(self):
|
||||
return elm_win_quickpanel_priority_major_get(self.obj)
|
||||
def __set__(self, priority):
|
||||
elm_win_quickpanel_priority_major_set(self.obj, priority)
|
||||
|
||||
def quickpanel_priority_minor_set(self, priority):
|
||||
elm_win_quickpanel_priority_minor_set(self.obj, priority)
|
||||
|
||||
def quickpanel_priority_minor_get(self):
|
||||
return elm_win_quickpanel_priority_minor_get(self.obj)
|
||||
|
||||
property quickpanel_priority_minor:
|
||||
def __get__(self):
|
||||
return elm_win_quickpanel_priority_minor_get(self.obj)
|
||||
def __set__(self, priority):
|
||||
elm_win_quickpanel_priority_minor_set(self.obj, priority)
|
||||
|
||||
def quickpanel_zone_set(self, zone):
|
||||
elm_win_quickpanel_zone_set(self.obj, zone)
|
||||
|
||||
def quickpanel_zone_get(self):
|
||||
return elm_win_quickpanel_zone_get(self.obj)
|
||||
|
||||
property quickpanel_zone:
|
||||
def __get__(self):
|
||||
return elm_win_quickpanel_zone_get(self.obj)
|
||||
def __set__(self, zone):
|
||||
elm_win_quickpanel_zone_set(self.obj, zone)
|
||||
|
||||
def prop_focus_skip_set(self, skip):
|
||||
elm_win_prop_focus_skip_set(self.obj, skip)
|
||||
|
||||
property focus_skip_set:
|
||||
def __set__(self, skip):
|
||||
elm_win_prop_focus_skip_set(self.obj, skip)
|
||||
|
||||
def illume_command_send(self, command, *args, **kwargs):
|
||||
params = (args, kwargs)
|
||||
elm_win_illume_command_send(self.obj, command, params)
|
||||
|
||||
# def inlined_image_object_get(self):
|
||||
# cdef evasImage img = evasImage()
|
||||
# cdef Evas_Object *obj = elm_win_inlined_image_object_get(self.obj)
|
||||
# img.obj = obj
|
||||
# return img
|
||||
|
||||
# property inlined_image_object:
|
||||
# def __get__(self):
|
||||
# cdef evasImage img = evasImage()
|
||||
# cdef Evas_Object *obj = elm_win_inlined_image_object_get(self.obj)
|
||||
# img.obj = obj
|
||||
# return img
|
||||
|
||||
def focus_get(self):
|
||||
return bool(elm_win_focus_get(self.obj))
|
||||
|
||||
property focus:
|
||||
def __get__(self):
|
||||
return bool(elm_win_focus_get(self.obj))
|
||||
|
||||
def screen_constrain_set(self, constrain):
|
||||
elm_win_screen_constrain_set(self.obj, constrain)
|
||||
|
||||
def screen_constrain_get(self):
|
||||
return bool(elm_win_screen_constrain_get(self.obj))
|
||||
|
||||
property screen_constrain:
|
||||
def __get__(self):
|
||||
return bool(elm_win_screen_constrain_get(self.obj))
|
||||
def __set__(self, constrain):
|
||||
elm_win_screen_constrain_set(self.obj, constrain)
|
||||
|
||||
def screen_size_get(self):
|
||||
cdef int x, y, w, h
|
||||
elm_win_screen_size_get(self.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
property screen_size:
|
||||
def __get__(self):
|
||||
cdef int x, y, w, h
|
||||
elm_win_screen_size_get(self.obj, &x, &y, &w, &h)
|
||||
return (x, y, w, h)
|
||||
|
||||
def focus_highlight_enabled_set(self, enabled):
|
||||
elm_win_focus_highlight_enabled_set(self.obj, enabled)
|
||||
|
||||
def focus_highlight_enabled_get(self):
|
||||
return bool(elm_win_focus_highlight_enabled_get(self.obj))
|
||||
|
||||
property focus_highlight_enabled:
|
||||
def __get__(self):
|
||||
return bool(elm_win_focus_highlight_enabled_get(self.obj))
|
||||
def __set__(self, enabled):
|
||||
elm_win_focus_highlight_enabled_set(self.obj, enabled)
|
||||
|
||||
def focus_highlight_style_set(self, style):
|
||||
elm_win_focus_highlight_style_set(self.obj, _cfruni(style))
|
||||
|
||||
def focus_highlight_style_get(self):
|
||||
return _ctouni(elm_win_focus_highlight_style_get(self.obj))
|
||||
|
||||
property focus_highlight_style:
|
||||
def __get__(self):
|
||||
return _ctouni(elm_win_focus_highlight_style_get(self.obj))
|
||||
def __set__(self, style):
|
||||
elm_win_focus_highlight_style_set(self.obj, _cfruni(style))
|
||||
|
||||
def keyboard_mode_set(self, mode):
|
||||
elm_win_keyboard_mode_set(self.obj, mode)
|
||||
|
||||
def keyboard_mode_get(self):
|
||||
return elm_win_keyboard_mode_get(self.obj)
|
||||
|
||||
property keyboard_mode:
|
||||
def __get__(self):
|
||||
return elm_win_keyboard_mode_get(self.obj)
|
||||
def __set__(self, mode):
|
||||
elm_win_keyboard_mode_set(self.obj, mode)
|
||||
|
||||
def keyboard_win_set(self, is_keyboard):
|
||||
elm_win_keyboard_win_set(self.obj, is_keyboard)
|
||||
|
||||
def keyboard_win_get(self):
|
||||
return bool(elm_win_keyboard_win_get(self.obj))
|
||||
|
||||
property keyboard_win:
|
||||
def __get__(self):
|
||||
return bool(elm_win_keyboard_win_get(self.obj))
|
||||
def __set__(self, is_keyboard):
|
||||
elm_win_keyboard_win_set(self.obj, is_keyboard)
|
||||
|
||||
def indicator_mode_set(self, mode):
|
||||
elm_win_indicator_mode_set(self.obj, mode)
|
||||
|
||||
def indicator_mode_get(self):
|
||||
return elm_win_indicator_mode_get(self.obj)
|
||||
|
||||
property indicator_mode:
|
||||
def __get__(self):
|
||||
return elm_win_indicator_mode_get(self.obj)
|
||||
def __set__(self, mode):
|
||||
elm_win_indicator_mode_set(self.obj, mode)
|
||||
|
||||
def indicator_opacity_set(self, mode):
|
||||
elm_win_indicator_opacity_set(self.obj, mode)
|
||||
|
||||
def indicator_opacity_get(self):
|
||||
return elm_win_indicator_opacity_get(self.obj)
|
||||
|
||||
property indicator_opacity:
|
||||
def __get__(self):
|
||||
return elm_win_indicator_opacity_get(self.obj)
|
||||
def __set__(self, mode):
|
||||
elm_win_indicator_opacity_set(self.obj, mode)
|
||||
|
||||
def screen_position_get(self):
|
||||
cdef int x, y
|
||||
elm_win_screen_position_get(self.obj, &x, &y)
|
||||
return (x, y)
|
||||
|
||||
property screen_position:
|
||||
def __get__(self):
|
||||
cdef int x, y
|
||||
elm_win_screen_position_get(self.obj, &x, &y)
|
||||
return (x, y)
|
||||
|
||||
def socket_listen(self, svcname, svcnum, svcsys):
|
||||
return bool(elm_win_socket_listen(self.obj, _cfruni(svcname), svcnum, svcsys))
|
||||
|
||||
def xwindow_xid_get(self):
|
||||
cdef Ecore_X_Window xwin
|
||||
xwin = elm_win_xwindow_get(self.obj)
|
||||
return xwin
|
||||
|
||||
property xwindow_xid:
|
||||
def __get__(self):
|
||||
cdef Ecore_X_Window xwin
|
||||
xwin = elm_win_xwindow_get(self.obj)
|
||||
return xwin
|
||||
|
||||
def callback_delete_request_add(self, func, *args, **kwargs):
|
||||
self._callback_add("delete,request", func, *args, **kwargs)
|
||||
|
||||
def callback_delete_request_del(self, func):
|
||||
self._callback_del("delete,request", func)
|
||||
|
||||
def callback_focus_in_add(self, func, *args, **kwargs):
|
||||
self._callback_add("focus,in", func, *args, **kwargs)
|
||||
|
||||
def callback_focus_in_del(self, func):
|
||||
self._callback_del("focus,in", func)
|
||||
|
||||
def callback_focus_out_add(self, func, *args, **kwargs):
|
||||
self._callback_add("focus,out", func, *args, **kwargs)
|
||||
|
||||
def callback_focus_out_del(self, func):
|
||||
self._callback_del("focus,out")
|
||||
|
||||
def callback_moved_add(self, func, *args, **kwargs):
|
||||
self._callback_add("moved", func, *args, **kwargs)
|
||||
|
||||
def callback_moved_del(self, func):
|
||||
self._callback_del("moved")
|
||||
|
||||
def callback_withdrawn_add(self, func, *args, **kwargs):
|
||||
self._callback_add("withdrawn", func, *args, **kwargs)
|
||||
|
||||
def callback_withdrawn_del(self, func):
|
||||
self._callback_del("withdrawn")
|
||||
|
||||
def callback_iconified_add(self, func, *args, **kwargs):
|
||||
self._callback_add("iconified", func, *args, **kwargs)
|
||||
|
||||
def callback_iconified_del(self, func):
|
||||
self._callback_del("iconified")
|
||||
|
||||
def callback_normal_add(self, func, *args, **kwargs):
|
||||
self._callback_add("normal", func, *args, **kwargs)
|
||||
|
||||
def callback_normal_del(self, func):
|
||||
self._callback_del("normal")
|
||||
|
||||
def callback_stick_add(self, func, *args, **kwargs):
|
||||
self._callback_add("stick", func, *args, **kwargs)
|
||||
|
||||
def callback_stick_del(self, func):
|
||||
self._callback_del("stick")
|
||||
|
||||
def callback_unstick_add(self, func, *args, **kwargs):
|
||||
self._callback_add("unstick", func, *args, **kwargs)
|
||||
|
||||
def callback_unstick_del(self, func):
|
||||
self._callback_del("unstick")
|
||||
|
||||
def callback_fullscreen_add(self, func, *args, **kwargs):
|
||||
self._callback_add("fullscreen", func, *args, **kwargs)
|
||||
|
||||
def callback_fullscreen_del(self, func):
|
||||
self._callback_del("fullscreen")
|
||||
|
||||
def callback_unfullscreen_add(self, func, *args, **kwargs):
|
||||
self._callback_add("unfullscreen", func, *args, **kwargs)
|
||||
|
||||
def callback_unfullscreen_del(self, func):
|
||||
self._callback_del("unfullscreen")
|
||||
|
||||
def callback_maximized_add(self, func, *args, **kwargs):
|
||||
self._callback_add("maximized", func, *args, **kwargs)
|
||||
|
||||
def callback_maximized_del(self, func):
|
||||
self._callback_del("maximized")
|
||||
|
||||
def callback_unmaximized_add(self, func, *args, **kwargs):
|
||||
self._callback_add("unmaximized", func, *args, **kwargs)
|
||||
|
||||
def callback_unmaximized_del(self, func):
|
||||
self._callback_del("unmaximized")
|
||||
|
||||
_object_mapping_register("elm_win", Window)
|
||||
|
||||
|
||||
cdef class StandardWindow(Window):
|
||||
|
||||
def __init__(self, name, title):
|
||||
self._set_obj(elm_win_util_standard_add(_cfruni(name), _cfruni(title)))
|
||||
|
||||
|
||||
_object_mapping_register("elm_standardwin", StandardWindow)
|
|
@ -0,0 +1,101 @@
|
|||
from efl.evas cimport Eina_Bool, Eina_Rectangle, Evas_Object, Evas_Coord
|
||||
from enums cimport Elm_Wrap_Type, Elm_Text_Format, Elm_Cnp_Mode, \
|
||||
Elm_Scroller_Policy, Elm_Input_Panel_Layout, Elm_Input_Panel_Lang, \
|
||||
Elm_Input_Panel_Lang, Elm_Input_Panel_Return_Key_Type
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
#entry
|
||||
ctypedef struct Elm_Entry_Anchor_Info:
|
||||
char *name
|
||||
int button
|
||||
Evas_Coord x
|
||||
Evas_Coord y
|
||||
Evas_Coord w
|
||||
Evas_Coord h
|
||||
|
||||
ctypedef struct Elm_Entry_Anchor_Hover_Info:
|
||||
Elm_Entry_Anchor_Info *anchor_info
|
||||
Evas_Object *hover
|
||||
Eina_Rectangle hover_parent
|
||||
Eina_Bool hover_left
|
||||
Eina_Bool hover_right
|
||||
Eina_Bool hover_top
|
||||
Eina_Bool hover_bottom
|
||||
|
||||
# Entry (api:TODO cb:DONE test:TODO doc:TODO py3:DONE)
|
||||
Evas_Object * elm_entry_add(Evas_Object *parent)
|
||||
void elm_entry_single_line_set(Evas_Object *obj, Eina_Bool single_line)
|
||||
Eina_Bool elm_entry_single_line_get(Evas_Object *obj)
|
||||
void elm_entry_password_set(Evas_Object *obj, Eina_Bool password)
|
||||
Eina_Bool elm_entry_password_get(Evas_Object *obj)
|
||||
void elm_entry_entry_set(Evas_Object *obj, const_char *entry)
|
||||
const_char * elm_entry_entry_get(Evas_Object *obj)
|
||||
void elm_entry_entry_append(Evas_Object *obj, const_char *text)
|
||||
Eina_Bool elm_entry_is_empty(Evas_Object *obj)
|
||||
const_char * elm_entry_selection_get(Evas_Object *obj)
|
||||
Evas_Object * elm_entry_textblock_get(Evas_Object *obj)
|
||||
void elm_entry_calc_force(Evas_Object *obj)
|
||||
void elm_entry_entry_insert(Evas_Object *obj, const_char *entry)
|
||||
void elm_entry_line_wrap_set(Evas_Object *obj, Elm_Wrap_Type wrap)
|
||||
Elm_Wrap_Type elm_entry_line_wrap_get(Evas_Object *obj)
|
||||
void elm_entry_editable_set(Evas_Object *obj, Eina_Bool editable)
|
||||
Eina_Bool elm_entry_editable_get(Evas_Object *obj)
|
||||
void elm_entry_select_none(Evas_Object *obj)
|
||||
void elm_entry_select_all(Evas_Object *obj)
|
||||
Eina_Bool elm_entry_cursor_next(Evas_Object *obj)
|
||||
Eina_Bool elm_entry_cursor_prev(Evas_Object *obj)
|
||||
Eina_Bool elm_entry_cursor_up(Evas_Object *obj)
|
||||
Eina_Bool elm_entry_cursor_down(Evas_Object *obj)
|
||||
void elm_entry_cursor_begin_set(Evas_Object *obj)
|
||||
void elm_entry_cursor_end_set(Evas_Object *obj)
|
||||
void elm_entry_cursor_line_begin_set(Evas_Object *obj)
|
||||
void elm_entry_cursor_line_end_set(Evas_Object *obj)
|
||||
void elm_entry_cursor_selection_begin(Evas_Object *obj)
|
||||
void elm_entry_cursor_selection_end(Evas_Object *obj)
|
||||
Eina_Bool elm_entry_cursor_is_format_get(Evas_Object *obj)
|
||||
Eina_Bool elm_entry_cursor_is_visible_format_get(Evas_Object *obj)
|
||||
const_char * elm_entry_cursor_content_get(Evas_Object *obj)
|
||||
Eina_Bool elm_entry_cursor_geometry_get(Evas_Object *obj, Evas_Coord *x, Evas_Coord *y, Evas_Coord *w, Evas_Coord *h)
|
||||
void elm_entry_cursor_pos_set(Evas_Object *obj, int pos)
|
||||
int elm_entry_cursor_pos_get(Evas_Object *obj)
|
||||
void elm_entry_selection_cut(Evas_Object *obj)
|
||||
void elm_entry_selection_copy(Evas_Object *obj)
|
||||
void elm_entry_selection_paste(Evas_Object *obj)
|
||||
const_char * elm_entry_markup_to_utf8(const_char *s)
|
||||
const_char * elm_entry_utf8_to_markup(const_char *s)
|
||||
Eina_Bool elm_entry_file_set(Evas_Object *obj, const_char *file, Elm_Text_Format format)
|
||||
void elm_entry_file_get(Evas_Object *obj, const_char **file, Elm_Text_Format *format)
|
||||
void elm_entry_file_save(Evas_Object *obj)
|
||||
void elm_entry_autosave_set(Evas_Object *obj, Eina_Bool autosave)
|
||||
Eina_Bool elm_entry_autosave_get(Evas_Object *obj)
|
||||
void elm_entry_scrollable_set(Evas_Object *obj, Eina_Bool scrollable)
|
||||
Eina_Bool elm_entry_scrollable_get(Evas_Object *obj)
|
||||
void elm_entry_icon_visible_set(Evas_Object *obj, Eina_Bool setting)
|
||||
void elm_entry_context_menu_clear(Evas_Object *obj)
|
||||
void elm_entry_context_menu_disabled_set(Evas_Object *obj, Eina_Bool disabled)
|
||||
Eina_Bool elm_entry_context_menu_disabled_get(Evas_Object *obj)
|
||||
void elm_entry_input_panel_enabled_set(Evas_Object *obj, Eina_Bool enabled)
|
||||
Eina_Bool elm_entry_input_panel_enabled_get(Evas_Object *obj)
|
||||
void elm_entry_input_panel_layout_set(Evas_Object *obj, Elm_Input_Panel_Layout layout)
|
||||
Elm_Input_Panel_Layout elm_entry_input_panel_layout_get(Evas_Object *obj)
|
||||
void elm_entry_input_panel_show(Evas_Object *obj)
|
||||
void elm_entry_input_panel_hide(Evas_Object *obj)
|
||||
void elm_entry_input_panel_language_set(Evas_Object *obj, Elm_Input_Panel_Lang lang)
|
||||
Elm_Input_Panel_Lang elm_entry_input_panel_language_get(Evas_Object *obj)
|
||||
void elm_entry_input_panel_return_key_type_set(Evas_Object *obj, Elm_Input_Panel_Return_Key_Type return_key_type)
|
||||
Elm_Input_Panel_Return_Key_Type elm_entry_input_panel_return_key_type_get(Evas_Object *obj)
|
||||
void elm_entry_input_panel_return_key_disabled_set(Evas_Object *obj, Eina_Bool disabled)
|
||||
Eina_Bool elm_entry_input_panel_return_key_disabled_get(Evas_Object *obj)
|
||||
void elm_entry_input_panel_return_key_autoenabled_set(Evas_Object *obj, Eina_Bool disabled)
|
||||
void elm_entry_imf_context_reset(Evas_Object *obj)
|
||||
void elm_entry_prediction_allow_set(Evas_Object *obj, Eina_Bool allow)
|
||||
Eina_Bool elm_entry_prediction_allow_get(Evas_Object *obj)
|
||||
void elm_entry_cnp_mode_set(Evas_Object *obj, Elm_Cnp_Mode cnp_mode)
|
||||
Elm_Cnp_Mode elm_entry_cnp_mode_get(Evas_Object *obj)
|
||||
void elm_entry_anchor_hover_parent_set(Evas_Object *obj, Evas_Object *anchor_hover_parent)
|
||||
Evas_Object * elm_entry_anchor_hover_parent_get(Evas_Object *obj)
|
||||
void elm_entry_anchor_hover_style_set(Evas_Object *obj, const_char *anchor_hover_style)
|
||||
const_char * elm_entry_anchor_hover_style_get(Evas_Object *obj)
|
||||
void elm_entry_anchor_hover_end(Evas_Object *obj)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,437 @@
|
|||
ctypedef enum Elm_Box_CLayout:
|
||||
ELM_BOX_LAYOUT_HORIZONTAL
|
||||
ELM_BOX_LAYOUT_VERTICAL
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_VERTICAL
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_HORIZONTAL
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_HORIZONTAL
|
||||
ELM_BOX_LAYOUT_HOMOGENEOUS_MAX_SIZE_VERTICAL
|
||||
ELM_BOX_LAYOUT_FLOW_HORIZONTAL
|
||||
ELM_BOX_LAYOUT_FLOW_VERTICAL
|
||||
ELM_BOX_LAYOUT_STACK
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
ctypedef enum Elm_Actionslider_Pos:
|
||||
ELM_ACTIONSLIDER_NONE
|
||||
ELM_ACTIONSLIDER_LEFT
|
||||
ELM_ACTIONSLIDER_CENTER
|
||||
ELM_ACTIONSLIDER_RIGHT
|
||||
ELM_ACTIONSLIDER_ALL
|
||||
|
||||
ctypedef enum Elm_Bg_Option:
|
||||
ELM_BG_OPTION_CENTER
|
||||
ELM_BG_OPTION_SCALE
|
||||
ELM_BG_OPTION_STRETCH
|
||||
ELM_BG_OPTION_TILE
|
||||
ELM_BG_OPTION_LAST
|
||||
|
||||
ctypedef enum Elm_Bubble_Pos:
|
||||
ELM_BUBBLE_POS_TOP_LEFT
|
||||
ELM_BUBBLE_POS_TOP_RIGHT
|
||||
ELM_BUBBLE_POS_BOTTOM_LEFT
|
||||
ELM_BUBBLE_POS_BOTTOM_RIGHT
|
||||
|
||||
ctypedef enum Elm_Calendar_Mark_Repeat_Type:
|
||||
ELM_CALENDAR_UNIQUE
|
||||
ELM_CALENDAR_DAILY
|
||||
ELM_CALENDAR_WEEKLY
|
||||
ELM_CALENDAR_MONTHLY
|
||||
ELM_CALENDAR_ANNUALLY
|
||||
ELM_CALENDAR_LAST_DAY_OF_MONTH
|
||||
|
||||
ctypedef enum Elm_Calendar_Select_Mode:
|
||||
ELM_CALENDAR_SELECT_MODE_DEFAULT
|
||||
ELM_CALENDAR_SELECT_MODE_ALWAYS
|
||||
ELM_CALENDAR_SELECT_MODE_NONE
|
||||
ELM_CALENDAR_SELECT_MODE_ONDEMAND
|
||||
|
||||
ctypedef enum Elm_Calendar_Weekday:
|
||||
ELM_DAY_SUNDAY
|
||||
ELM_DAY_MONDAY
|
||||
ELM_DAY_TUESDAY
|
||||
ELM_DAY_WEDNESDAY
|
||||
ELM_DAY_THURSDAY
|
||||
ELM_DAY_FRIDAY
|
||||
ELM_DAY_SATURDAY
|
||||
ELM_DAY_LAST
|
||||
|
||||
ctypedef enum Elm_Clock_Edit_Mode:
|
||||
ELM_CLOCK_EDIT_DEFAULT
|
||||
ELM_CLOCK_EDIT_HOUR_DECIMAL
|
||||
ELM_CLOCK_EDIT_HOUR_UNIT
|
||||
ELM_CLOCK_EDIT_MIN_DECIMAL
|
||||
ELM_CLOCK_EDIT_MIN_UNIT
|
||||
ELM_CLOCK_EDIT_SEC_DECIMAL
|
||||
ELM_CLOCK_EDIT_SEC_UNIT
|
||||
ELM_CLOCK_EDIT_ALL
|
||||
|
||||
ctypedef enum Elm_Cnp_Mode:
|
||||
ELM_CNP_MODE_MARKUP
|
||||
ELM_CNP_MODE_NO_IMAGE
|
||||
ELM_CNP_MODE_PLAINTEXT
|
||||
|
||||
ctypedef enum Elm_Colorselector_Mode:
|
||||
ELM_COLORSELECTOR_PALETTE
|
||||
ELM_COLORSELECTOR_COMPONENTS
|
||||
ELM_COLORSELECTOR_BOTH
|
||||
|
||||
ctypedef enum Elm_Ctxpopup_Direction:
|
||||
ELM_CTXPOPUP_DIRECTION_DOWN
|
||||
ELM_CTXPOPUP_DIRECTION_RIGHT
|
||||
ELM_CTXPOPUP_DIRECTION_LEFT
|
||||
ELM_CTXPOPUP_DIRECTION_UP
|
||||
ELM_CTXPOPUP_DIRECTION_UNKNOWN
|
||||
|
||||
ctypedef enum Elm_Datetime_Field_Type:
|
||||
ELM_DATETIME_YEAR = 0
|
||||
ELM_DATETIME_MONTH = 1
|
||||
ELM_DATETIME_DATE = 2
|
||||
ELM_DATETIME_HOUR = 3
|
||||
ELM_DATETIME_MINUTE = 4
|
||||
ELM_DATETIME_AMPM = 5
|
||||
|
||||
ctypedef enum Elm_Dayselector_Day:
|
||||
ELM_DAYSELECTOR_SUN = 0
|
||||
ELM_DAYSELECTOR_MON
|
||||
ELM_DAYSELECTOR_TUE
|
||||
ELM_DAYSELECTOR_WED
|
||||
ELM_DAYSELECTOR_THU
|
||||
ELM_DAYSELECTOR_FRI
|
||||
ELM_DAYSELECTOR_SAT
|
||||
ELM_DAYSELECTOR_MAX
|
||||
|
||||
ctypedef enum Elm_Fileselector_Mode:
|
||||
ELM_FILESELECTOR_LIST
|
||||
ELM_FILESELECTOR_GRID
|
||||
|
||||
ctypedef enum Elm_Flip_Direction:
|
||||
ELM_FLIP_DIRECTION_UP
|
||||
ELM_FLIP_DIRECTION_DOWN
|
||||
ELM_FLIP_DIRECTION_LEFT
|
||||
ELM_FLIP_DIRECTION_RIGHT
|
||||
|
||||
ctypedef enum Elm_Flip_Interaction:
|
||||
ELM_FLIP_INTERACTION_NONE
|
||||
ELM_FLIP_INTERACTION_ROTATE
|
||||
ELM_FLIP_INTERACTION_CUBE
|
||||
ELM_FLIP_INTERACTION_PAGE
|
||||
|
||||
ctypedef enum Elm_Flip_Mode:
|
||||
ELM_FLIP_ROTATE_Y_CENTER_AXIS
|
||||
ELM_FLIP_ROTATE_X_CENTER_AXIS
|
||||
ELM_FLIP_ROTATE_XZ_CENTER_AXIS
|
||||
ELM_FLIP_ROTATE_YZ_CENTER_AXIS
|
||||
ELM_FLIP_CUBE_LEFT
|
||||
ELM_FLIP_CUBE_RIGHT
|
||||
ELM_FLIP_CUBE_UP
|
||||
ELM_FLIP_CUBE_DOWN
|
||||
ELM_FLIP_PAGE_LEFT
|
||||
ELM_FLIP_PAGE_RIGHT
|
||||
ELM_FLIP_PAGE_UP
|
||||
ELM_FLIP_PAGE_DOWN
|
||||
|
||||
ctypedef enum Elm_Focus_Direction:
|
||||
ELM_FOCUS_PREVIOUS
|
||||
ELM_FOCUS_NEXT
|
||||
|
||||
ctypedef enum Elm_Genlist_Item_Type:
|
||||
ELM_GENLIST_ITEM_NONE
|
||||
ELM_GENLIST_ITEM_TREE
|
||||
ELM_GENLIST_ITEM_GROUP
|
||||
ELM_GENLIST_ITEM_MAX
|
||||
|
||||
ctypedef enum Elm_Genlist_Item_Field_Type:
|
||||
ELM_GENLIST_ITEM_FIELD_ALL
|
||||
ELM_GENLIST_ITEM_FIELD_TEXT
|
||||
ELM_GENLIST_ITEM_FIELD_CONTENT
|
||||
ELM_GENLIST_ITEM_FIELD_STATE
|
||||
|
||||
ctypedef enum Elm_Genlist_Item_Scrollto_Type:
|
||||
ELM_GENLIST_ITEM_SCROLLTO_NONE
|
||||
ELM_GENLIST_ITEM_SCROLLTO_IN
|
||||
ELM_GENLIST_ITEM_SCROLLTO_TOP
|
||||
ELM_GENLIST_ITEM_SCROLLTO_MIDDLE
|
||||
|
||||
ctypedef enum Elm_Gesture_State:
|
||||
ELM_GESTURE_STATE_UNDEFINED
|
||||
ELM_GESTURE_STATE_START
|
||||
ELM_GESTURE_STATE_MOVE
|
||||
ELM_GESTURE_STATE_END
|
||||
ELM_GESTURE_STATE_ABORT
|
||||
|
||||
ctypedef enum Elm_Gesture_Type:
|
||||
ELM_GESTURE_FIRST
|
||||
ELM_GESTURE_N_TAPS
|
||||
ELM_GESTURE_N_LONG_TAPS
|
||||
ELM_GESTURE_N_DOUBLE_TAPS
|
||||
ELM_GESTURE_N_TRIPLE_TAPS
|
||||
ELM_GESTURE_MOMENTUM
|
||||
ELM_GESTURE_N_LINES
|
||||
ELM_GESTURE_N_FLICKS
|
||||
ELM_GESTURE_ZOOM
|
||||
ELM_GESTURE_ROTATE
|
||||
ELM_GESTURE_LAST
|
||||
|
||||
ctypedef enum Elm_Hover_Axis:
|
||||
ELM_HOVER_AXIS_NONE
|
||||
ELM_HOVER_AXIS_HORIZONTAL
|
||||
ELM_HOVER_AXIS_VERTICAL
|
||||
ELM_HOVER_AXIS_BOTH
|
||||
|
||||
ctypedef enum Elm_Icon_Lookup_Order:
|
||||
ELM_ICON_LOOKUP_FDO_THEME
|
||||
ELM_ICON_LOOKUP_THEME_FDO
|
||||
ELM_ICON_LOOKUP_FDO
|
||||
ELM_ICON_LOOKUP_THEME
|
||||
|
||||
ctypedef enum Elm_Icon_Type:
|
||||
ELM_ICON_NONE
|
||||
ELM_ICON_FILE
|
||||
ELM_ICON_STANDARD
|
||||
|
||||
ctypedef enum Elm_Illume_Command:
|
||||
ELM_ILLUME_COMMAND_FOCUS_BACK
|
||||
ELM_ILLUME_COMMAND_FOCUS_FORWARD
|
||||
ELM_ILLUME_COMMAND_FOCUS_HOME
|
||||
ELM_ILLUME_COMMAND_CLOSE
|
||||
|
||||
ctypedef enum Elm_Image_Orient:
|
||||
ELM_IMAGE_ORIENT_NONE
|
||||
ELM_IMAGE_ROTATE_0
|
||||
ELM_IMAGE_ROTATE_90
|
||||
ELM_IMAGE_ROTATE_180
|
||||
ELM_IMAGE_ROTATE_270
|
||||
ELM_IMAGE_FLIP_HORIZONTAL
|
||||
ELM_IMAGE_FLIP_VERTICAL
|
||||
ELM_IMAGE_FLIP_TRANSPOSE
|
||||
ELM_IMAGE_FLIP_TRANSVERSE
|
||||
|
||||
ctypedef enum Elm_Input_Panel_Lang:
|
||||
ELM_INPUT_PANEL_LANG_AUTOMATIC
|
||||
ELM_INPUT_PANEL_LANG_ALPHABET
|
||||
|
||||
ctypedef enum Elm_Input_Panel_Layout:
|
||||
ELM_INPUT_PANEL_LAYOUT_NORMAL
|
||||
ELM_INPUT_PANEL_LAYOUT_NUMBER
|
||||
ELM_INPUT_PANEL_LAYOUT_EMAIL
|
||||
ELM_INPUT_PANEL_LAYOUT_URL
|
||||
ELM_INPUT_PANEL_LAYOUT_PHONENUMBER
|
||||
ELM_INPUT_PANEL_LAYOUT_IP
|
||||
ELM_INPUT_PANEL_LAYOUT_MONTH
|
||||
ELM_INPUT_PANEL_LAYOUT_NUMBERONLY
|
||||
ELM_INPUT_PANEL_LAYOUT_INVALID
|
||||
ELM_INPUT_PANEL_LAYOUT_HEX
|
||||
ELM_INPUT_PANEL_LAYOUT_TERMINAL
|
||||
ELM_INPUT_PANEL_LAYOUT_PASSWORD
|
||||
|
||||
ctypedef enum Elm_Input_Panel_Return_Key_Type:
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_DEFAULT
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_DONE
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_GO
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_JOIN
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_LOGIN
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_NEXT
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEARCH
|
||||
ELM_INPUT_PANEL_RETURN_KEY_TYPE_SEND
|
||||
|
||||
ctypedef enum Elm_List_Mode:
|
||||
ELM_LIST_COMPRESS
|
||||
ELM_LIST_SCROLL
|
||||
ELM_LIST_LIMIT
|
||||
ELM_LIST_EXPAND
|
||||
|
||||
ctypedef enum Elm_Map_Overlay_Type:
|
||||
ELM_MAP_OVERLAY_TYPE_NONE
|
||||
ELM_MAP_OVERLAY_TYPE_DEFAULT
|
||||
ELM_MAP_OVERLAY_TYPE_CLASS
|
||||
ELM_MAP_OVERLAY_TYPE_GROUP
|
||||
ELM_MAP_OVERLAY_TYPE_BUBBLE
|
||||
ELM_MAP_OVERLAY_TYPE_ROUTE
|
||||
ELM_MAP_OVERLAY_TYPE_LINE
|
||||
ELM_MAP_OVERLAY_TYPE_POLYGON
|
||||
ELM_MAP_OVERLAY_TYPE_CIRCLE
|
||||
ELM_MAP_OVERLAY_TYPE_SCALE
|
||||
|
||||
ctypedef enum Elm_Map_Route_Method:
|
||||
ELM_MAP_ROUTE_METHOD_FASTEST
|
||||
ELM_MAP_ROUTE_METHOD_SHORTEST
|
||||
ELM_MAP_ROUTE_METHOD_LAST
|
||||
|
||||
ctypedef enum Elm_Map_Route_Type:
|
||||
ELM_MAP_ROUTE_TYPE_MOTOCAR
|
||||
ELM_MAP_ROUTE_TYPE_BICYCLE
|
||||
ELM_MAP_ROUTE_TYPE_FOOT
|
||||
ELM_MAP_ROUTE_TYPE_LAST
|
||||
|
||||
ctypedef enum Elm_Map_Source_Type:
|
||||
ELM_MAP_SOURCE_TYPE_TILE
|
||||
ELM_MAP_SOURCE_TYPE_ROUTE
|
||||
ELM_MAP_SOURCE_TYPE_NAME
|
||||
ELM_MAP_SOURCE_TYPE_LAST
|
||||
|
||||
ctypedef enum Elm_Map_Zoom_Mode:
|
||||
ELM_MAP_ZOOM_MODE_MANUAL
|
||||
ELM_MAP_ZOOM_MODE_AUTO_FIT
|
||||
ELM_MAP_ZOOM_MODE_AUTO_FILL
|
||||
ELM_MAP_ZOOM_MODE_LAST
|
||||
|
||||
ctypedef enum Elm_Notify_Orient:
|
||||
ELM_NOTIFY_ORIENT_TOP
|
||||
ELM_NOTIFY_ORIENT_CENTER
|
||||
ELM_NOTIFY_ORIENT_BOTTOM
|
||||
ELM_NOTIFY_ORIENT_LEFT
|
||||
ELM_NOTIFY_ORIENT_RIGHT
|
||||
ELM_NOTIFY_ORIENT_TOP_LEFT
|
||||
ELM_NOTIFY_ORIENT_TOP_RIGHT
|
||||
ELM_NOTIFY_ORIENT_BOTTOM_LEFT
|
||||
ELM_NOTIFY_ORIENT_BOTTOM_RIGHT
|
||||
ELM_NOTIFY_ORIENT_LAST
|
||||
|
||||
ctypedef enum Elm_Object_Select_Mode:
|
||||
ELM_OBJECT_SELECT_MODE_DEFAULT
|
||||
ELM_OBJECT_SELECT_MODE_ALWAYS
|
||||
ELM_OBJECT_SELECT_MODE_NONE
|
||||
ELM_OBJECT_SELECT_MODE_DISPLAY_ONLY
|
||||
ELM_OBJECT_SELECT_MODE_MAX
|
||||
|
||||
ctypedef enum Elm_Panel_Orient:
|
||||
ELM_PANEL_ORIENT_TOP
|
||||
ELM_PANEL_ORIENT_BOTTOM
|
||||
ELM_PANEL_ORIENT_LEFT
|
||||
ELM_PANEL_ORIENT_RIGHT
|
||||
|
||||
ctypedef enum Elm_Photocam_Zoom_Mode:
|
||||
ELM_PHOTOCAM_ZOOM_MODE_MANUAL
|
||||
ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT
|
||||
ELM_PHOTOCAM_ZOOM_MODE_AUTO_FILL
|
||||
ELM_PHOTOCAM_ZOOM_MODE_AUTO_FIT_IN
|
||||
ELM_PHOTOCAM_ZOOM_MODE_LAST
|
||||
|
||||
ctypedef enum Elm_Policy:
|
||||
ELM_POLICY_QUIT
|
||||
ELM_POLICY_LAST
|
||||
|
||||
ctypedef enum Elm_Policy_Quit:
|
||||
ELM_POLICY_QUIT_NONE
|
||||
ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
|
||||
|
||||
ctypedef enum Elm_Popup_Orient:
|
||||
ELM_POPUP_ORIENT_TOP
|
||||
ELM_POPUP_ORIENT_CENTER
|
||||
ELM_POPUP_ORIENT_BOTTOM
|
||||
ELM_POPUP_ORIENT_LEFT
|
||||
ELM_POPUP_ORIENT_RIGHT
|
||||
ELM_POPUP_ORIENT_TOP_LEFT
|
||||
ELM_POPUP_ORIENT_TOP_RIGHT
|
||||
ELM_POPUP_ORIENT_BOTTOM_LEFT
|
||||
ELM_POPUP_ORIENT_BOTTOM_RIGHT
|
||||
ELM_POPUP_ORIENT_LAST
|
||||
|
||||
ctypedef enum Elm_Scroller_Policy:
|
||||
ELM_SCROLLER_POLICY_AUTO
|
||||
ELM_SCROLLER_POLICY_ON
|
||||
ELM_SCROLLER_POLICY_OFF
|
||||
|
||||
ctypedef enum Elm_Text_Format:
|
||||
ELM_TEXT_FORMAT_PLAIN_UTF8
|
||||
ELM_TEXT_FORMAT_MARKUP_UTF8
|
||||
|
||||
ctypedef enum Elm_Thumb_Animation_Setting:
|
||||
ELM_THUMB_ANIMATION_START
|
||||
ELM_THUMB_ANIMATION_LOOP
|
||||
ELM_THUMB_ANIMATION_STOP
|
||||
ELM_THUMB_ANIMATION_LAST
|
||||
|
||||
ctypedef enum Elm_Toolbar_Shrink_Mode:
|
||||
ELM_TOOLBAR_SHRINK_NONE
|
||||
ELM_TOOLBAR_SHRINK_HIDE
|
||||
ELM_TOOLBAR_SHRINK_SCROLL
|
||||
ELM_TOOLBAR_SHRINK_MENU
|
||||
ELM_TOOLBAR_SHRINK_EXPAND
|
||||
ELM_TOOLBAR_SHRINK_LAST
|
||||
|
||||
ctypedef enum Elm_Transit_Effect_Flip_Axis:
|
||||
ELM_TRANSIT_EFFECT_FLIP_AXIS_X
|
||||
ELM_TRANSIT_EFFECT_FLIP_AXIS_Y
|
||||
|
||||
ctypedef enum Elm_Transit_Effect_Wipe_Dir:
|
||||
ELM_TRANSIT_EFFECT_WIPE_DIR_LEFT
|
||||
ELM_TRANSIT_EFFECT_WIPE_DIR_RIGHT
|
||||
ELM_TRANSIT_EFFECT_WIPE_DIR_UP
|
||||
ELM_TRANSIT_EFFECT_WIPE_DIR_DOWN
|
||||
|
||||
ctypedef enum Elm_Transit_Effect_Wipe_Type:
|
||||
ELM_TRANSIT_EFFECT_WIPE_TYPE_HIDE
|
||||
ELM_TRANSIT_EFFECT_WIPE_TYPE_SHOW
|
||||
|
||||
ctypedef enum Elm_Transit_Tween_Mode:
|
||||
ELM_TRANSIT_TWEEN_MODE_LINEAR
|
||||
ELM_TRANSIT_TWEEN_MODE_SINUSOIDAL
|
||||
ELM_TRANSIT_TWEEN_MODE_DECELERATE
|
||||
ELM_TRANSIT_TWEEN_MODE_ACCELERATE
|
||||
|
||||
ctypedef enum Elm_Web_Window_Feature_Flag:
|
||||
ELM_WEB_WINDOW_FEATURE_TOOLBAR
|
||||
ELM_WEB_WINDOW_FEATURE_STATUSBAR
|
||||
ELM_WEB_WINDOW_FEATURE_SCROLLBARS
|
||||
ELM_WEB_WINDOW_FEATURE_MENUBAR
|
||||
ELM_WEB_WINDOW_FEATURE_LOCATIONBAR
|
||||
ELM_WEB_WINDOW_FEATURE_FULLSCREEN
|
||||
|
||||
ctypedef enum Elm_Web_Zoom_Mode:
|
||||
ELM_WEB_ZOOM_MODE_MANUAL
|
||||
ELM_WEB_ZOOM_MODE_AUTO_FIT
|
||||
ELM_WEB_ZOOM_MODE_AUTO_FILL
|
||||
|
||||
ctypedef enum Elm_Win_Type:
|
||||
ELM_WIN_BASIC
|
||||
ELM_WIN_DIALOG_BASIC
|
||||
ELM_WIN_DESKTOP
|
||||
ELM_WIN_DOCK
|
||||
ELM_WIN_TOOLBAR
|
||||
ELM_WIN_MENU
|
||||
ELM_WIN_UTILITY
|
||||
ELM_WIN_SPLASH
|
||||
ELM_WIN_DROPDOWN_MENU
|
||||
ELM_WIN_POPUP_MENU
|
||||
ELM_WIN_TOOLTIP
|
||||
ELM_WIN_NOTIFICATION
|
||||
ELM_WIN_COMBO
|
||||
ELM_WIN_DND
|
||||
ELM_WIN_INLINED_IMAGE
|
||||
ELM_WIN_SOCKET_IMAGE
|
||||
|
||||
ctypedef enum Elm_Win_Indicator_Mode:
|
||||
ELM_WIN_INDICATOR_UNKNOWN
|
||||
ELM_WIN_INDICATOR_HIDE
|
||||
ELM_WIN_INDICATOR_SHOW
|
||||
|
||||
ctypedef enum Elm_Win_Indicator_Opacity_Mode:
|
||||
ELM_WIN_INDICATOR_OPACITY_UNKNOWN
|
||||
ELM_WIN_INDICATOR_OPAQUE
|
||||
ELM_WIN_INDICATOR_TRANSLUCENT
|
||||
ELM_WIN_INDICATOR_TRANSPARENT
|
||||
|
||||
ctypedef enum Elm_Win_Keyboard_Mode:
|
||||
ELM_WIN_KEYBOARD_UNKNOWN
|
||||
ELM_WIN_KEYBOARD_OFF
|
||||
ELM_WIN_KEYBOARD_ON
|
||||
ELM_WIN_KEYBOARD_ALPHA
|
||||
ELM_WIN_KEYBOARD_NUMERIC
|
||||
ELM_WIN_KEYBOARD_PIN
|
||||
ELM_WIN_KEYBOARD_PHONE_NUMBER
|
||||
ELM_WIN_KEYBOARD_HEX
|
||||
ELM_WIN_KEYBOARD_TERMINAL
|
||||
ELM_WIN_KEYBOARD_PASSWORD
|
||||
ELM_WIN_KEYBOARD_IP
|
||||
ELM_WIN_KEYBOARD_HOST
|
||||
ELM_WIN_KEYBOARD_FILE
|
||||
ELM_WIN_KEYBOARD_URL
|
||||
ELM_WIN_KEYBOARD_KEYPAD
|
||||
ELM_WIN_KEYBOARD_J2ME
|
||||
|
||||
ctypedef enum Elm_Wrap_Type:
|
||||
ELM_WRAP_NONE
|
||||
ELM_WRAP_CHAR
|
||||
ELM_WRAP_WORD
|
||||
ELM_WRAP_MIXED
|
|
@ -0,0 +1,21 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object
|
||||
from enums cimport Elm_Fileselector_Mode
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object * elm_fileselector_add(Evas_Object *parent)
|
||||
void elm_fileselector_is_save_set(Evas_Object *obj, Eina_Bool is_save)
|
||||
Eina_Bool elm_fileselector_is_save_get(Evas_Object *obj)
|
||||
void elm_fileselector_folder_only_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_folder_only_get(Evas_Object *obj)
|
||||
void elm_fileselector_buttons_ok_cancel_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_buttons_ok_cancel_get(Evas_Object *obj)
|
||||
void elm_fileselector_expandable_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_expandable_get(Evas_Object *obj)
|
||||
void elm_fileselector_path_set(Evas_Object *obj, const_char *path)
|
||||
const_char * elm_fileselector_path_get(Evas_Object *obj)
|
||||
Eina_Bool elm_fileselector_selected_set(Evas_Object *obj, const_char *path)
|
||||
const_char * elm_fileselector_selected_get(Evas_Object *obj)
|
||||
void elm_fileselector_mode_set(Evas_Object *obj, Elm_Fileselector_Mode mode)
|
||||
Elm_Fileselector_Mode elm_fileselector_mode_get(Evas_Object *obj)
|
||||
|
|
@ -0,0 +1,280 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Fileselector modes
|
||||
|
||||
.. data:: ELM_FILESELECTOR_LIST
|
||||
|
||||
Layout as a list
|
||||
|
||||
.. data:: ELM_FILESELECTOR_GRID
|
||||
|
||||
Layout as a grid
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
include "callbacks.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_FILESELECTOR_LIST = enums.ELM_FILESELECTOR_LIST
|
||||
ELM_FILESELECTOR_GRID = enums.ELM_FILESELECTOR_GRID
|
||||
|
||||
cdef class Fileselector(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
A file selector is a widget that allows a user to navigate through a
|
||||
file system, reporting file selections back via its API.
|
||||
|
||||
It contains shortcut buttons for home directory (*~*) and to jump one
|
||||
directory upwards (..), as well as cancel/ok buttons to confirm/cancel a
|
||||
given selection. After either one of those two former actions, the file
|
||||
selector will issue its ``"done"`` smart callback.
|
||||
|
||||
There's a text entry on it, too, showing the name of the current
|
||||
selection. There's the possibility of making it editable, so it is
|
||||
useful on file saving dialogs on applications, where one gives a file
|
||||
name to save contents to, in a given directory in the system. This
|
||||
custom file name will be reported on the ``"done"`` smart callback
|
||||
(explained in sequence).
|
||||
|
||||
Finally, it has a view to display file system items into in two possible
|
||||
forms:
|
||||
|
||||
- list
|
||||
- grid
|
||||
|
||||
If Elementary is built with support of the Ethumb thumbnailing library,
|
||||
the second form of view will display preview thumbnails of files which
|
||||
it supports.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``"selected"`` - the user has clicked on a file (when not in
|
||||
folders-only mode) or directory (when in folders-only mode)
|
||||
- ``"directory,open"`` - the list has been populated with new
|
||||
content (*event_info* is the directory's path)
|
||||
- ``"done"`` - the user has clicked on the "ok" or "cancel"
|
||||
buttons (*event_info* is the selection's path)
|
||||
|
||||
"""
|
||||
|
||||
cdef object _cbs
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_fileselector_add(parent.obj))
|
||||
|
||||
|
||||
self._cbs = {}
|
||||
|
||||
property is_save:
|
||||
"""Enable/disable the file name entry box where the user can type
|
||||
in a name for a file, in a given file selector widget
|
||||
|
||||
Having the entry editable is useful on file saving dialogs on
|
||||
applications, where one gives a file name to save contents to,
|
||||
in a given directory in the system. This custom file name will
|
||||
be reported on the ``"done"`` smart callback.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_fileselector_is_save_get(self.obj)
|
||||
|
||||
def __set__(self, is_save):
|
||||
elm_fileselector_is_save_set(self.obj, is_save)
|
||||
|
||||
def is_save_set(self, is_save):
|
||||
elm_fileselector_is_save_set(self.obj, is_save)
|
||||
def is_save_get(self):
|
||||
return elm_fileselector_is_save_get(self.obj)
|
||||
|
||||
property folder_only:
|
||||
"""Enable/disable folder-only view for a given file selector widget
|
||||
|
||||
If enabled, the widget's view will only display folder items,
|
||||
naturally.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_fileselector_folder_only_get(self.obj)
|
||||
|
||||
def __set__(self, folder_only):
|
||||
elm_fileselector_folder_only_set(self.obj, folder_only)
|
||||
|
||||
def folder_only_set(self, folder_only):
|
||||
elm_fileselector_folder_only_set(self.obj, folder_only)
|
||||
def folder_only_get(self):
|
||||
return elm_fileselector_folder_only_get(self.obj)
|
||||
|
||||
property buttons_ok_cancel:
|
||||
"""Enable/disable the "ok" and "cancel" buttons on a given file
|
||||
selector widget
|
||||
|
||||
.. note:: A file selector without those buttons will never emit the
|
||||
``"done"`` smart event, and is only usable if one is just hooking
|
||||
to the other two events.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_fileselector_buttons_ok_cancel_get(self.obj)
|
||||
|
||||
def __set__(self, buttons):
|
||||
elm_fileselector_buttons_ok_cancel_set(self.obj, buttons)
|
||||
|
||||
def buttons_ok_cancel_set(self, buttons):
|
||||
elm_fileselector_buttons_ok_cancel_set(self.obj, buttons)
|
||||
def buttons_ok_cancel_get(self):
|
||||
return elm_fileselector_buttons_ok_cancel_get(self.obj)
|
||||
|
||||
property expandable:
|
||||
"""Enable/disable a tree view in the given file selector widget,
|
||||
**if it's in** ``ELM_FILESELECTOR_LIST`` **mode**
|
||||
|
||||
In a tree view, arrows are created on the sides of directories,
|
||||
allowing them to expand in place.
|
||||
|
||||
.. note:: If it's in other mode, the changes made by this function
|
||||
will only be visible when one switches back to "list" mode.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_fileselector_expandable_get(self.obj)
|
||||
|
||||
def __set__(self, expand):
|
||||
elm_fileselector_expandable_set(self.obj, expand)
|
||||
|
||||
def expandable_set(self, expand):
|
||||
elm_fileselector_expandable_set(self.obj, expand)
|
||||
def expandable_get(self):
|
||||
return elm_fileselector_expandable_get(self.obj)
|
||||
|
||||
property path:
|
||||
"""The **directory** that a given file selector widget will display
|
||||
contents from
|
||||
|
||||
Setting this will change the **directory** displayed. It
|
||||
will also clear the text entry area on the object, which
|
||||
displays select files' names.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_path_get(self.obj))
|
||||
|
||||
def __set__(self, path):
|
||||
elm_fileselector_path_set(self.obj, _cfruni(path))
|
||||
|
||||
def path_set(self, path):
|
||||
elm_fileselector_path_set(self.obj, _cfruni(path))
|
||||
def path_get(self):
|
||||
return _ctouni(elm_fileselector_path_get(self.obj))
|
||||
|
||||
property selected:
|
||||
"""The currently selected file/directory in the given file selector
|
||||
widget
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_selected_get(self.obj))
|
||||
|
||||
def __set__(self, path):
|
||||
#TODO: Check return value for success
|
||||
elm_fileselector_selected_set(self.obj, _cfruni(path))
|
||||
|
||||
def selected_set(self, path):
|
||||
return elm_fileselector_selected_set(self.obj, _cfruni(path))
|
||||
def selected_get(self):
|
||||
return _ctouni(elm_fileselector_selected_get(self.obj))
|
||||
|
||||
property mode:
|
||||
"""The mode in which a given file selector widget will display
|
||||
(layout) file system entries in its view
|
||||
|
||||
.. note:: By using :py:attr:`expandable`, the user may
|
||||
trigger a tree view for that list.
|
||||
|
||||
.. note:: If Elementary is built with support of the Ethumb
|
||||
thumbnailing library, the second form of view will display
|
||||
preview thumbnails of files which it supports. You must have
|
||||
elm_need_ethumb() called in your Elementary for thumbnailing to
|
||||
work, though.
|
||||
|
||||
.. seealso:: :py:attr:`expandable`
|
||||
|
||||
:type: Elm_Fileselector_Mode
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_fileselector_mode_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_fileselector_mode_set(self.obj, mode)
|
||||
|
||||
def mode_set(self, mode):
|
||||
elm_fileselector_mode_set(self.obj, mode)
|
||||
def mode_get(self):
|
||||
return elm_fileselector_mode_get(self.obj)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
"""The user has clicked on a file (when not in folders-only mode) or
|
||||
directory (when in folders-only mode). Parameter ``event_info``
|
||||
contains the selected file or directory."""
|
||||
self._callback_add_full("selected", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del_full("selected", _cb_string_conv, func)
|
||||
|
||||
def callback_directory_open_add(self, func, *args, **kwargs):
|
||||
"""The list has been populated with new content (*event_info* is
|
||||
the directory's path)."""
|
||||
self._callback_add_full("directory,open", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_directory_open_del(self, func):
|
||||
self._callback_del_full("directory,open", _cb_string_conv, func)
|
||||
|
||||
def callback_done_add(self, func, *args, **kwargs):
|
||||
"""The user has clicked on the "ok" or "cancel" buttons
|
||||
(*event_info* is a pointer to the selection's path)."""
|
||||
self._callback_add_full("done", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
||||
def callback_done_del(self, func):
|
||||
self._callback_del_full("done", _cb_string_conv, func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_fileselector", Fileselector)
|
|
@ -0,0 +1,22 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord
|
||||
from button cimport Button
|
||||
from enums cimport Elm_Fileselector_Mode
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object * elm_fileselector_button_add(Evas_Object *parent)
|
||||
void elm_fileselector_button_window_title_set(Evas_Object *obj, const_char *title)
|
||||
const_char * elm_fileselector_button_window_title_get(Evas_Object *obj)
|
||||
void elm_fileselector_button_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height)
|
||||
void elm_fileselector_button_window_size_get(Evas_Object *obj, Evas_Coord *width, Evas_Coord *height)
|
||||
void elm_fileselector_button_folder_only_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_button_folder_only_get(Evas_Object *obj)
|
||||
void elm_fileselector_button_inwin_mode_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_button_inwin_mode_get(Evas_Object *obj)
|
||||
void elm_fileselector_button_is_save_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_button_is_save_get(Evas_Object *obj)
|
||||
void elm_fileselector_button_path_set(Evas_Object *obj, const_char *path)
|
||||
const_char * elm_fileselector_button_path_get(Evas_Object *obj)
|
||||
void elm_fileselector_button_expandable_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_button_expandable_get(Evas_Object *obj)
|
||||
|
|
@ -14,35 +14,113 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Fileselector modes
|
||||
|
||||
.. data:: ELM_FILESELECTOR_LIST
|
||||
|
||||
Layout as a list
|
||||
|
||||
.. data:: ELM_FILESELECTOR_GRID
|
||||
|
||||
Layout as a grid
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
include "callbacks.pxi"
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_FILESELECTOR_LIST = enums.ELM_FILESELECTOR_LIST
|
||||
ELM_FILESELECTOR_GRID = enums.ELM_FILESELECTOR_GRID
|
||||
|
||||
cdef class FileselectorButton(Button):
|
||||
|
||||
"""
|
||||
|
||||
This is a button that, when clicked, creates an Elementary window (or
|
||||
inner window) with a :py:class:`elementary.fileselector.Fileselector`
|
||||
within.
|
||||
|
||||
When a file is chosen, the (inner) window is closed and the button emits
|
||||
a signal having the selected file as it's ``event_info``.
|
||||
|
||||
This widget encapsulates operations on its internal file selector on its
|
||||
own API. There is less control over its file selector than that one
|
||||
would have instantiating one directly.
|
||||
|
||||
The following styles are available for this button:
|
||||
|
||||
- ``"default"``
|
||||
- ``"anchor"``
|
||||
- ``"hoversel_vertical"``
|
||||
- ``"hoversel_vertical_entry"``
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.button.Button`:
|
||||
|
||||
- ``"file,chosen"`` - the user has selected a path which comes as the
|
||||
``event_info`` data
|
||||
|
||||
Default text parts of the fileselector_button widget that you can use for
|
||||
are:
|
||||
|
||||
- "default" - Label of the fileselector_button
|
||||
|
||||
Default content parts of the fileselector_button widget that you can use
|
||||
for are:
|
||||
|
||||
- "icon" - Icon of the fileselector_button
|
||||
|
||||
"""
|
||||
|
||||
cdef object _cbs
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_fileselector_button_add(parent.obj))
|
||||
|
||||
def window_title_set(self, title):
|
||||
elm_fileselector_button_window_title_set(self.obj, _cfruni(title))
|
||||
|
||||
def window_title_get(self):
|
||||
return _ctouni(elm_fileselector_button_window_title_get(self.obj))
|
||||
self._cbs = {}
|
||||
|
||||
property window_title:
|
||||
"""The title for a given file selector button widget's window
|
||||
|
||||
This is the popup window's title, when the file selector pops
|
||||
out after a click on the button. Those windows have the default
|
||||
(unlocalized) value of ``"Select a file"`` as titles.
|
||||
|
||||
.. note:: Setting this will only take effect if the file selector
|
||||
button widget is **not** under "inwin mode".
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_button_window_title_get(self.obj))
|
||||
|
||||
def __set__(self, title):
|
||||
elm_fileselector_button_window_title_set(self.obj, _cfruni(title))
|
||||
|
||||
def window_size_set(self, width, height):
|
||||
elm_fileselector_button_window_size_set(self.obj, width, height)
|
||||
|
||||
def window_size_get(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_fileselector_button_window_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
def window_title_set(self, title):
|
||||
elm_fileselector_button_window_title_set(self.obj, _cfruni(title))
|
||||
def window_title_get(self):
|
||||
return _ctouni(elm_fileselector_button_window_title_get(self.obj))
|
||||
|
||||
property window_size:
|
||||
"""The size of a given file selector button widget's window,
|
||||
holding the file selector itself.
|
||||
|
||||
.. note:: Setting this will only take any effect if the file
|
||||
selector button widget is **not** under "inwin mode". The
|
||||
default size for the window (when applicable) is 400x400 pixels.
|
||||
|
||||
:type: tuple of Evas_Coords (int)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_fileselector_button_window_size_get(self.obj, &w, &h)
|
||||
|
@ -53,72 +131,132 @@ cdef class FileselectorButton(Button):
|
|||
w, h = value
|
||||
elm_fileselector_button_window_size_set(self.obj, w, h)
|
||||
|
||||
def path_set(self, path):
|
||||
elm_fileselector_button_path_set(self.obj, _cfruni(path))
|
||||
|
||||
def path_get(self):
|
||||
return _ctouni(elm_fileselector_button_path_get(self.obj))
|
||||
def window_size_set(self, width, height):
|
||||
elm_fileselector_button_window_size_set(self.obj, width, height)
|
||||
def window_size_get(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_fileselector_button_window_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
property path:
|
||||
"""The initial file system path for a given file selector
|
||||
button widget
|
||||
|
||||
It must be a **directory** path, which will have the contents
|
||||
displayed initially in the file selector's view. The default initial
|
||||
path is the ``"HOME"`` environment variable's value.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_button_path_get(self.obj))
|
||||
|
||||
def __set__(self, path):
|
||||
elm_fileselector_button_path_set(self.obj, _cfruni(path))
|
||||
|
||||
def expandable_set(self, expand):
|
||||
elm_fileselector_button_expandable_set(self.obj, expand)
|
||||
|
||||
def expandable_get(self):
|
||||
return bool(elm_fileselector_button_expandable_get(self.obj))
|
||||
def path_set(self, path):
|
||||
elm_fileselector_button_path_set(self.obj, _cfruni(path))
|
||||
def path_get(self):
|
||||
return _ctouni(elm_fileselector_button_path_get(self.obj))
|
||||
|
||||
property expandable:
|
||||
"""Enable/disable a tree view in the given file selector button
|
||||
widget's internal file selector
|
||||
|
||||
This has the same effect as :py:attr:`Fileselector.expandable`,
|
||||
but now applied to a file selector button's internal file
|
||||
selector.
|
||||
|
||||
.. note:: There's no way to put a file selector button's internal
|
||||
file selector in "grid mode", as one may do with "pure" file
|
||||
selectors.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_button_expandable_get(self.obj))
|
||||
|
||||
def __set__(self, expand):
|
||||
elm_fileselector_button_expandable_set(self.obj, expand)
|
||||
|
||||
def folder_only_set(self, folder_only):
|
||||
elm_fileselector_button_folder_only_set(self.obj, folder_only)
|
||||
|
||||
def folder_only_get(self):
|
||||
return bool(elm_fileselector_button_folder_only_get(self.obj))
|
||||
def expandable_set(self, expand):
|
||||
elm_fileselector_button_expandable_set(self.obj, expand)
|
||||
def expandable_get(self):
|
||||
return bool(elm_fileselector_button_expandable_get(self.obj))
|
||||
|
||||
property folder_only:
|
||||
"""Whether a given file selector button widget's internal file
|
||||
selector is to display folders only or the directory contents,
|
||||
as well.
|
||||
|
||||
This has the same effect as :py:attr:`Fileselector.folder_only`,
|
||||
but now applied to a file selector button's internal file
|
||||
selector.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_button_folder_only_get(self.obj))
|
||||
|
||||
def __set__(self, folder_only):
|
||||
elm_fileselector_button_folder_only_set(self.obj, folder_only)
|
||||
|
||||
def is_save_set(self, is_save):
|
||||
elm_fileselector_button_is_save_set(self.obj, is_save)
|
||||
|
||||
def is_save_get(self):
|
||||
return bool(elm_fileselector_button_is_save_get(self.obj))
|
||||
def folder_only_set(self, folder_only):
|
||||
elm_fileselector_button_folder_only_set(self.obj, folder_only)
|
||||
def folder_only_get(self):
|
||||
return bool(elm_fileselector_button_folder_only_get(self.obj))
|
||||
|
||||
property is_save:
|
||||
"""Enable/disable the file name entry box where the user can type
|
||||
in a name for a file, in a given file selector button widget's
|
||||
internal file selector.
|
||||
|
||||
This has the same effect as :py:attr:`Fileselector.is_save`,
|
||||
but now applied to a file selector button's internal file
|
||||
selector.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_button_is_save_get(self.obj))
|
||||
|
||||
def __set__(self, is_save):
|
||||
elm_fileselector_button_is_save_set(self.obj, is_save)
|
||||
|
||||
def inwin_mode_set(self, inwin_mode):
|
||||
elm_fileselector_button_inwin_mode_set(self.obj, inwin_mode)
|
||||
|
||||
def inwin_mode_get(self):
|
||||
return bool(elm_fileselector_button_inwin_mode_get(self.obj))
|
||||
def is_save_set(self, is_save):
|
||||
elm_fileselector_button_is_save_set(self.obj, is_save)
|
||||
def is_save_get(self):
|
||||
return bool(elm_fileselector_button_is_save_get(self.obj))
|
||||
|
||||
property inwin_mode:
|
||||
"""Whether a given file selector button widget's internal file
|
||||
selector will raise an Elementary "inner window", instead of a
|
||||
dedicated Elementary window. By default, it won't.
|
||||
|
||||
.. seealso:: :py:class:`elementary.innerwindow.InnerWindow` for more
|
||||
information on inner windows
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_button_inwin_mode_get(self.obj))
|
||||
|
||||
def __set__(self, inwin_mode):
|
||||
elm_fileselector_button_inwin_mode_set(self.obj, inwin_mode)
|
||||
|
||||
def inwin_mode_set(self, inwin_mode):
|
||||
elm_fileselector_button_inwin_mode_set(self.obj, inwin_mode)
|
||||
def inwin_mode_get(self):
|
||||
return bool(elm_fileselector_button_inwin_mode_get(self.obj))
|
||||
|
||||
def callback_file_chosen_add(self, func, *args, **kwargs):
|
||||
"""The user has selected a path which comes as the ``event_info``
|
||||
data."""
|
||||
self._callback_add_full("file,chosen", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
|
@ -0,0 +1,23 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord
|
||||
from enums cimport Elm_Fileselector_Mode
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object * elm_fileselector_entry_add(Evas_Object *parent)
|
||||
void elm_fileselector_entry_window_title_set(Evas_Object *obj, const_char *title)
|
||||
const_char * elm_fileselector_entry_window_title_get(Evas_Object *obj)
|
||||
void elm_fileselector_entry_window_size_set(Evas_Object *obj, Evas_Coord width, Evas_Coord height)
|
||||
void elm_fileselector_entry_window_size_get(Evas_Object *obj, Evas_Coord *width, Evas_Coord *height)
|
||||
void elm_fileselector_entry_path_set(Evas_Object *obj, const_char *path)
|
||||
const_char * elm_fileselector_entry_path_get(Evas_Object *obj)
|
||||
void elm_fileselector_entry_expandable_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_entry_expandable_get(Evas_Object *obj)
|
||||
void elm_fileselector_entry_folder_only_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_entry_folder_only_get(Evas_Object *obj)
|
||||
void elm_fileselector_entry_is_save_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_entry_is_save_get(Evas_Object *obj)
|
||||
void elm_fileselector_entry_inwin_mode_set(Evas_Object *obj, Eina_Bool value)
|
||||
Eina_Bool elm_fileselector_entry_inwin_mode_get(Evas_Object *obj)
|
||||
void elm_fileselector_entry_selected_set(Evas_Object *obj, const_char *path)
|
||||
const_char * elm_fileselector_entry_selected_get(Evas_Object *obj)
|
||||
|
|
@ -14,36 +14,129 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Fileselector modes
|
||||
|
||||
.. data:: ELM_FILESELECTOR_LIST
|
||||
|
||||
Layout as a list
|
||||
|
||||
.. data:: ELM_FILESELECTOR_GRID
|
||||
|
||||
Layout as a grid
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
include "callbacks.pxi"
|
||||
|
||||
from object cimport Object
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_FILESELECTOR_LIST = enums.ELM_FILESELECTOR_LIST
|
||||
ELM_FILESELECTOR_GRID = enums.ELM_FILESELECTOR_GRID
|
||||
|
||||
cdef class FileselectorEntry(Object):
|
||||
|
||||
"""
|
||||
|
||||
This is an entry made to be filled with or display a file
|
||||
system path string.
|
||||
|
||||
Besides the entry itself, the widget has a :py:class:`FileselectorButton`
|
||||
on its side, which will raise an internal :py:class:`Fileselector`,
|
||||
when clicked, for path selection aided by file system navigation.
|
||||
|
||||
This file selector may appear in an Elementary window or in an
|
||||
inner window. When a file is chosen from it, the (inner) window
|
||||
is closed and the selected file's path string is exposed both as
|
||||
a smart event and as the new text on the entry.
|
||||
|
||||
This widget encapsulates operations on its internal file
|
||||
selector on its own API. There is less control over its file
|
||||
selector than that one would have instantiating one directly.
|
||||
|
||||
Smart callbacks one can register to:
|
||||
|
||||
- ``"changed"`` - The text within the entry was changed
|
||||
- ``"activated"`` - The entry has had editing finished and
|
||||
changes are to be "committed"
|
||||
- ``"press"`` - The entry has been clicked
|
||||
- ``"longpressed"`` - The entry has been clicked (and held) for a
|
||||
couple seconds
|
||||
- ``"clicked"`` - The entry has been clicked
|
||||
- ``"clicked,double"`` - The entry has been double clicked
|
||||
- ``"focused"`` - The entry has received focus
|
||||
- ``"unfocused"`` - The entry has lost focus
|
||||
- ``"selection,paste"`` - A paste action has occurred on the
|
||||
entry
|
||||
- ``"selection,copy"`` - A copy action has occurred on the entry
|
||||
- ``"selection,cut"`` - A cut action has occurred on the entry
|
||||
- ``"unpressed"`` - The file selector entry's button was released
|
||||
after being pressed.
|
||||
- ``"file,chosen"`` - The user has selected a path via the file
|
||||
selector entry's internal file selector, whose string
|
||||
comes as the ``event_info`` data.
|
||||
|
||||
Default text parts of the fileselector_button widget that you can use for
|
||||
are:
|
||||
|
||||
- "default" - Label of the fileselector_button
|
||||
|
||||
Default content parts of the fileselector_entry widget that you can use for
|
||||
are:
|
||||
|
||||
- "button icon" - Button icon of the fileselector_entry
|
||||
|
||||
"""
|
||||
|
||||
cdef object _cbs
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_fileselector_entry_add(parent.obj))
|
||||
|
||||
def window_title_set(self, title):
|
||||
elm_fileselector_entry_window_title_set(self.obj, _cfruni(title))
|
||||
|
||||
def window_title_get(self):
|
||||
return _ctouni(elm_fileselector_entry_window_title_get(self.obj))
|
||||
self._cbs = {}
|
||||
|
||||
property window_title:
|
||||
"""The title for a given file selector entry widget's window
|
||||
|
||||
This is the window's title, when the file selector pops
|
||||
out after a click on the entry's button. Those windows have the
|
||||
default (unlocalized) value of ``"Select a file"`` as titles.
|
||||
|
||||
.. note:: It will only take any effect if the file selector
|
||||
entry widget is **not** under "inwin mode".
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_entry_window_title_get(self.obj))
|
||||
|
||||
def __set__(self, title):
|
||||
elm_fileselector_entry_window_title_set(self.obj, _cfruni(title))
|
||||
|
||||
def window_size_set(self, width, height):
|
||||
elm_fileselector_entry_window_size_set(self.obj, width, height)
|
||||
|
||||
def window_size_get(self):
|
||||
cdef Evas_Coord w
|
||||
cdef Evas_Coord h
|
||||
elm_fileselector_entry_window_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
def window_title_set(self, title):
|
||||
elm_fileselector_entry_window_title_set(self.obj, _cfruni(title))
|
||||
def window_title_get(self):
|
||||
return _ctouni(elm_fileselector_entry_window_title_get(self.obj))
|
||||
|
||||
property window_size:
|
||||
"""The size of a given file selector entry widget's window,
|
||||
holding the file selector itself.
|
||||
|
||||
.. note:: it will only take any effect if the file selector entry
|
||||
widget is **not** under "inwin mode". The default size for the
|
||||
window (when applicable) is 400x400 pixels.
|
||||
|
||||
:type: tuple of Evas_Coords (int)
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_fileselector_entry_window_size_get(self.obj, &w, &h)
|
||||
|
@ -54,157 +147,240 @@ cdef class FileselectorEntry(Object):
|
|||
w, h = value
|
||||
elm_fileselector_entry_window_size_set(self.obj, w, h)
|
||||
|
||||
def path_set(self, path):
|
||||
elm_fileselector_entry_path_set(self.obj, _cfruni(path))
|
||||
|
||||
def path_get(self):
|
||||
return _ctouni(elm_fileselector_entry_path_get(self.obj))
|
||||
def window_size_set(self, width, height):
|
||||
elm_fileselector_entry_window_size_set(self.obj, width, height)
|
||||
def window_size_get(self):
|
||||
cdef Evas_Coord w, h
|
||||
elm_fileselector_entry_window_size_get(self.obj, &w, &h)
|
||||
return (w, h)
|
||||
|
||||
property path:
|
||||
"""The initial file system path and the entry's path string for
|
||||
a given file selector entry widget
|
||||
|
||||
It must be a **directory** path, which will have the contents
|
||||
displayed initially in the file selector's view. The default initial
|
||||
path is the ``"HOME"`` environment variable's value.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_entry_path_get(self.obj))
|
||||
|
||||
def __set__(self, path):
|
||||
elm_fileselector_entry_path_set(self.obj, _cfruni(path))
|
||||
|
||||
def expandable_set(self, expand):
|
||||
elm_fileselector_entry_expandable_set(self.obj, expand)
|
||||
|
||||
def expandable_get(self):
|
||||
return bool(elm_fileselector_entry_expandable_get(self.obj))
|
||||
def path_set(self, path):
|
||||
elm_fileselector_entry_path_set(self.obj, _cfruni(path))
|
||||
def path_get(self):
|
||||
return _ctouni(elm_fileselector_entry_path_get(self.obj))
|
||||
|
||||
property expandable:
|
||||
"""Enable/disable a tree view in the given file selector entry
|
||||
widget's internal file selector
|
||||
|
||||
This has the same effect as :py:attr:`Fileselector.expandable`,
|
||||
but now applied to a file selector entry's internal file
|
||||
selector.
|
||||
|
||||
.. note:: There's no way to put a file selector entry's internal
|
||||
file selector in "grid mode", as one may do with "pure" file
|
||||
selectors.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_entry_expandable_get(self.obj))
|
||||
|
||||
def __set__(self, expand):
|
||||
elm_fileselector_entry_expandable_set(self.obj, expand)
|
||||
|
||||
def folder_only_set(self, folder_only):
|
||||
elm_fileselector_entry_folder_only_set(self.obj, folder_only)
|
||||
|
||||
def folder_only_get(self):
|
||||
return bool(elm_fileselector_entry_folder_only_get(self.obj))
|
||||
def expandable_set(self, expand):
|
||||
elm_fileselector_entry_expandable_set(self.obj, expand)
|
||||
def expandable_get(self):
|
||||
return bool(elm_fileselector_entry_expandable_get(self.obj))
|
||||
|
||||
property folder_only:
|
||||
"""Whether a given file selector entry widget's internal file
|
||||
selector is to display folders only or the directory contents,
|
||||
as well.
|
||||
|
||||
This has the same effect as :py:attr:`Fileselector.folder_only`,
|
||||
but now applied to a file selector entry's internal file
|
||||
selector.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_entry_folder_only_get(self.obj))
|
||||
|
||||
def __set__(self, folder_only):
|
||||
elm_fileselector_entry_folder_only_set(self.obj, folder_only)
|
||||
|
||||
def is_save_set(self, is_save):
|
||||
elm_fileselector_entry_is_save_set(self.obj, is_save)
|
||||
|
||||
def is_save_get(self):
|
||||
return bool(elm_fileselector_entry_is_save_get(self.obj))
|
||||
def folder_only_set(self, folder_only):
|
||||
elm_fileselector_entry_folder_only_set(self.obj, folder_only)
|
||||
def folder_only_get(self):
|
||||
return bool(elm_fileselector_entry_folder_only_get(self.obj))
|
||||
|
||||
property is_save:
|
||||
"""Enable/disable the file name entry box where the user can type
|
||||
in a name for a file, in a given file selector entry widget's
|
||||
internal file selector.
|
||||
|
||||
This has the same effect as :py:attr:`Fileselector.is_save`,
|
||||
but now applied to a file selector entry's internal file
|
||||
selector.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_entry_is_save_get(self.obj))
|
||||
|
||||
def __set__(self, is_save):
|
||||
elm_fileselector_entry_is_save_set(self.obj, is_save)
|
||||
|
||||
def inwin_mode_set(self, inwin_mode):
|
||||
elm_fileselector_entry_inwin_mode_set(self.obj, inwin_mode)
|
||||
|
||||
def inwin_mode_get(self):
|
||||
return bool(elm_fileselector_entry_inwin_mode_get(self.obj))
|
||||
def is_save_set(self, is_save):
|
||||
elm_fileselector_entry_is_save_set(self.obj, is_save)
|
||||
def is_save_get(self):
|
||||
return bool(elm_fileselector_entry_is_save_get(self.obj))
|
||||
|
||||
property inwin_mode:
|
||||
"""Whether a given file selector entry widget's internal file
|
||||
selector will raise an Elementary "inner window", instead of a
|
||||
dedicated Elementary window. By default, it won't.
|
||||
|
||||
.. seealso:: :py:class:`InnerWindow` for more information on inner
|
||||
windows
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return bool(elm_fileselector_entry_inwin_mode_get(self.obj))
|
||||
|
||||
def __set__(self, inwin_mode):
|
||||
elm_fileselector_entry_inwin_mode_set(self.obj, inwin_mode)
|
||||
|
||||
def selected_set(self, path):
|
||||
elm_fileselector_entry_selected_set(self.obj, _cfruni(path))
|
||||
|
||||
def selected_get(self):
|
||||
return _ctouni(elm_fileselector_entry_selected_get(self.obj))
|
||||
def inwin_mode_set(self, inwin_mode):
|
||||
elm_fileselector_entry_inwin_mode_set(self.obj, inwin_mode)
|
||||
def inwin_mode_get(self):
|
||||
return bool(elm_fileselector_entry_inwin_mode_get(self.obj))
|
||||
|
||||
property selected:
|
||||
"""The initial file system path for a given file selector entry
|
||||
widget
|
||||
|
||||
It must be a **directory** path, which will have the contents
|
||||
displayed initially in the file selector's view. The default initial
|
||||
path is the ``"HOME"`` environment variable's value.
|
||||
|
||||
:type: string
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _ctouni(elm_fileselector_entry_selected_get(self.obj))
|
||||
|
||||
def __set__(self, path):
|
||||
elm_fileselector_entry_selected_set(self.obj, _cfruni(path))
|
||||
|
||||
def selected_set(self, path):
|
||||
elm_fileselector_entry_selected_set(self.obj, _cfruni(path))
|
||||
def selected_get(self):
|
||||
return _ctouni(elm_fileselector_entry_selected_get(self.obj))
|
||||
|
||||
def callback_changed_add(self, func, *args, **kwargs):
|
||||
"""The text within the entry was changed."""
|
||||
self._callback_add("changed", func, *args, **kwargs)
|
||||
|
||||
def callback_changed_del(self, func):
|
||||
self._callback_del("changed", func)
|
||||
|
||||
def callback_activated_add(self, func, *args, **kwargs):
|
||||
"""The entry has had editing finished and changes are to be committed."""
|
||||
self._callback_add("activated", func, *args, **kwargs)
|
||||
|
||||
def callback_activated_del(self, func):
|
||||
self._callback_del("activated", func)
|
||||
|
||||
def callback_press_add(self, func, *args, **kwargs):
|
||||
"""The entry has been clicked."""
|
||||
self._callback_add("press", func, *args, **kwargs)
|
||||
|
||||
def callback_press_del(self, func):
|
||||
self._callback_del("press", func)
|
||||
|
||||
def callback_longpressed_add(self, func, *args, **kwargs):
|
||||
"""The entry has been clicked (and held) for a couple seconds."""
|
||||
self._callback_add("longpressed", func, *args, **kwargs)
|
||||
|
||||
def callback_longpressed_del(self, func):
|
||||
self._callback_del("longpressed", func)
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
"""The entry has been clicked."""
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
||||
self._callback_del("clicked", func)
|
||||
|
||||
def callback_clicked_double_add(self, func, *args, **kwargs):
|
||||
"""The entry has been double clicked."""
|
||||
self._callback_add("clicked,double", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_double_del(self, func):
|
||||
self._callback_del("clicked,double", func)
|
||||
|
||||
def callback_focused_add(self, func, *args, **kwargs):
|
||||
"""The entry has received focus."""
|
||||
self._callback_add("focused", func, *args, **kwargs)
|
||||
|
||||
def callback_focused_del(self, func):
|
||||
self._callback_del("focused", func)
|
||||
|
||||
def callback_unfocused_add(self, func, *args, **kwargs):
|
||||
"""The entry has lost focus."""
|
||||
self._callback_add("unfocused", func, *args, **kwargs)
|
||||
|
||||
def callback_unfocused_del(self, func):
|
||||
self._callback_del("unfocused", func)
|
||||
|
||||
def callback_selection_paste_add(self, func, *args, **kwargs):
|
||||
"""A paste action has occurred on the entry."""
|
||||
self._callback_add("selection,paste", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_paste_del(self, func):
|
||||
self._callback_del("selection,paste", func)
|
||||
|
||||
def callback_selection_copy_add(self, func, *args, **kwargs):
|
||||
"""A copy action has occurred on the entry."""
|
||||
self._callback_add("selection,copy", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_copy_del(self, func):
|
||||
self._callback_del("selection,copy", func)
|
||||
|
||||
def callback_selection_cut_add(self, func, *args, **kwargs):
|
||||
"""A cut action has occurred on the entry."""
|
||||
self._callback_add("selection,cut", func, *args, **kwargs)
|
||||
|
||||
def callback_selection_cut_del(self, func):
|
||||
self._callback_del("selection,cut", func)
|
||||
|
||||
def callback_unpressed_add(self, func, *args, **kwargs):
|
||||
"""The file selector entry's button was released after being pressed."""
|
||||
self._callback_add("unpressed", func, *args, **kwargs)
|
||||
|
||||
def callback_unpressed_del(self, func):
|
||||
self._callback_del("unpressed", func)
|
||||
|
||||
def callback_file_chosen_add(self, func, *args, **kwargs):
|
||||
"""The user has selected a path via the file selector entry's internal
|
||||
file selector, whose string comes as the ``event_info`` data.
|
||||
|
||||
"""
|
||||
self._callback_add_full("file,chosen", _cb_string_conv,
|
||||
func, *args, **kwargs)
|
||||
|
|
@ -0,0 +1,14 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord
|
||||
from enums cimport Elm_Flip_Direction, Elm_Flip_Interaction, Elm_Flip_Mode
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_flip_add(Evas_Object *parent)
|
||||
Eina_Bool elm_flip_front_visible_get(Evas_Object *obj)
|
||||
void elm_flip_perspective_set(Evas_Object *obj, Evas_Coord foc, Evas_Coord x, Evas_Coord y)
|
||||
void elm_flip_go(Evas_Object *obj, Elm_Flip_Mode mode)
|
||||
void elm_flip_interaction_set(Evas_Object *obj, Elm_Flip_Interaction mode)
|
||||
Elm_Flip_Interaction elm_flip_interaction_get(Evas_Object *obj)
|
||||
void elm_flip_interaction_direction_enabled_set(Evas_Object *obj, Elm_Flip_Direction dir, Eina_Bool enabled)
|
||||
Eina_Bool elm_flip_interaction_direction_enabled_get(Evas_Object *obj, Elm_Flip_Direction dir)
|
||||
void elm_flip_interaction_direction_hitsize_set(Evas_Object *obj, Elm_Flip_Direction dir, double hitsize)
|
||||
double elm_flip_interaction_direction_hitsize_get(Evas_Object *obj, Elm_Flip_Direction dir)
|
|
@ -0,0 +1,400 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Flip directions
|
||||
|
||||
.. data:: ELM_FLIP_DIRECTION_UP
|
||||
|
||||
Allows interaction with the top of the widget.
|
||||
|
||||
.. data:: ELM_FLIP_DIRECTION_DOWN
|
||||
|
||||
Allows interaction with the bottom of the widget.
|
||||
|
||||
.. data:: ELM_FLIP_DIRECTION_LEFT
|
||||
|
||||
Allows interaction with the left portion of
|
||||
|
||||
the widget.
|
||||
.. data:: ELM_FLIP_DIRECTION_RIGHT
|
||||
|
||||
Allows interaction with the right portion of
|
||||
|
||||
the widget.
|
||||
|
||||
|
||||
.. rubric:: Flip interaction modes
|
||||
|
||||
.. data:: ELM_FLIP_INTERACTION_NONE
|
||||
|
||||
No interaction is allowed
|
||||
|
||||
.. data:: ELM_FLIP_INTERACTION_ROTATE
|
||||
|
||||
Interaction will cause rotate animation
|
||||
|
||||
.. data:: ELM_FLIP_INTERACTION_CUBE
|
||||
|
||||
Interaction will cause cube animation
|
||||
|
||||
.. data:: ELM_FLIP_INTERACTION_PAGE
|
||||
|
||||
Interaction will cause page animation
|
||||
|
||||
|
||||
.. rubric:: Flip rotation modes
|
||||
|
||||
.. data:: ELM_FLIP_ROTATE_Y_CENTER_AXIS
|
||||
|
||||
Rotate the currently visible content around a vertical axis in the
|
||||
middle of its width, the other content is shown as the other side of the
|
||||
flip.
|
||||
|
||||
.. data:: ELM_FLIP_ROTATE_X_CENTER_AXIS
|
||||
|
||||
Rotate the currently visible content around a horizontal axis in the
|
||||
middle of its height, the other content is shown as the other side of
|
||||
the flip.
|
||||
|
||||
.. data:: ELM_FLIP_ROTATE_XZ_CENTER_AXIS
|
||||
|
||||
Rotate the currently visible content around a diagonal axis in the
|
||||
middle of its width, the other content is shown as the other side of the
|
||||
flip.
|
||||
|
||||
.. data:: ELM_FLIP_ROTATE_YZ_CENTER_AXIS
|
||||
|
||||
Rotate the currently visible content around a diagonal axis in the
|
||||
middle of its height, the other content is shown as the other side of
|
||||
the flip.
|
||||
|
||||
|
||||
.. rubric:: Flip cube modes
|
||||
|
||||
.. data:: ELM_FLIP_CUBE_LEFT
|
||||
|
||||
Rotate the currently visible content to the left as if the flip was a
|
||||
cube, the other content is show as the right face of the cube.
|
||||
|
||||
.. data:: ELM_FLIP_CUBE_RIGHT
|
||||
|
||||
Rotate the currently visible content to the right as if the flip was a
|
||||
cube, the other content is show as the left face of the cube.
|
||||
|
||||
.. data:: ELM_FLIP_CUBE_UP
|
||||
|
||||
Rotate the currently visible content up as if the flip was a cube, the
|
||||
other content is show as the bottom face of the cube.
|
||||
|
||||
.. data:: ELM_FLIP_CUBE_DOWN
|
||||
|
||||
Rotate the currently visible content down as if the flip was a cube, the
|
||||
other content is show as the upper face of the cube.
|
||||
|
||||
|
||||
.. rubric:: Flip page modes
|
||||
|
||||
.. data:: ELM_FLIP_PAGE_LEFT
|
||||
|
||||
Move the currently visible content to the left as if the flip was a
|
||||
book, the other content is shown as the page below that.
|
||||
|
||||
.. data:: ELM_FLIP_PAGE_RIGHT
|
||||
|
||||
Move the currently visible content to the right as if the flip was a
|
||||
book, the other content is shown as the page below that.
|
||||
|
||||
.. data:: ELM_FLIP_PAGE_UP
|
||||
|
||||
Move the currently visible content up as if the flip was a book, the
|
||||
other content is shown as the page below that.
|
||||
|
||||
.. data:: ELM_FLIP_PAGE_DOWN
|
||||
|
||||
Move the currently visible content down as if the flip was a book, the
|
||||
other content is shown as the page below that.
|
||||
|
||||
"""
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from object cimport Object
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_FLIP_DIRECTION_UP = enums.ELM_FLIP_DIRECTION_UP
|
||||
ELM_FLIP_DIRECTION_DOWN = enums.ELM_FLIP_DIRECTION_DOWN
|
||||
ELM_FLIP_DIRECTION_LEFT = enums.ELM_FLIP_DIRECTION_LEFT
|
||||
ELM_FLIP_DIRECTION_RIGHT = enums.ELM_FLIP_DIRECTION_RIGHT
|
||||
|
||||
ELM_FLIP_INTERACTION_NONE = enums.ELM_FLIP_INTERACTION_NONE
|
||||
ELM_FLIP_INTERACTION_ROTATE = enums.ELM_FLIP_INTERACTION_ROTATE
|
||||
ELM_FLIP_INTERACTION_CUBE = enums.ELM_FLIP_INTERACTION_CUBE
|
||||
ELM_FLIP_INTERACTION_PAGE = enums.ELM_FLIP_INTERACTION_PAGE
|
||||
|
||||
ELM_FLIP_ROTATE_Y_CENTER_AXIS = enums.ELM_FLIP_ROTATE_Y_CENTER_AXIS
|
||||
ELM_FLIP_ROTATE_X_CENTER_AXIS = enums.ELM_FLIP_ROTATE_X_CENTER_AXIS
|
||||
ELM_FLIP_ROTATE_XZ_CENTER_AXIS = enums.ELM_FLIP_ROTATE_XZ_CENTER_AXIS
|
||||
ELM_FLIP_ROTATE_YZ_CENTER_AXIS = enums.ELM_FLIP_ROTATE_YZ_CENTER_AXIS
|
||||
ELM_FLIP_CUBE_LEFT = enums.ELM_FLIP_CUBE_LEFT
|
||||
ELM_FLIP_CUBE_RIGHT = enums.ELM_FLIP_CUBE_RIGHT
|
||||
ELM_FLIP_CUBE_UP = enums.ELM_FLIP_CUBE_UP
|
||||
ELM_FLIP_CUBE_DOWN = enums.ELM_FLIP_CUBE_DOWN
|
||||
ELM_FLIP_PAGE_LEFT = enums.ELM_FLIP_PAGE_LEFT
|
||||
ELM_FLIP_PAGE_RIGHT = enums.ELM_FLIP_PAGE_RIGHT
|
||||
ELM_FLIP_PAGE_UP = enums.ELM_FLIP_PAGE_UP
|
||||
ELM_FLIP_PAGE_DOWN = enums.ELM_FLIP_PAGE_DOWN
|
||||
|
||||
cdef class Flip(Object):
|
||||
|
||||
"""
|
||||
|
||||
This widget holds two content :py:class:`evas.object.Object` s: one on
|
||||
the front and one on the back. It allows you to flip from front to back
|
||||
and vice-versa using various animations.
|
||||
|
||||
If either the front or back contents are not set the flip will treat that
|
||||
as transparent. So if you were to set the front content but not the back,
|
||||
and then call :py:func:`go()` you would see whatever is below the flip.
|
||||
|
||||
For a list of supported animations see :py:func:`go()`.
|
||||
|
||||
Signals that you can add callbacks for are:
|
||||
|
||||
- "animate,begin" - when a flip animation was started
|
||||
- "animate,done" - when a flip animation is finished
|
||||
|
||||
Default content parts of the flip widget that you can use for are:
|
||||
|
||||
- "front" - A front content of the flip
|
||||
- "back" - A back content of the flip
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_flip_add(parent.obj))
|
||||
|
||||
|
||||
property front_visible:
|
||||
"""Front visibility state
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_flip_front_visible_get(self.obj)
|
||||
|
||||
def front_visible_get(self):
|
||||
return elm_flip_front_visible_get(self.obj)
|
||||
|
||||
property perspective:
|
||||
"""Set flip perspective
|
||||
|
||||
.. warning:: This function currently does nothing.
|
||||
|
||||
:type: tuple of Evas_Coords (int)
|
||||
|
||||
"""
|
||||
def __set__(self, value):
|
||||
foc, x, y = value
|
||||
elm_flip_perspective_set(self.obj, foc, x, y)
|
||||
|
||||
def perspective_set(self, foc, x, y):
|
||||
elm_flip_perspective_set(self.obj, foc, x, y)
|
||||
|
||||
def go(self, flip_mode):
|
||||
"""go(int flip_mode)
|
||||
|
||||
Runs the flip animation
|
||||
|
||||
Flips the front and back contents using the ``mode`` animation. This
|
||||
effectively hides the currently visible content and shows the hidden one.
|
||||
|
||||
There a number of possible animations to use for the flipping:
|
||||
|
||||
- ELM_FLIP_ROTATE_X_CENTER_AXIS - Rotate the currently visible content
|
||||
around a horizontal axis in the middle of its height, the other
|
||||
content is shown as the other side of the flip.
|
||||
- ELM_FLIP_ROTATE_Y_CENTER_AXIS - Rotate the currently visible content
|
||||
around a vertical axis in the middle of its width, the other
|
||||
content is shown as the other side of the flip.
|
||||
- ELM_FLIP_ROTATE_XZ_CENTER_AXIS - Rotate the currently visible content
|
||||
around a diagonal axis in the middle of its width, the other
|
||||
content is shown as the other side of the flip.
|
||||
- ELM_FLIP_ROTATE_YZ_CENTER_AXIS - Rotate the currently visible content
|
||||
around a diagonal axis in the middle of its height, the other
|
||||
content is shown as the other side of the flip.
|
||||
- ELM_FLIP_CUBE_LEFT - Rotate the currently visible content to the left
|
||||
as if the flip was a cube, the other content is show as the right
|
||||
face of the cube.
|
||||
- ELM_FLIP_CUBE_RIGHT - Rotate the currently visible content to the
|
||||
right as if the flip was a cube, the other content is show as the
|
||||
left face of the cube.
|
||||
- ELM_FLIP_CUBE_UP - Rotate the currently visible content up as if the
|
||||
flip was a cube, the other content is show as the bottom face of
|
||||
the cube.
|
||||
- ELM_FLIP_CUBE_DOWN - Rotate the currently visible content down as if
|
||||
the flip was a cube, the other content is show as the upper face
|
||||
of the cube.
|
||||
- ELM_FLIP_PAGE_LEFT - Move the currently visible content to the
|
||||
left as if the flip was a book, the other content is shown as the
|
||||
page below that.
|
||||
- ELM_FLIP_PAGE_RIGHT - Move the currently visible content to the right
|
||||
as if the flip was a book, the other content is shown as the page
|
||||
below that.
|
||||
- ELM_FLIP_PAGE_UP - Move the currently visible content up as if the
|
||||
flip was a book, the other content is shown as the page below that.
|
||||
- ELM_FLIP_PAGE_DOWN - Move the currently visible content down as if
|
||||
the flip was a book, the other content is shown as the page below
|
||||
that.
|
||||
|
||||
:param mode: The mode type
|
||||
:type mode: Elm_Flip_Mode
|
||||
|
||||
"""
|
||||
elm_flip_go(self.obj, flip_mode)
|
||||
|
||||
property interaction:
|
||||
"""The interactive flip mode
|
||||
|
||||
Whether the flip should be interactive (allow user to click and
|
||||
drag a side of the flip to reveal the back page and cause it to flip).
|
||||
By default a flip is not interactive. You may also need to set which
|
||||
sides of the flip are "active" for flipping and how much space they
|
||||
use (a minimum of a finger size) with
|
||||
:py:func:`interaction_direction_enabled_set()` and
|
||||
:py:func:`interaction_direction_hitsize_set()`
|
||||
|
||||
The four available mode of interaction are:
|
||||
|
||||
- ELM_FLIP_INTERACTION_NONE - No interaction is allowed
|
||||
- ELM_FLIP_INTERACTION_ROTATE - Interaction will cause rotate animation
|
||||
- ELM_FLIP_INTERACTION_CUBE - Interaction will cause cube animation
|
||||
- ELM_FLIP_INTERACTION_PAGE - Interaction will cause page animation
|
||||
|
||||
.. note:: ELM_FLIP_INTERACTION_ROTATE won't cause
|
||||
ELM_FLIP_ROTATE_XZ_CENTER_AXIS or ELM_FLIP_ROTATE_YZ_CENTER_AXIS to
|
||||
happen, those can only be achieved with :py:func:`go()`
|
||||
|
||||
:type: Elm_Flip_Interaction
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_flip_interaction_get(self.obj)
|
||||
|
||||
def __set__(self, mode):
|
||||
elm_flip_interaction_set(self.obj, mode)
|
||||
|
||||
def interaction_set(self, mode):
|
||||
elm_flip_interaction_set(self.obj, mode)
|
||||
def interaction_get(self):
|
||||
return elm_flip_interaction_get(self.obj)
|
||||
|
||||
def interaction_direction_enabled_set(self, direction, enable):
|
||||
"""interaction_direction_enabled_set(int direction, bool enable)
|
||||
|
||||
Set which directions of the flip respond to interactive flip
|
||||
|
||||
By default all directions are disabled, so you may want to enable the
|
||||
desired directions for flipping if you need interactive flipping.
|
||||
You must call this function once for each direction that should be
|
||||
enabled.
|
||||
|
||||
.. seealso:: :py:attr:`interaction`
|
||||
|
||||
:param direction: The direction to change
|
||||
:type direction: Elm_Flip_Direction
|
||||
:param enabled: If that direction is enabled or not
|
||||
:type enabled: bool
|
||||
|
||||
"""
|
||||
elm_flip_interaction_direction_enabled_set(self.obj, direction, enable)
|
||||
|
||||
def interaction_direction_enabled_get(self, direction):
|
||||
"""interaction_direction_enabled_get(int direction) -> bool
|
||||
|
||||
Get the enabled state of that flip direction
|
||||
|
||||
Gets the enabled state set by
|
||||
:py:func:`interaction_direction_enabled_set()`
|
||||
|
||||
.. seealso:: :py:attr:`interaction`
|
||||
|
||||
:param dir: The direction to check
|
||||
:type dir: Elm_Flip_Direction
|
||||
:return: If that direction is enabled or not
|
||||
:rtype: bool
|
||||
|
||||
"""
|
||||
return elm_flip_interaction_direction_enabled_get(self.obj, direction)
|
||||
|
||||
def interaction_direction_hitsize_set(self, direction, hitsize):
|
||||
"""interaction_direction_hitsize_set(int direction, float hitsize)
|
||||
|
||||
Set the amount of the flip that is sensitive to interactive flip
|
||||
|
||||
Set the amount of the flip that is sensitive to interactive flip,
|
||||
with 0 representing no area in the flip and 1 representing the
|
||||
entire flip. There is however a consideration to be made in that the
|
||||
area will never be smaller than the finger size set(as set in your
|
||||
Elementary configuration).
|
||||
|
||||
.. seealso:: :py:attr:`interaction`
|
||||
|
||||
:param dir: The direction to modify
|
||||
:type dir: Elm_Flip_Direction
|
||||
:param hitsize: The amount of that dimension (0.0 to 1.0) to use
|
||||
:type hitsize: float
|
||||
|
||||
"""
|
||||
elm_flip_interaction_direction_hitsize_set(self.obj, direction, hitsize)
|
||||
|
||||
def interaction_direction_hitsize_get(self, direction):
|
||||
"""interaction_direction_hitsize_get(int direction) -> float
|
||||
|
||||
Get the amount of the flip that is sensitive to interactive flip
|
||||
|
||||
Returns the amount of sensitive area set by
|
||||
:py:func:`interaction_direction_hitsize_set()`.
|
||||
|
||||
:param dir: The direction to check
|
||||
:type dir: Elm_Flip_Direction
|
||||
:return: The size set for that direction
|
||||
:rtype: double
|
||||
|
||||
"""
|
||||
return elm_flip_interaction_direction_hitsize_get(self.obj, direction)
|
||||
|
||||
def callback_animate_begin_add(self, func, *args, **kwargs):
|
||||
"""When a flip animation was started."""
|
||||
self._callback_add("animate,begin", func, *args, **kwargs)
|
||||
|
||||
def callback_animate_begin_del(self, func):
|
||||
self._callback_del("animate,begin", func)
|
||||
|
||||
def callback_animate_done_add(self, func, *args, **kwargs):
|
||||
"""When a flip animation is finished."""
|
||||
self._callback_add("animate,done", func, *args, **kwargs)
|
||||
|
||||
def callback_animate_done_del(self, func):
|
||||
self._callback_del("animate,done", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_flip", Flip)
|
|
@ -0,0 +1,22 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object, Evas_Coord, Eina_List, const_Evas_Object, const_Eina_List
|
||||
from efl.evas cimport Evas_Smart_Cb
|
||||
from object_item cimport Elm_Object_Item, const_Elm_Object_Item, ObjectItem
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_flipselector_add(Evas_Object *parent)
|
||||
void elm_flipselector_flip_next(Evas_Object *obj)
|
||||
void elm_flipselector_flip_prev(Evas_Object *obj)
|
||||
Elm_Object_Item *elm_flipselector_item_append(Evas_Object *obj, const_char *label, Evas_Smart_Cb func, void *data)
|
||||
Elm_Object_Item *elm_flipselector_item_prepend(Evas_Object *obj, const_char *label, Evas_Smart_Cb func, void *data)
|
||||
const_Eina_List *elm_flipselector_items_get(const_Evas_Object *obj)
|
||||
Elm_Object_Item *elm_flipselector_first_item_get(const_Evas_Object *obj)
|
||||
Elm_Object_Item *elm_flipselector_last_item_get(const_Evas_Object *obj)
|
||||
Elm_Object_Item *elm_flipselector_selected_item_get(const_Evas_Object *obj)
|
||||
void elm_flipselector_item_selected_set(Elm_Object_Item *it, Eina_Bool selected)
|
||||
Eina_Bool elm_flipselector_item_selected_get(const_Elm_Object_Item *it)
|
||||
Elm_Object_Item *elm_flipselector_item_prev_get(const_Elm_Object_Item *it)
|
||||
Elm_Object_Item *elm_flipselector_item_next_get(const_Elm_Object_Item *it)
|
||||
void elm_flipselector_first_interval_set(Evas_Object *obj, double interval)
|
||||
double elm_flipselector_first_interval_get(const_Evas_Object *obj)
|
||||
|
|
@ -0,0 +1,340 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
include "widget_header.pxi"
|
||||
include "callbacks.pxi"
|
||||
|
||||
from object cimport Object
|
||||
from object_item cimport _object_item_to_python, _object_item_callback, _object_item_list_to_python
|
||||
|
||||
cdef class FlipSelectorItem(ObjectItem):
|
||||
|
||||
"""An item for the :py:class:`FlipSelector` widget."""
|
||||
|
||||
property selected:
|
||||
"""Set whether a given flip selector widget's item should be the
|
||||
currently selected one.
|
||||
|
||||
This sets whether ``item`` is or not the selected (thus, under
|
||||
display) one. If ``item`` is different than the one under display,
|
||||
the latter will be unselected. If the ``item`` is set to be
|
||||
unselected, on the other hand, the B{first} item in the widget's
|
||||
internal members list will be the new selected one.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __set__(self, selected):
|
||||
elm_flipselector_item_selected_set(self.item, selected)
|
||||
|
||||
def __get__(self):
|
||||
return bool(elm_flipselector_item_selected_get(self.item))
|
||||
|
||||
property prev:
|
||||
"""Gets the item before ``item`` in a flip selector widget's internal list of
|
||||
items.
|
||||
|
||||
:type: :py:class:`FlipSelectorItem`
|
||||
|
||||
.. seealso:: :py:func:`item_next_get`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_item_prev_get(self.item))
|
||||
|
||||
property next:
|
||||
"""Gets the item after ``item`` in a flip selector widget's
|
||||
internal list of items.
|
||||
|
||||
:type: :py:class:`FlipSelectorItem`
|
||||
|
||||
.. seealso:: :py:func:`item_prev_get`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_item_next_get(self.item))
|
||||
|
||||
cdef class FlipSelector(Object):
|
||||
|
||||
"""A flip selector is a widget to show a set of *text* items, one
|
||||
at a time, with the same sheet switching style as the :py:class:`Clock`
|
||||
widget, when one changes the current displaying sheet
|
||||
(thus, the "flip" in the name).
|
||||
|
||||
User clicks to flip sheets which are *held* for some time will
|
||||
make the flip selector to flip continuously and automatically for
|
||||
the user. The interval between flips will keep growing in time,
|
||||
so that it helps the user to reach an item which is distant from
|
||||
the current selection.
|
||||
|
||||
This widget inherits from the :py:class:`Layout` one, so that all the
|
||||
functions acting on it also work for flip selector objects.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`Layout`:
|
||||
|
||||
- ``"selected"`` - when the widget's selected text item is changed
|
||||
- ``"overflowed"`` - when the widget's current selection is changed
|
||||
from the first item in its list to the last
|
||||
- ``"underflowed"`` - when the widget's current selection is changed
|
||||
from the last item in its list to the first
|
||||
|
||||
Available styles for it:
|
||||
|
||||
- ``"default"``
|
||||
|
||||
Default text parts of the flipselector items that you can use for are:
|
||||
|
||||
- "default" - label of the flipselector item
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
Object.__init__(self, parent.evas)
|
||||
self._set_obj(elm_flipselector_add(parent.obj))
|
||||
|
||||
def next(self):
|
||||
"""next()
|
||||
|
||||
Programmatically select the next item of a flip selector widget
|
||||
|
||||
.. note:: The selection will be animated. Also, if it reaches the
|
||||
end of its list of member items, it will continue with the first
|
||||
one onwards.
|
||||
|
||||
"""
|
||||
elm_flipselector_flip_next(self.obj)
|
||||
|
||||
def prev(self):
|
||||
"""prev()
|
||||
|
||||
Programmatically select the previous item of a flip selector
|
||||
widget
|
||||
|
||||
.. note:: The selection will be animated. Also, if it reaches the
|
||||
beginning of its list of member items, it will continue with the
|
||||
last one backwards.
|
||||
|
||||
"""
|
||||
elm_flipselector_flip_prev(self.obj)
|
||||
|
||||
def item_append(self, label = None, callback = None, *args, **kwargs):
|
||||
"""item_append(unicode label = None, callback = None, *args, **kwargs) -> FlipSelectorItem
|
||||
|
||||
Append a (text) item to a flip selector widget
|
||||
|
||||
The widget's list of labels to show will be appended with the
|
||||
given value. If the user wishes so, a callback function pointer
|
||||
can be passed, which will get called when this same item is
|
||||
selected.
|
||||
|
||||
.. note:: The current selection *won't* be modified by appending an
|
||||
element to the list.
|
||||
|
||||
.. note:: The maximum length of the text label is going to be
|
||||
determined *by the widget's theme*. Strings larger than
|
||||
that value are going to be *truncated*.
|
||||
|
||||
:param label: The (text) label of the new item
|
||||
:type label: string
|
||||
:param func: Convenience callback function to take place when item
|
||||
is selected
|
||||
:type func: function
|
||||
|
||||
:return: A handle to the item added or ``None``, on errors
|
||||
:rtype: :py:class:`FlipSelectorItem`
|
||||
|
||||
"""
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
cdef FlipSelectorItem ret = FlipSelectorItem()
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
ret.params = (callback, args, kwargs)
|
||||
item = elm_flipselector_item_append(self.obj,
|
||||
_cfruni(label),
|
||||
cb,
|
||||
<void *>self)
|
||||
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return
|
||||
|
||||
def item_prepend(self, label = None, callback = None, *args, **kwargs):
|
||||
"""item_prepend(unicode label = None, callback = None, *args, **kwargs) -> FlipSelectorItem
|
||||
|
||||
Prepend a (text) item to a flip selector widget
|
||||
|
||||
The widget's list of labels to show will be prepended with the
|
||||
given value. If the user wishes so, a callback function pointer
|
||||
can be passed, which will get called when this same item is
|
||||
selected.
|
||||
|
||||
.. note:: The current selection *won't* be modified by prepending
|
||||
an element to the list.
|
||||
|
||||
.. note:: The maximum length of the text label is going to be
|
||||
determined *by the widget's theme*. Strings larger than
|
||||
that value are going to be *truncated*.
|
||||
|
||||
:param label: The (text) label of the new item
|
||||
:type label: string
|
||||
:param func: Convenience callback function to take place when item
|
||||
is selected
|
||||
:type func: function
|
||||
|
||||
:return: A handle to the item added or ``None``, on errors
|
||||
:rtype: :py:class:`FlipSelectorItem`
|
||||
|
||||
"""
|
||||
cdef Elm_Object_Item *item
|
||||
cdef Evas_Smart_Cb cb = NULL
|
||||
cdef FlipSelectorItem ret = FlipSelectorItem()
|
||||
|
||||
if callback is not None:
|
||||
if not callable(callback):
|
||||
raise TypeError("callback is not callable")
|
||||
cb = _object_item_callback
|
||||
|
||||
ret.params = (callback, args, kwargs)
|
||||
item = elm_flipselector_item_append(self.obj,
|
||||
_cfruni(label),
|
||||
cb,
|
||||
<void *>self)
|
||||
|
||||
if item != NULL:
|
||||
ret._set_obj(item)
|
||||
return ret
|
||||
else:
|
||||
return
|
||||
|
||||
property items:
|
||||
"""Get the internal list of items in a given flip selector widget.
|
||||
|
||||
This list is *not* to be modified in any way and must not be
|
||||
freed. Use the list members with functions like
|
||||
elm_object_item_text_set(),
|
||||
elm_object_item_text_get(),
|
||||
elm_object_item_del(),
|
||||
elm_flipselector_item_selected_get(),
|
||||
elm_flipselector_item_selected_set().
|
||||
|
||||
.. warning:: This list is only valid until ``obj`` object's internal
|
||||
items list is changed. It should be fetched again with another
|
||||
call to this function when changes happen.
|
||||
|
||||
:type: tuple of :py:class:`FlipSelectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return tuple(_object_item_list_to_python(elm_flipselector_items_get(self.obj)))
|
||||
|
||||
property first_item:
|
||||
"""Get the first item in the given flip selector widget's list of
|
||||
items.
|
||||
|
||||
.. seealso:: :py:func:`item_append`
|
||||
.. seealso:: :py:attr:`last_item`
|
||||
|
||||
:type: :py:class:`FlipSelectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_first_item_get(self.obj))
|
||||
|
||||
property last_item:
|
||||
"""Get the last item in the given flip selector widget's list of
|
||||
items.
|
||||
|
||||
.. seealso:: :py:func:`item_prepend`
|
||||
.. seealso:: :py:attr:`first_item`
|
||||
|
||||
:type: :py:class:`FlipSelectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_last_item_get(self.obj))
|
||||
|
||||
property selected_item:
|
||||
"""Get the currently selected item in a flip selector widget.
|
||||
|
||||
:type: :py:class:`FlipSelectorItem`
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return _object_item_to_python(elm_flipselector_selected_item_get(self.obj))
|
||||
|
||||
property first_interval:
|
||||
"""The interval on time updates for a user mouse button hold on a
|
||||
flip selector widget.
|
||||
|
||||
This interval value is *decreased* while the user holds the
|
||||
mouse pointer either flipping up or flipping down a given flip
|
||||
selector.
|
||||
|
||||
This helps the user to get to a given item distant from the
|
||||
current one easier/faster, as it will start to flip quicker and
|
||||
quicker on mouse button holds.
|
||||
|
||||
The calculation for the next flip interval value, starting from
|
||||
the one set with this call, is the previous interval divided by
|
||||
1.05, so it decreases a little bit.
|
||||
|
||||
The default starting interval value for automatic flips is
|
||||
*0.85 seconds*.
|
||||
|
||||
:type: float
|
||||
|
||||
"""
|
||||
def __set__(self, interval):
|
||||
elm_flipselector_first_interval_set(self.obj, interval)
|
||||
|
||||
def __get__(self):
|
||||
return elm_flipselector_first_interval_get(self.obj)
|
||||
|
||||
def callback_selected_add(self, func, *args, **kwargs):
|
||||
"""When the widget's selected text item is changed."""
|
||||
self._callback_add("selected", func, *args, **kwargs)
|
||||
|
||||
def callback_selected_del(self, func):
|
||||
self._callback_del("selected", func)
|
||||
|
||||
def callback_overflowed_add(self, func, *args, **kwargs):
|
||||
"""When the widget's current selection is changed from the first
|
||||
item in its list to the last."""
|
||||
self._callback_add("overflowed", func, *args, **kwargs)
|
||||
|
||||
def callback_overflowed_del(self, func):
|
||||
self._callback_del("overflowed", func)
|
||||
|
||||
def callback_underflowed_add(self, func, *args, **kwargs):
|
||||
"""When the widget's current selection is changed from the last item
|
||||
in its list to the first."""
|
||||
self._callback_add("underflowed", func, *args, **kwargs)
|
||||
|
||||
def callback_underflowed_del(self, func):
|
||||
self._callback_del("underflowed", func)
|
||||
|
||||
|
||||
_object_mapping_register("elm_flipselector", FlipSelector)
|
|
@ -0,0 +1,9 @@
|
|||
from efl.evas cimport Eina_Bool, Evas_Object
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
Evas_Object *elm_frame_add(Evas_Object *parent)
|
||||
void elm_frame_autocollapse_set(Evas_Object *obj, Eina_Bool autocollapse)
|
||||
Eina_Bool elm_frame_autocollapse_get(Evas_Object *obj)
|
||||
void elm_frame_collapse_set(Evas_Object *obj, Eina_Bool collapse)
|
||||
Eina_Bool elm_frame_collapse_get(Evas_Object *obj)
|
||||
void elm_frame_collapse_go(Evas_Object *obj, Eina_Bool collapse)
|
|
@ -15,43 +15,102 @@
|
|||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
include "widget_header.pxi"
|
||||
|
||||
from layout_class cimport LayoutClass
|
||||
|
||||
cdef class Frame(LayoutClass):
|
||||
|
||||
"""
|
||||
|
||||
Frame is a widget that holds some content and has a title.
|
||||
|
||||
The default look is a frame with a title, but Frame supports multiple
|
||||
styles:
|
||||
|
||||
- default
|
||||
- pad_small
|
||||
- pad_medium
|
||||
- pad_large
|
||||
- pad_huge
|
||||
- outdent_top
|
||||
- outdent_bottom
|
||||
|
||||
Of all this styles only default shows the title.
|
||||
|
||||
This widget emits the following signals, besides the ones sent from
|
||||
:py:class:`elementary.layout.Layout`:
|
||||
|
||||
- ``"clicked"`` - The user has clicked the frame's label
|
||||
|
||||
Default content parts of the frame widget that you can use for are:
|
||||
|
||||
- "default" - A content of the frame
|
||||
|
||||
Default text parts of the frame widget that you can use for are:
|
||||
|
||||
- "default" - Label of the frame
|
||||
|
||||
"""
|
||||
|
||||
def __init__(self, evasObject parent):
|
||||
self._set_obj(elm_frame_add(parent.obj))
|
||||
|
||||
def autocollapse_set(self, autocollapse):
|
||||
elm_frame_autocollapse_set(self.obj, autocollapse)
|
||||
|
||||
def autocollapse_get(self):
|
||||
return elm_frame_autocollapse_get(self.obj)
|
||||
|
||||
property autocollapse:
|
||||
"""Autocollapsing of a frame
|
||||
|
||||
When this is True, clicking a frame's label will collapse the frame
|
||||
vertically, shrinking it to the height of the label. By default,
|
||||
this is DISABLED.
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_frame_autocollapse_get(self.obj)
|
||||
|
||||
def __set__(self, autocollapse):
|
||||
elm_frame_autocollapse_set(self.obj, autocollapse)
|
||||
|
||||
def collapse_set(self, autocollapse):
|
||||
elm_frame_collapse_set(self.obj, autocollapse)
|
||||
|
||||
def collapse_get(self):
|
||||
return elm_frame_collapse_get(self.obj)
|
||||
def autocollapse_set(self, autocollapse):
|
||||
elm_frame_autocollapse_set(self.obj, autocollapse)
|
||||
def autocollapse_get(self):
|
||||
return elm_frame_autocollapse_get(self.obj)
|
||||
|
||||
property collapse:
|
||||
"""The collapse state of a frame, bypassing animations
|
||||
|
||||
:type: bool
|
||||
|
||||
"""
|
||||
def __get__(self):
|
||||
return elm_frame_collapse_get(self.obj)
|
||||
|
||||
def __set__(self, autocollapse):
|
||||
elm_frame_collapse_set(self.obj, autocollapse)
|
||||
|
||||
def collapse_set(self, autocollapse):
|
||||
elm_frame_collapse_set(self.obj, autocollapse)
|
||||
def collapse_get(self):
|
||||
return elm_frame_collapse_get(self.obj)
|
||||
|
||||
def collapse_go(self, collapse):
|
||||
"""collapse_go(bool collapse)
|
||||
|
||||
Manually collapse a frame with animations
|
||||
|
||||
Use this to toggle the collapsed state of a frame, triggering
|
||||
animations.
|
||||
|
||||
:param collapse: True to collapse, False to expand
|
||||
:type collapse: bool
|
||||
|
||||
"""
|
||||
elm_frame_collapse_go(self.obj, collapse)
|
||||
|
||||
|
||||
def callback_clicked_add(self, func, *args, **kwargs):
|
||||
"""The user has clicked the frame's label."""
|
||||
self._callback_add("clicked", func, *args, **kwargs)
|
||||
|
||||
def callback_clicked_del(self, func):
|
|
@ -0,0 +1,132 @@
|
|||
# Copyright (C) 2007-2013 various contributors (see AUTHORS)
|
||||
#
|
||||
# This file is part of Python-EFL.
|
||||
#
|
||||
# Python-EFL is free software; you can redistribute it and/or
|
||||
# modify it under the terms of the GNU Lesser General Public
|
||||
# License as published by the Free Software Foundation; either
|
||||
# version 2.1 of the License, or (at your option) any later version.
|
||||
#
|
||||
# Python-EFL 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
|
||||
# Lesser General Public License for more details.
|
||||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
from efl.evas cimport Eina_List, Eina_Bool, const_Eina_List
|
||||
from efl.evas cimport Eina_Rectangle, Eina_Compare_Cb
|
||||
from efl.evas cimport Evas_Object, const_Evas_Object
|
||||
from efl.evas cimport Evas_Coord
|
||||
from efl.evas cimport Evas_Callback_Type, Evas_Smart_Cb
|
||||
from efl.evas cimport Evas_Font_Size
|
||||
from efl.evas cimport Evas_Load_Error
|
||||
from efl.evas cimport Evas_Event_Flags
|
||||
from enums cimport Elm_Policy, Elm_Policy_Quit
|
||||
|
||||
cdef extern from *:
|
||||
ctypedef char* const_char_ptr "const char *"
|
||||
ctypedef void const_void "const void"
|
||||
|
||||
cdef extern from "stdlib.h":
|
||||
void free(void *ptr)
|
||||
|
||||
cdef extern from "string.h":
|
||||
void *memcpy(void *dst, void *src, int n)
|
||||
char *strdup(char *str)
|
||||
|
||||
cdef extern from "time.h":
|
||||
struct tm:
|
||||
int tm_sec
|
||||
int tm_min
|
||||
int tm_hour
|
||||
int tm_mday
|
||||
int tm_mon
|
||||
int tm_year
|
||||
int tm_wday
|
||||
int tm_yday
|
||||
int tm_isdst
|
||||
|
||||
long int tm_gmtoff
|
||||
const_char_ptr tm_zone
|
||||
|
||||
cdef extern from "Python.h":
|
||||
ctypedef struct PyTypeObject:
|
||||
PyTypeObject *ob_type
|
||||
|
||||
cdef extern from "Ecore.h":
|
||||
ctypedef void (*Ecore_Cb)(void *data)
|
||||
|
||||
cdef extern from "Edje.h":
|
||||
ctypedef void (*Edje_Signal_Cb)(void *data, Evas_Object *obj, const_char_ptr emission, const_char_ptr source)
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
# types & structs
|
||||
|
||||
#colors
|
||||
ctypedef struct Elm_Color_RGBA:
|
||||
unsigned int r
|
||||
unsigned int g
|
||||
unsigned int b
|
||||
unsigned int a
|
||||
|
||||
ctypedef struct _Elm_Custom_Palette:
|
||||
const_char_ptr palette_name
|
||||
Eina_List *color_list
|
||||
|
||||
#event
|
||||
ctypedef Eina_Bool (*Elm_Event_Cb) (void *data, Evas_Object *obj, Evas_Object *src, Evas_Callback_Type t, void *event_info)
|
||||
|
||||
#font
|
||||
ctypedef struct Elm_Font_Overlay:
|
||||
const_char_ptr text_class
|
||||
const_char_ptr font
|
||||
Evas_Font_Size size
|
||||
|
||||
#text
|
||||
ctypedef struct Elm_Text_Class:
|
||||
const_char_ptr name
|
||||
const_char_ptr desc
|
||||
|
||||
#tooltip
|
||||
ctypedef Evas_Object *(*Elm_Tooltip_Content_Cb) (void *data, Evas_Object *obj, Evas_Object *tooltip)
|
||||
ctypedef Evas_Object *(*Elm_Tooltip_Item_Content_Cb) (void *data, Evas_Object *obj, Evas_Object *tooltip, void *item)
|
||||
|
||||
|
||||
# General
|
||||
void elm_init(int argc, char** argv)
|
||||
void elm_shutdown()
|
||||
void elm_run() nogil
|
||||
void elm_exit()
|
||||
|
||||
# General - Quicklaunch (XXX: Only used by macros?)
|
||||
void elm_quicklaunch_init(int argc, char **argv)
|
||||
void elm_quicklaunch_sub_init(int argc, char **argv)
|
||||
void elm_quicklaunch_sub_shutdown()
|
||||
void elm_quicklaunch_shutdown()
|
||||
void elm_quicklaunch_seed()
|
||||
Eina_Bool elm_quicklaunch_prepare(int argc, char **argv)
|
||||
Eina_Bool elm_quicklaunch_fork(int argc, char **argv, char *cwd, void (*postfork_func) (void *data), void *postfork_data)
|
||||
void elm_quicklaunch_cleanup()
|
||||
int elm_quicklaunch_fallback(int argc, char **argv)
|
||||
char *elm_quicklaunch_exe_path_get(char *exe)
|
||||
|
||||
# General - Policy
|
||||
Eina_Bool elm_policy_set(unsigned int policy, int value)
|
||||
int elm_policy_get(unsigned int policy)
|
||||
|
||||
# General - Language (py3: TODO)
|
||||
void elm_language_set(const_char_ptr lang)
|
||||
|
||||
# Finger
|
||||
void elm_coords_finger_size_adjust(int times_w, Evas_Coord *w, int times_h, Evas_Coord *h)
|
||||
|
||||
#cdef int PY_REFCOUNT(object o)
|
||||
#cdef _METHOD_DEPRECATED(self, replacement=*, message=*)
|
||||
#cdef inline unicode _touni(char* s)
|
||||
#cdef inline unicode _ctouni(const_char_ptr s)
|
||||
#cdef inline char* _fruni(s)
|
||||
#cdef inline const_char_ptr _cfruni(s)
|
|
@ -14,15 +14,38 @@
|
|||
#
|
||||
# You should have received a copy of the GNU Lesser General Public License
|
||||
# along with this Python-EFL. If not, see <http://www.gnu.org/licenses/>.
|
||||
#
|
||||
|
||||
"""
|
||||
|
||||
.. rubric:: Policy types
|
||||
|
||||
.. data:: ELM_POLICY_QUIT
|
||||
|
||||
Under which circumstances the application should quit automatically.
|
||||
|
||||
|
||||
.. rubric:: Quit policy types
|
||||
|
||||
.. data:: ELM_POLICY_QUIT_NONE
|
||||
|
||||
Never quit the application automatically
|
||||
|
||||
.. data:: ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
|
||||
|
||||
Quit when the application's last window is closed
|
||||
|
||||
|
||||
"""
|
||||
|
||||
from cpython cimport PyObject, Py_INCREF, Py_DECREF
|
||||
from cpython cimport PyMem_Malloc, PyMem_Free
|
||||
from cpython cimport bool
|
||||
|
||||
from efl.eo cimport _touni, _fruni, _ctouni, _cfruni, PY_REFCOUNT
|
||||
from efl.eo cimport object_from_instance, _object_mapping_register
|
||||
from efl.eo cimport _strings_to_python, _strings_from_python
|
||||
from efl.eo cimport _object_list_to_python
|
||||
from efl.eo cimport _touni, _fruni, _ctouni, _cfruni
|
||||
#from efl.eo cimport object_from_instance, _object_mapping_register
|
||||
#from efl.eo cimport _strings_to_python, _strings_from_python
|
||||
#from efl.eo cimport _object_list_to_python
|
||||
# from efl.evas cimport Evas_Coord
|
||||
|
||||
|
||||
|
@ -33,6 +56,12 @@ import sys
|
|||
import traceback
|
||||
import logging
|
||||
|
||||
cimport enums
|
||||
|
||||
ELM_POLICY_QUIT = enums.ELM_POLICY_QUIT
|
||||
|
||||
ELM_POLICY_QUIT_NONE = enums.ELM_POLICY_QUIT_NONE
|
||||
ELM_POLICY_QUIT_LAST_WINDOW_CLOSED = enums.ELM_POLICY_QUIT_LAST_WINDOW_CLOSED
|
||||
|
||||
logging.basicConfig(level=logging.DEBUG)
|
||||
log = logging.getLogger("elementary")
|
||||
|
@ -485,6 +514,7 @@ ELM_CURSOR_XTERM = "xterm"
|
|||
|
||||
|
||||
def init():
|
||||
"""Initialize Elementary"""
|
||||
cdef int argc, i, arg_len
|
||||
cdef char **argv, *arg
|
||||
argc = len(sys.argv)
|
||||
|
@ -498,19 +528,46 @@ def init():
|
|||
elm_init(argc, argv)
|
||||
|
||||
def shutdown():
|
||||
"""Shutdown Elementary"""
|
||||
elm_shutdown()
|
||||
|
||||
def run():
|
||||
"""Begin main loop"""
|
||||
with nogil:
|
||||
elm_run()
|
||||
|
||||
def exit():
|
||||
"""Exit main loop"""
|
||||
elm_exit()
|
||||
|
||||
def policy_set(policy, value):
|
||||
"""Set new policy value.
|
||||
|
||||
This will emit the ecore event ELM_EVENT_POLICY_CHANGED in the main
|
||||
loop giving the event information Elm_Event_Policy_Changed with
|
||||
policy identifier, new and old values.
|
||||
|
||||
:param policy: policy identifier as in Elm_Policy.
|
||||
:param value: policy value, depends on identifiers, usually there is
|
||||
an enumeration with the same prefix as the policy name, for
|
||||
example: ELM_POLICY_QUIT and Elm_Policy_Quit
|
||||
(ELM_POLICY_QUIT_NONE, ELM_POLICY_QUIT_LAST_WINDOW_CLOSED).
|
||||
|
||||
:return: True on success or False on error (right
|
||||
now just invalid policy identifier, but in future policy
|
||||
value might be enforced).
|
||||
|
||||
"""
|
||||
return elm_policy_set(policy, value)
|
||||
|
||||
def policy_get(policy):
|
||||
"""Gets the policy value set for given identifier.
|
||||
|
||||
:param policy: policy identifier as in Elm_Policy.
|
||||
|
||||
:return: policy value. Will be 0 if policy identifier is invalid.
|
||||
|
||||
"""
|
||||
return elm_policy_get(policy)
|
||||
|
||||
def coords_finger_size_adjust(times_w, w, times_h, h):
|
||||
|
@ -520,89 +577,3 @@ def coords_finger_size_adjust(times_w, w, times_h, h):
|
|||
height = h
|
||||
elm_coords_finger_size_adjust(times_w, &width, times_h, &height)
|
||||
|
||||
# class ElementaryObjectMeta(type):
|
||||
# def __init__(cls, name, bases, dict_):
|
||||
# type.__init__(cls, name, bases, dict_)
|
||||
# cls._fetch_evt_callbacks()
|
||||
#
|
||||
# def _fetch_evt_callbacks(cls):
|
||||
# if "__evas_event_callbacks__" in cls.__dict__:
|
||||
# return
|
||||
#
|
||||
# cls.__evas_event_callbacks__ = []
|
||||
# append = cls.__evas_event_callbacks__.append
|
||||
#
|
||||
# for name in dir(cls):
|
||||
# val = getattr(cls, name)
|
||||
# if not callable(val) or not hasattr(val, "evas_event_callback"):
|
||||
# continue
|
||||
# evt = getattr(val, "evas_event_callback")
|
||||
# append((name, evt))
|
||||
|
||||
include "efl.elementary_configuration.pxi"
|
||||
include "efl.elementary_need.pxi"
|
||||
include "efl.elementary_theme.pxi"
|
||||
include "efl.elementary_object.pxi"
|
||||
include "efl.elementary_object_item.pxi"
|
||||
include "efl.elementary_gesture_layer.pxi"
|
||||
include "efl.elementary_layout_class.pxi"
|
||||
include "efl.elementary_layout.pxi"
|
||||
include "efl.elementary_image.pxi"
|
||||
include "efl.elementary_button.pxi"
|
||||
include "efl.elementary_window.pxi"
|
||||
include "efl.elementary_innerwindow.pxi"
|
||||
include "efl.elementary_background.pxi"
|
||||
include "efl.elementary_icon.pxi"
|
||||
include "efl.elementary_box.pxi"
|
||||
include "efl.elementary_frame.pxi"
|
||||
include "efl.elementary_flip.pxi"
|
||||
include "efl.elementary_scroller.pxi"
|
||||
include "efl.elementary_label.pxi"
|
||||
include "efl.elementary_table.pxi"
|
||||
include "efl.elementary_clock.pxi"
|
||||
include "efl.elementary_hover.pxi"
|
||||
include "efl.elementary_entry.pxi"
|
||||
include "efl.elementary_bubble.pxi"
|
||||
include "efl.elementary_photo.pxi"
|
||||
include "efl.elementary_hoversel.pxi"
|
||||
include "efl.elementary_toolbar.pxi"
|
||||
include "efl.elementary_list.pxi"
|
||||
include "efl.elementary_slider.pxi"
|
||||
include "efl.elementary_naviframe.pxi"
|
||||
include "efl.elementary_radio.pxi"
|
||||
include "efl.elementary_check.pxi"
|
||||
include "efl.elementary_genlist.pxi"
|
||||
include "efl.elementary_gengrid.pxi"
|
||||
include "efl.elementary_spinner.pxi"
|
||||
include "efl.elementary_notify.pxi"
|
||||
include "efl.elementary_fileselector.pxi"
|
||||
include "efl.elementary_fileselector_entry.pxi"
|
||||
include "efl.elementary_fileselector_button.pxi"
|
||||
include "efl.elementary_separator.pxi"
|
||||
include "efl.elementary_progressbar.pxi"
|
||||
include "efl.elementary_menu.pxi"
|
||||
include "efl.elementary_panel.pxi"
|
||||
include "efl.elementary_web.pxi"
|
||||
include "efl.elementary_actionslider.pxi"
|
||||
include "efl.elementary_calendar.pxi"
|
||||
include "efl.elementary_colorselector.pxi"
|
||||
include "efl.elementary_index.pxi"
|
||||
include "efl.elementary_ctxpopup.pxi"
|
||||
include "efl.elementary_grid.pxi"
|
||||
include "efl.elementary_video.pxi"
|
||||
include "efl.elementary_conformant.pxi"
|
||||
include "efl.elementary_dayselector.pxi"
|
||||
include "efl.elementary_panes.pxi"
|
||||
include "efl.elementary_thumb.pxi"
|
||||
include "efl.elementary_diskselector.pxi"
|
||||
include "efl.elementary_datetime.pxi"
|
||||
include "efl.elementary_map.pxi"
|
||||
include "efl.elementary_mapbuf.pxi"
|
||||
include "efl.elementary_multibuttonentry.pxi"
|
||||
include "efl.elementary_transit.pxi"
|
||||
include "efl.elementary_slideshow.pxi"
|
||||
include "efl.elementary_segment_control.pxi"
|
||||
include "efl.elementary_popup.pxi"
|
||||
include "efl.elementary_plug.pxi"
|
||||
include "efl.elementary_photocam.pxi"
|
||||
include "efl.elementary_flipselector.pxi"
|
|
@ -0,0 +1,97 @@
|
|||
from efl.evas cimport Eina_Bool, Eina_List, Evas_Object, Evas_Smart_Cb, Evas_Coord
|
||||
from object_item cimport Elm_Object_Item
|
||||
from general cimport Elm_Tooltip_Item_Content_Cb
|
||||
from enums cimport Elm_Genlist_Item_Scrollto_Type, Elm_Scroller_Policy, \
|
||||
Elm_Object_Select_Mode
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
#gengrid
|
||||
ctypedef char *(*GengridItemLabelGetFunc) (void *data, Evas_Object *obj, const_char *part)
|
||||
ctypedef Evas_Object *(*GengridItemIconGetFunc) (void *data, Evas_Object *obj, const_char *part)
|
||||
ctypedef Eina_Bool (*GengridItemStateGetFunc) (void *data, Evas_Object *obj, const_char *part)
|
||||
ctypedef void (*GengridItemDelFunc) (void *data, Evas_Object *obj)
|
||||
|
||||
ctypedef struct Elm_Gengrid_Item_Class_Func:
|
||||
GengridItemLabelGetFunc text_get
|
||||
GengridItemIconGetFunc content_get
|
||||
GengridItemStateGetFunc state_get
|
||||
GengridItemDelFunc del_ "del"
|
||||
|
||||
ctypedef struct Elm_Gengrid_Item_Class:
|
||||
char *item_style
|
||||
Elm_Gengrid_Item_Class_Func func
|
||||
|
||||
# Generic Grid (api:TODO cb:TODO test:DONE doc:TODO py3:TODO)
|
||||
Evas_Object * elm_gengrid_add(Evas_Object *parent)
|
||||
void elm_gengrid_clear(Evas_Object *obj)
|
||||
void elm_gengrid_multi_select_set(Evas_Object *obj, Eina_Bool multi)
|
||||
Eina_Bool elm_gengrid_multi_select_get(Evas_Object *obj)
|
||||
void elm_gengrid_horizontal_set(Evas_Object *obj, Eina_Bool setting)
|
||||
Eina_Bool elm_gengrid_horizontal_get(Evas_Object *obj)
|
||||
void elm_gengrid_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
|
||||
void elm_gengrid_bounce_get(Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
|
||||
Elm_Object_Item * elm_gengrid_item_append(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, void *data, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_gengrid_item_prepend(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, void *data, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_gengrid_item_insert_before(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, void *data, Elm_Object_Item *before, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_gengrid_item_insert_after(Evas_Object *obj, Elm_Gengrid_Item_Class *itc, void *data, Elm_Object_Item *after, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_gengrid_selected_item_get(Evas_Object *obj)
|
||||
Eina_List * elm_gengrid_selected_items_get(Evas_Object *obj)
|
||||
Eina_List * elm_gengrid_realized_items_get(Evas_Object *obj)
|
||||
void elm_gengrid_realized_items_update(Evas_Object *obj)
|
||||
Elm_Object_Item * elm_gengrid_first_item_get(Evas_Object *obj)
|
||||
Elm_Object_Item * elm_gengrid_last_item_get(Evas_Object *obj)
|
||||
void elm_gengrid_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
|
||||
void elm_gengrid_scroller_policy_get(Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
|
||||
unsigned int elm_gengrid_items_count(Evas_Object *obj)
|
||||
void elm_gengrid_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||
void elm_gengrid_item_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
||||
void elm_gengrid_group_item_size_set(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
|
||||
void elm_gengrid_group_item_size_get(Evas_Object *obj, Evas_Coord *w, Evas_Coord *h)
|
||||
void elm_gengrid_align_set(Evas_Object *obj, double align_x, double align_y)
|
||||
void elm_gengrid_align_get(Evas_Object *obj, double *align_x, double *align_y)
|
||||
void elm_gengrid_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode)
|
||||
Eina_Bool elm_gengrid_reorder_mode_get(Evas_Object *obj)
|
||||
void elm_gengrid_page_relative_set(Evas_Object *obj, double h_pagerel, double v_pagerel)
|
||||
void elm_gengrid_page_relative_get(Evas_Object *obj, double *h_pagerel, double *v_pagerel)
|
||||
void elm_gengrid_page_size_set(Evas_Object *obj, Evas_Coord h_pagesize, Evas_Coord v_pagesize)
|
||||
void elm_gengrid_current_page_get(Evas_Object *obj, int *h_pagenum, int *v_pagenum)
|
||||
void elm_gengrid_last_page_get(Evas_Object *obj, int *h_pagenum, int *v_pagenum)
|
||||
void elm_gengrid_page_show(Evas_Object *obj, int h_pagenum, int v_pagenum)
|
||||
void elm_gengrid_page_bring_in(Evas_Object *obj, int h_pagenum, int v_pagenum)
|
||||
void elm_gengrid_filled_set(Evas_Object *obj, Eina_Bool fill)
|
||||
Eina_Bool elm_gengrid_filled_get(Evas_Object *obj)
|
||||
void elm_gengrid_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode)
|
||||
Elm_Object_Select_Mode elm_gengrid_select_mode_get(Evas_Object *obj)
|
||||
void elm_gengrid_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight)
|
||||
Eina_Bool elm_gengrid_highlight_mode_get(Evas_Object *obj)
|
||||
|
||||
Elm_Object_Item * elm_gengrid_first_item_get(Evas_Object *obj)
|
||||
Elm_Object_Item * elm_gengrid_last_item_get(Evas_Object *obj)
|
||||
int elm_gengrid_item_index_get(Elm_Object_Item *it)
|
||||
void elm_gengrid_item_select_mode_set(Elm_Object_Item *it, Elm_Object_Select_Mode mode)
|
||||
Elm_Object_Select_Mode elm_gengrid_item_select_mode_get(Elm_Object_Item *it)
|
||||
Elm_Object_Item * elm_gengrid_item_next_get(Elm_Object_Item *item)
|
||||
Elm_Object_Item * elm_gengrid_item_prev_get(Elm_Object_Item *item)
|
||||
void elm_gengrid_item_selected_set(Elm_Object_Item *item, Eina_Bool selected)
|
||||
Eina_Bool elm_gengrid_item_selected_get(Elm_Object_Item *item)
|
||||
void elm_gengrid_item_show(Elm_Object_Item *item, Elm_Genlist_Item_Scrollto_Type scrollto_type)
|
||||
void elm_gengrid_item_bring_in(Elm_Object_Item *item, Elm_Genlist_Item_Scrollto_Type scrollto_type)
|
||||
Evas_Object * elm_gengrid_item_object_get(Elm_Object_Item *it)
|
||||
void elm_gengrid_item_update(Elm_Object_Item *item)
|
||||
void elm_gengrid_item_pos_get(Elm_Object_Item *item, unsigned int *x, unsigned int *y)
|
||||
void elm_gengrid_item_tooltip_text_set(Elm_Object_Item *item, const_char *text)
|
||||
void elm_gengrid_item_tooltip_content_cb_set(Elm_Object_Item *item, Elm_Tooltip_Item_Content_Cb func, void *data, Evas_Smart_Cb del_cb)
|
||||
void elm_gengrid_item_tooltip_unset(Elm_Object_Item *item)
|
||||
void elm_gengrid_item_tooltip_style_set(Elm_Object_Item *item, const_char *style)
|
||||
const_char * elm_gengrid_item_tooltip_style_get(Elm_Object_Item *item)
|
||||
Eina_Bool elm_gengrid_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable)
|
||||
Eina_Bool elm_gengrid_item_tooltip_window_mode_get(Elm_Object_Item *it)
|
||||
void elm_gengrid_item_cursor_set(Elm_Object_Item *item, const_char *cursor)
|
||||
const_char * elm_gengrid_item_cursor_get(Elm_Object_Item *item)
|
||||
void elm_gengrid_item_cursor_unset(Elm_Object_Item *item)
|
||||
void elm_gengrid_item_cursor_style_set(Elm_Object_Item *item, const_char *style)
|
||||
const_char * elm_gengrid_item_cursor_style_get(Elm_Object_Item *item)
|
||||
void elm_gengrid_item_cursor_engine_only_set(Elm_Object_Item *item, Eina_Bool engine_only)
|
||||
Eina_Bool elm_gengrid_item_cursor_engine_only_get(Elm_Object_Item *item)
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,110 @@
|
|||
from efl.evas cimport Eina_Bool, Eina_List, Eina_Compare_Cb, Evas_Object, Evas_Smart_Cb, Evas_Coord
|
||||
from object cimport Object
|
||||
from object_item cimport Elm_Object_Item
|
||||
from general cimport Elm_Tooltip_Item_Content_Cb
|
||||
from enums cimport Elm_Scroller_Policy, Elm_List_Mode, Elm_Object_Select_Mode, \
|
||||
Elm_Genlist_Item_Type, Elm_Genlist_Item_Scrollto_Type, \
|
||||
Elm_Genlist_Item_Field_Type
|
||||
from libc.string cimport const_char
|
||||
|
||||
cdef extern from "Elementary.h":
|
||||
|
||||
#genlist
|
||||
ctypedef char *(*GenlistItemLabelGetFunc) (void *data, Evas_Object *obj, const_char *part)
|
||||
ctypedef Evas_Object *(*GenlistItemIconGetFunc) (void *data, Evas_Object *obj, const_char *part)
|
||||
ctypedef Eina_Bool (*GenlistItemStateGetFunc) (void *data, Evas_Object *obj, const_char *part)
|
||||
ctypedef void (*GenlistItemDelFunc) (void *data, Evas_Object *obj)
|
||||
|
||||
ctypedef struct Elm_Genlist_Item_Class_Func:
|
||||
GenlistItemLabelGetFunc text_get
|
||||
GenlistItemIconGetFunc content_get
|
||||
GenlistItemStateGetFunc state_get
|
||||
GenlistItemDelFunc del_ "del"
|
||||
|
||||
ctypedef struct Elm_Genlist_Item_Class:
|
||||
char *item_style
|
||||
Elm_Genlist_Item_Class_Func func
|
||||
|
||||
# Generic List (api:TODO cb:DONE test:DONE doc:TODO py3:TODO)
|
||||
Evas_Object * elm_genlist_add(Evas_Object *parent)
|
||||
void elm_genlist_clear(Evas_Object *obj)
|
||||
void elm_genlist_multi_select_set(Evas_Object *obj, Eina_Bool multi)
|
||||
Eina_Bool elm_genlist_multi_select_get(Evas_Object *obj)
|
||||
void elm_genlist_mode_set(Evas_Object *obj, Elm_List_Mode mode)
|
||||
Elm_List_Mode elm_genlist_mode_get(Evas_Object *obj)
|
||||
void elm_genlist_bounce_set(Evas_Object *obj, Eina_Bool h_bounce, Eina_Bool v_bounce)
|
||||
void elm_genlist_bounce_get(Evas_Object *obj, Eina_Bool *h_bounce, Eina_Bool *v_bounce)
|
||||
Elm_Object_Item * elm_genlist_item_append(Evas_Object *obj, Elm_Genlist_Item_Class *itc, void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type flags, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_genlist_item_prepend(Evas_Object *obj, Elm_Genlist_Item_Class *itc, void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type flags, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_genlist_item_insert_before(Evas_Object *obj, Elm_Genlist_Item_Class *itc, void *data, Elm_Object_Item *parent, Elm_Object_Item *before, Elm_Genlist_Item_Type flags, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_genlist_item_insert_after(Evas_Object *obj, Elm_Genlist_Item_Class *itc, void *data, Elm_Object_Item *parent, Elm_Object_Item *after, Elm_Genlist_Item_Type flags, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_genlist_item_sorted_insert(Evas_Object *obj, Elm_Genlist_Item_Class *itc, void *data, Elm_Object_Item *parent, Elm_Genlist_Item_Type flags, Eina_Compare_Cb comp, Evas_Smart_Cb func, void *func_data)
|
||||
Elm_Object_Item * elm_genlist_selected_item_get(Evas_Object *obj)
|
||||
Eina_List * elm_genlist_selected_items_get(Evas_Object *obj)
|
||||
Eina_List * elm_genlist_realized_items_get(Evas_Object *obj)
|
||||
Elm_Object_Item * elm_genlist_first_item_get(Evas_Object *obj)
|
||||
Elm_Object_Item * elm_genlist_last_item_get(Evas_Object *obj)
|
||||
void elm_genlist_scroller_policy_set(Evas_Object *obj, Elm_Scroller_Policy policy_h, Elm_Scroller_Policy policy_v)
|
||||
void elm_genlist_scroller_policy_get(Evas_Object *obj, Elm_Scroller_Policy *policy_h, Elm_Scroller_Policy *policy_v)
|
||||
|
||||
Elm_Object_Item * elm_genlist_item_next_get(Elm_Object_Item *item)
|
||||
Elm_Object_Item * elm_genlist_item_prev_get(Elm_Object_Item *item)
|
||||
void elm_genlist_item_selected_set(Elm_Object_Item *item, Eina_Bool selected)
|
||||
Eina_Bool elm_genlist_item_selected_get(Elm_Object_Item *item)
|
||||
void elm_genlist_item_show(Elm_Object_Item *item, Elm_Genlist_Item_Scrollto_Type scrollto_type)
|
||||
void elm_genlist_item_bring_in(Elm_Object_Item *item, Elm_Genlist_Item_Scrollto_Type scrollto_type)
|
||||
void elm_genlist_item_update(Elm_Object_Item *item)
|
||||
void elm_genlist_item_item_class_update(Elm_Object_Item *it, Elm_Genlist_Item_Class *itc)
|
||||
Elm_Genlist_Item_Class *elm_genlist_item_item_class_get(Elm_Object_Item *it)
|
||||
int elm_genlist_item_index_get(Elm_Object_Item *it)
|
||||
void elm_genlist_realized_items_update(Evas_Object *obj)
|
||||
unsigned int elm_genlist_items_count(Evas_Object *obj)
|
||||
void elm_genlist_item_tooltip_text_set(Elm_Object_Item *item, const_char *text)
|
||||
void elm_genlist_item_tooltip_content_cb_set(Elm_Object_Item *item, Elm_Tooltip_Item_Content_Cb func, void *data, Evas_Smart_Cb del_cb)
|
||||
void elm_genlist_item_tooltip_unset(Elm_Object_Item *item)
|
||||
void elm_genlist_item_tooltip_style_set(Elm_Object_Item *item, const_char *style)
|
||||
const_char * elm_genlist_item_tooltip_style_get(Elm_Object_Item *item)
|
||||
Eina_Bool elm_genlist_item_tooltip_window_mode_set(Elm_Object_Item *it, Eina_Bool disable)
|
||||
Eina_Bool elm_genlist_item_tooltip_window_mode_get(Elm_Object_Item *it)
|
||||
void elm_genlist_item_cursor_set(Elm_Object_Item *item, const_char *cursor)
|
||||
const_char * elm_genlist_item_cursor_get(Elm_Object_Item *it)
|
||||
void elm_genlist_item_cursor_unset(Elm_Object_Item *item)
|
||||
void elm_genlist_item_cursor_style_set(Elm_Object_Item *item, const_char *style)
|
||||
const_char * elm_genlist_item_cursor_style_get(Elm_Object_Item *item)
|
||||
void elm_genlist_item_cursor_engine_only_set(Elm_Object_Item *item, Eina_Bool engine_only)
|
||||
Eina_Bool elm_genlist_item_cursor_engine_only_get(Elm_Object_Item *item)
|
||||
void elm_genlist_homogeneous_set(Evas_Object *obj, Eina_Bool homogeneous)
|
||||
Eina_Bool elm_genlist_homogeneous_get(Evas_Object *obj)
|
||||
void elm_genlist_block_count_set(Evas_Object *obj, int n)
|
||||
int elm_genlist_block_count_get(Evas_Object *obj)
|
||||
void elm_genlist_longpress_timeout_set(Evas_Object *obj, double timeout)
|
||||
double elm_genlist_longpress_timeout_get(Evas_Object *obj)
|
||||
Elm_Object_Item * elm_genlist_at_xy_item_get(Evas_Object *obj, Evas_Coord x, Evas_Coord y, int *posret)
|
||||
Elm_Object_Item * elm_genlist_item_parent_get(Elm_Object_Item *it)
|
||||
void elm_genlist_item_subitems_clear(Elm_Object_Item *item)
|
||||
void elm_genlist_item_expanded_set(Elm_Object_Item *item, Eina_Bool expanded)
|
||||
Eina_Bool elm_genlist_item_expanded_get(Elm_Object_Item *item)
|
||||
int elm_genlist_item_expanded_depth_get(Elm_Object_Item *it)
|
||||
void elm_genlist_item_all_contents_unset(Elm_Object_Item *it, Eina_List **l)
|
||||
void elm_genlist_item_promote(Elm_Object_Item *it)
|
||||
void elm_genlist_item_demote(Elm_Object_Item *it)
|
||||
void elm_genlist_item_fields_update(Elm_Object_Item *item, const_char *parts, Elm_Genlist_Item_Field_Type itf)
|
||||
void elm_genlist_item_decorate_mode_set(Elm_Object_Item *it, const_char *decorate_it_type, Eina_Bool decorate_it_set)
|
||||
const_char * elm_genlist_item_decorate_mode_get(Elm_Object_Item *it)
|
||||
Elm_Object_Item * elm_genlist_decorated_item_get(Evas_Object *obj)
|
||||
void elm_genlist_reorder_mode_set(Evas_Object *obj, Eina_Bool reorder_mode)
|
||||
Eina_Bool elm_genlist_reorder_mode_get(Evas_Object *obj)
|
||||
Elm_Genlist_Item_Type elm_genlist_item_type_get(Elm_Object_Item *it)
|
||||
void elm_genlist_decorate_mode_set(Evas_Object *obj, Eina_Bool decorated)
|
||||
Eina_Bool elm_genlist_decorate_mode_get(Evas_Object *obj)
|
||||
void elm_genlist_item_flip_set(Elm_Object_Item *it, Eina_Bool flip)
|
||||
Eina_Bool elm_genlist_item_flip_get(Elm_Object_Item *it)
|
||||
void elm_genlist_tree_effect_enabled_set(Evas_Object *obj, Eina_Bool enabled)
|
||||
Eina_Bool elm_genlist_tree_effect_enabled_get(Evas_Object *obj)
|
||||
void elm_genlist_item_select_mode_set(Elm_Object_Item *it, Elm_Object_Select_Mode mode)
|
||||
Elm_Object_Select_Mode elm_genlist_item_select_mode_get(Elm_Object_Item *it)
|
||||
void elm_genlist_highlight_mode_set(Evas_Object *obj, Eina_Bool highlight)
|
||||
Eina_Bool elm_genlist_highlight_mode_get(Evas_Object *obj)
|
||||
void elm_genlist_select_mode_set(Evas_Object *obj, Elm_Object_Select_Mode mode)
|
||||
Elm_Object_Select_Mode elm_genlist_select_mode_get(Evas_Object *obj)
|
||||
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue