forked from enlightenment/efl
parent
5209a42671
commit
6a7494bba7
|
@ -1,4 +1,6 @@
|
|||
|
||||
SUBDIRS = data compare
|
||||
|
||||
MAINTAINERCLEANFILES = Makefile.in
|
||||
|
||||
INCLUDES = \
|
||||
|
|
|
@ -5,268 +5,268 @@
|
|||
#define THEME "Tango"
|
||||
#define SIZE "16x16"
|
||||
|
||||
#define ADDRESS_BOOK_NEW "address-book-new"
|
||||
#define APPLICATION_EXIT "application-exit"
|
||||
#define APPOINTMENT_NEW "appointment-new"
|
||||
#define CONTACT_NEW "contact-new"
|
||||
#define DIALOG_APPLY "dialog-apply"
|
||||
#define DIALOG_CANCEL "dialog-cancel"
|
||||
#define DIALOG_CLOSE "dialog-close"
|
||||
#define DIALOG_OK "dialog-ok"
|
||||
#define DOCUMENT_NEW "document-new"
|
||||
#define DOCUMENT_OPEN "document-open"
|
||||
#define DOCUMENT_OPEN_RECENT "document-open-recent"
|
||||
#define DOCUMENT_PAGE_SETUP "document-page-setup"
|
||||
#define DOCUMENT_PRINT "document-print"
|
||||
#define DOCUMENT_PRINT_PREVIEW "document-print-preview"
|
||||
#define DOCUMENT_PROPERTIES "document-properties"
|
||||
#define DOCUMENT_REVERT "document-revert"
|
||||
#define DOCUMENT_SAVE "document-save"
|
||||
#define DOCUMENT_SAVE_AS "document-save-as"
|
||||
#define EDIT_COPY "edit-copy"
|
||||
#define EDIT_CUT "edit-cut"
|
||||
#define EDIT_DELETE "edit-delete"
|
||||
#define EDIT_FIND "edit-find"
|
||||
#define EDIT_FIND_REPLACE "edit-find-replace"
|
||||
#define EDIT_PASTE "edit-paste"
|
||||
#define EDIT_REDO "edit-redo"
|
||||
#define EDIT_SELECT_ALL "edit-select-all"
|
||||
#define EDIT_UNDO "edit-undo"
|
||||
#define FORMAT_INDENT_LESS "format-indent-less"
|
||||
#define FORMAT_INDENT_MORE "format-indent-more"
|
||||
#define FORMAT_JUSTIFY_CENTER "format-justify-center"
|
||||
#define FORMAT_JUSTIFY_FILL "format-justify-fill"
|
||||
#define FORMAT_JUSTIFY_LEFT "format-justify-left"
|
||||
#define FORMAT_JUSTIFY_RIGHT "format-justify-right"
|
||||
#define FORMAT_TEXT_DIRECTION_LTR "format-text-direction-ltr"
|
||||
#define FORMAT_TEXT_DIRECTION_RTL "format-text-direction-rtl"
|
||||
#define FORMAT_TEXT_BOLD "format-text-bold"
|
||||
#define FORMAT_TEXT_ITALIC "format-text-italic"
|
||||
#define FORMAT_TEXT_UNDERLINE "format-text-underline"
|
||||
#define FORMAT_TEXT_STRIKETHROUGH "format-text-strikethrough"
|
||||
#define GO_BOTTOM "go-bottom"
|
||||
#define GO_DOWN "go-down"
|
||||
#define GO_FIRST "go-first"
|
||||
#define GO_HOME "go-home"
|
||||
#define GO_JUMP "go-jump"
|
||||
#define GO_LAST "go-last"
|
||||
#define GO_NEXT "go-next"
|
||||
#define GO_PREVIOUS "go-previous"
|
||||
#define GO_TOP "go-top"
|
||||
#define GO_UP "go-up"
|
||||
#define HELP_ABOUT "help-about"
|
||||
#define HELP_CONTENTS "help-contents"
|
||||
#define HELP_FAQ "help-faq"
|
||||
#define INSERT_IMAGE "insert-image"
|
||||
#define INSERT_LINK "insert-link"
|
||||
#define INSERT_OBJECT "insert-object"
|
||||
#define INSERT_TEXT "insert-text"
|
||||
#define LIST_ADD "list-add"
|
||||
#define LIST_REMOVE "list-remove"
|
||||
#define MAIL_FORWARD "mail-forward"
|
||||
#define MAIL_MARK_IMPORTANT "mail-mark-important"
|
||||
#define MAIL_MARK_JUNK "mail-mark-junk"
|
||||
#define MAIL_MARK_NOTJUNK "mail-mark-notjunk"
|
||||
#define MAIL_MARK_READ "mail-mark-read"
|
||||
#define MAIL_MARK_UNREAD "mail-mark-unread"
|
||||
#define MAIL_MESSAGE_NEW "mail-message-new"
|
||||
#define MAIL_REPLY_ALL "mail-reply-all"
|
||||
#define MAIL_REPLY_SENDER "mail-reply-sender"
|
||||
#define MAIL_SEND_RECEIVE "mail-send-receive"
|
||||
#define MEDIA_EJECT "media-eject"
|
||||
#define MEDIA_PLAYBACK_PAUSE "media-playback-pause"
|
||||
#define MEDIA_PLAYBACK_START "media-playback-start"
|
||||
#define MEDIA_PLAYBACK_STOP "media-playback-stop"
|
||||
#define MEDIA_RECORD "media-record"
|
||||
#define MEDIA_SEEK_BACKWARD "media-seek-backward"
|
||||
#define MEDIA_SEEK_FORWARD "media-seek-forward"
|
||||
#define MEDIA_SKIP_BACKWARD "media-skip-backward"
|
||||
#define MEDIA_SKIP_FORWARD "media-skip-forward"
|
||||
#define SYSTEM_LOCK_SCREEN "system-lock-screen"
|
||||
#define SYSTEM_LOG_OUT "system-log-out"
|
||||
#define SYSTEM_RUN "system-run"
|
||||
#define SYSTEM_SEARCH "system-search"
|
||||
#define TOOLS_CHECK_SPELLING "tools-check-spelling"
|
||||
#define VIEW_FULLSCREEN "view-fullscreen"
|
||||
#define VIEW_REFRESH "view-refresh"
|
||||
#define VIEW_SORT_ASCENDING "view-sort-ascending"
|
||||
#define VIEW_SORT_DESCENDING "view-sort-descending"
|
||||
#define WINDOW_CLOSE "window-close"
|
||||
#define WINDOW_NEW "window-new"
|
||||
#define ZOOM_BEST_FIT "zoom-best-fit"
|
||||
#define ZOOM_IN "zoom-in"
|
||||
#define ZOOM_ORIGINAL "zoom-original"
|
||||
#define ZOOM_OUT "zoom-out"
|
||||
#define ADDRESS_BOOK_NEW "address-book-new"
|
||||
#define APPLICATION_EXIT "application-exit"
|
||||
#define APPOINTMENT_NEW "appointment-new"
|
||||
#define CONTACT_NEW "contact-new"
|
||||
#define DIALOG_APPLY "dialog-apply"
|
||||
#define DIALOG_CANCEL "dialog-cancel"
|
||||
#define DIALOG_CLOSE "dialog-close"
|
||||
#define DIALOG_OK "dialog-ok"
|
||||
#define DOCUMENT_NEW "document-new"
|
||||
#define DOCUMENT_OPEN "document-open"
|
||||
#define DOCUMENT_OPEN_RECENT "document-open-recent"
|
||||
#define DOCUMENT_PAGE_SETUP "document-page-setup"
|
||||
#define DOCUMENT_PRINT "document-print"
|
||||
#define DOCUMENT_PRINT_PREVIEW "document-print-preview"
|
||||
#define DOCUMENT_PROPERTIES "document-properties"
|
||||
#define DOCUMENT_REVERT "document-revert"
|
||||
#define DOCUMENT_SAVE "document-save"
|
||||
#define DOCUMENT_SAVE_AS "document-save-as"
|
||||
#define EDIT_COPY "edit-copy"
|
||||
#define EDIT_CUT "edit-cut"
|
||||
#define EDIT_DELETE "edit-delete"
|
||||
#define EDIT_FIND "edit-find"
|
||||
#define EDIT_FIND_REPLACE "edit-find-replace"
|
||||
#define EDIT_PASTE "edit-paste"
|
||||
#define EDIT_REDO "edit-redo"
|
||||
#define EDIT_SELECT_ALL "edit-select-all"
|
||||
#define EDIT_UNDO "edit-undo"
|
||||
#define FORMAT_INDENT_LESS "format-indent-less"
|
||||
#define FORMAT_INDENT_MORE "format-indent-more"
|
||||
#define FORMAT_JUSTIFY_CENTER "format-justify-center"
|
||||
#define FORMAT_JUSTIFY_FILL "format-justify-fill"
|
||||
#define FORMAT_JUSTIFY_LEFT "format-justify-left"
|
||||
#define FORMAT_JUSTIFY_RIGHT "format-justify-right"
|
||||
#define FORMAT_TEXT_DIRECTION_LTR "format-text-direction-ltr"
|
||||
#define FORMAT_TEXT_DIRECTION_RTL "format-text-direction-rtl"
|
||||
#define FORMAT_TEXT_BOLD "format-text-bold"
|
||||
#define FORMAT_TEXT_ITALIC "format-text-italic"
|
||||
#define FORMAT_TEXT_UNDERLINE "format-text-underline"
|
||||
#define FORMAT_TEXT_STRIKETHROUGH "format-text-strikethrough"
|
||||
#define GO_BOTTOM "go-bottom"
|
||||
#define GO_DOWN "go-down"
|
||||
#define GO_FIRST "go-first"
|
||||
#define GO_HOME "go-home"
|
||||
#define GO_JUMP "go-jump"
|
||||
#define GO_LAST "go-last"
|
||||
#define GO_NEXT "go-next"
|
||||
#define GO_PREVIOUS "go-previous"
|
||||
#define GO_TOP "go-top"
|
||||
#define GO_UP "go-up"
|
||||
#define HELP_ABOUT "help-about"
|
||||
#define HELP_CONTENTS "help-contents"
|
||||
#define HELP_FAQ "help-faq"
|
||||
#define INSERT_IMAGE "insert-image"
|
||||
#define INSERT_LINK "insert-link"
|
||||
#define INSERT_OBJECT "insert-object"
|
||||
#define INSERT_TEXT "insert-text"
|
||||
#define LIST_ADD "list-add"
|
||||
#define LIST_REMOVE "list-remove"
|
||||
#define MAIL_FORWARD "mail-forward"
|
||||
#define MAIL_MARK_IMPORTANT "mail-mark-important"
|
||||
#define MAIL_MARK_JUNK "mail-mark-junk"
|
||||
#define MAIL_MARK_NOTJUNK "mail-mark-notjunk"
|
||||
#define MAIL_MARK_READ "mail-mark-read"
|
||||
#define MAIL_MARK_UNREAD "mail-mark-unread"
|
||||
#define MAIL_MESSAGE_NEW "mail-message-new"
|
||||
#define MAIL_REPLY_ALL "mail-reply-all"
|
||||
#define MAIL_REPLY_SENDER "mail-reply-sender"
|
||||
#define MAIL_SEND_RECEIVE "mail-send-receive"
|
||||
#define MEDIA_EJECT "media-eject"
|
||||
#define MEDIA_PLAYBACK_PAUSE "media-playback-pause"
|
||||
#define MEDIA_PLAYBACK_START "media-playback-start"
|
||||
#define MEDIA_PLAYBACK_STOP "media-playback-stop"
|
||||
#define MEDIA_RECORD "media-record"
|
||||
#define MEDIA_SEEK_BACKWARD "media-seek-backward"
|
||||
#define MEDIA_SEEK_FORWARD "media-seek-forward"
|
||||
#define MEDIA_SKIP_BACKWARD "media-skip-backward"
|
||||
#define MEDIA_SKIP_FORWARD "media-skip-forward"
|
||||
#define SYSTEM_LOCK_SCREEN "system-lock-screen"
|
||||
#define SYSTEM_LOG_OUT "system-log-out"
|
||||
#define SYSTEM_RUN "system-run"
|
||||
#define SYSTEM_SEARCH "system-search"
|
||||
#define TOOLS_CHECK_SPELLING "tools-check-spelling"
|
||||
#define VIEW_FULLSCREEN "view-fullscreen"
|
||||
#define VIEW_REFRESH "view-refresh"
|
||||
#define VIEW_SORT_ASCENDING "view-sort-ascending"
|
||||
#define VIEW_SORT_DESCENDING "view-sort-descending"
|
||||
#define WINDOW_CLOSE "window-close"
|
||||
#define WINDOW_NEW "window-new"
|
||||
#define ZOOM_BEST_FIT "zoom-best-fit"
|
||||
#define ZOOM_IN "zoom-in"
|
||||
#define ZOOM_ORIGINAL "zoom-original"
|
||||
#define ZOOM_OUT "zoom-out"
|
||||
|
||||
#define PROCESS_WORKING "process-working"
|
||||
#define PROCESS_WORKING "process-working"
|
||||
|
||||
#define ACCESSORIES_CALCULATOR "accessories-calculator"
|
||||
#define ACCESSORIES_CHARACTER_MAP "accessories-character-map"
|
||||
#define ACCESSORIES_DICTIONARY "accessories-dictionary"
|
||||
#define ACCESSORIES_TEXT_EDITOR "accessories-text-editor"
|
||||
#define HELP_BROWSER "help-browser"
|
||||
#define MULTIMEDIA_VOLUME_CONTROL "multimedia-volume-control"
|
||||
#define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility"
|
||||
#define PREFERENCES_DESKTOP_FONT "preferences-desktop-font"
|
||||
#define PREFERENCES_DESKTOP_KEYBOARD "preferences-desktop-keyboard"
|
||||
#define PREFERENCES_DESKTOP_LOCALE "preferences-desktop-locale"
|
||||
#define PREFERENCES_DESKTOP_MULTIMEDIA "preferences-desktop-multimedia"
|
||||
#define PREFERENCES_DESKTOP_SCREENSAVER "preferences-desktop-screensaver"
|
||||
#define PREFERENCES_DESKTOP_THEME "preferences-desktop-theme"
|
||||
#define PREFERENCES_DESKTOP_WALLPAPER "preferences-desktop-wallpaper"
|
||||
#define SYSTEM_FILE_MANAGER "system-file-manager"
|
||||
#define SYSTEM_SOFTWARE_UPDATE "system-software-update"
|
||||
#define UTILITIES_TERMINAL "utilities-terminal"
|
||||
#define ACCESSORIES_CALCULATOR "accessories-calculator"
|
||||
#define ACCESSORIES_CHARACTER_MAP "accessories-character-map"
|
||||
#define ACCESSORIES_DICTIONARY "accessories-dictionary"
|
||||
#define ACCESSORIES_TEXT_EDITOR "accessories-text-editor"
|
||||
#define HELP_BROWSER "help-browser"
|
||||
#define MULTIMEDIA_VOLUME_CONTROL "multimedia-volume-control"
|
||||
#define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility"
|
||||
#define PREFERENCES_DESKTOP_FONT "preferences-desktop-font"
|
||||
#define PREFERENCES_DESKTOP_KEYBOARD "preferences-desktop-keyboard"
|
||||
#define PREFERENCES_DESKTOP_LOCALE "preferences-desktop-locale"
|
||||
#define PREFERENCES_DESKTOP_MULTIMEDIA "preferences-desktop-multimedia"
|
||||
#define PREFERENCES_DESKTOP_SCREENSAVER "preferences-desktop-screensaver"
|
||||
#define PREFERENCES_DESKTOP_THEME "preferences-desktop-theme"
|
||||
#define PREFERENCES_DESKTOP_WALLPAPER "preferences-desktop-wallpaper"
|
||||
#define SYSTEM_FILE_MANAGER "system-file-manager"
|
||||
#define SYSTEM_SOFTWARE_UPDATE "system-software-update"
|
||||
#define UTILITIES_TERMINAL "utilities-terminal"
|
||||
|
||||
#define APPLICATIONS_ACCESSORIES "applications-accessories"
|
||||
#define APPLICATIONS_DEVELOPMENT "applications-development"
|
||||
#define APPLICATIONS_GAMES "applications-games"
|
||||
#define APPLICATIONS_GRAPHICS "applications-graphics"
|
||||
#define APPLICATIONS_INTERNET "applications-internet"
|
||||
#define APPLICATIONS_MULTIMEDIA "applications-multimedia"
|
||||
#define APPLICATIONS_OFFICE "applications-office"
|
||||
#define APPLICATIONS_OTHER "applications-other"
|
||||
#define APPLICATIONS_SYSTEM "applications-system"
|
||||
#define APPLICATIONS_UTILITIES "applications-utilities"
|
||||
#define PREFERENCES_DESKTOP "preferences-desktop"
|
||||
#define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility"
|
||||
#define PREFERENCES_DESKTOP_PERIPHERALS "preferences-desktop-peripherals"
|
||||
#define PREFERENCES_DESKTOP_PERSONAL "preferences-desktop-personal"
|
||||
#define PREFERENCES_OTHER "preferences-other"
|
||||
#define PREFERENCES_SYSTEM "preferences-system"
|
||||
#define PREFERENCES_SYSTEM_NETWORK "preferences-system-network"
|
||||
#define SYSTEM_HELP "system-help"
|
||||
#define APPLICATIONS_ACCESSORIES "applications-accessories"
|
||||
#define APPLICATIONS_DEVELOPMENT "applications-development"
|
||||
#define APPLICATIONS_GAMES "applications-games"
|
||||
#define APPLICATIONS_GRAPHICS "applications-graphics"
|
||||
#define APPLICATIONS_INTERNET "applications-internet"
|
||||
#define APPLICATIONS_MULTIMEDIA "applications-multimedia"
|
||||
#define APPLICATIONS_OFFICE "applications-office"
|
||||
#define APPLICATIONS_OTHER "applications-other"
|
||||
#define APPLICATIONS_SYSTEM "applications-system"
|
||||
#define APPLICATIONS_UTILITIES "applications-utilities"
|
||||
#define PREFERENCES_DESKTOP "preferences-desktop"
|
||||
#define PREFERENCES_DESKTOP_ACCESSIBILITY "preferences-desktop-accessibility"
|
||||
#define PREFERENCES_DESKTOP_PERIPHERALS "preferences-desktop-peripherals"
|
||||
#define PREFERENCES_DESKTOP_PERSONAL "preferences-desktop-personal"
|
||||
#define PREFERENCES_OTHER "preferences-other"
|
||||
#define PREFERENCES_SYSTEM "preferences-system"
|
||||
#define PREFERENCES_SYSTEM_NETWORK "preferences-system-network"
|
||||
#define SYSTEM_HELP "system-help"
|
||||
|
||||
#define AUDIO_CARD "audio-card"
|
||||
#define AUDIO_INPUT_MICROPHONE "audio-input-microphone"
|
||||
#define BATTERY "battery"
|
||||
#define CAMERA_PHOTO "camera-photo"
|
||||
#define CAMERA_VIDEO "camera-video"
|
||||
#define COMPUTER "computer"
|
||||
#define DRIVE_CDROM "drive-cdrom"
|
||||
#define DRIVE_HARDDISK "drive-harddisk"
|
||||
#define DRIVE_REMOVABLE_MEDIA "drive-removable-media"
|
||||
#define INPUT_GAMING "input-gaming"
|
||||
#define INPUT_KEYBOARD "input-keyboard"
|
||||
#define INPUT_MOUSE "input-mouse"
|
||||
#define MEDIA_CDROM "media-cdrom"
|
||||
#define MEDIA_FLOPPY "media-floppy"
|
||||
#define MULTIMEDIA_PLAYER "multimedia-player"
|
||||
#define NETWORK_WIRED "network-wired"
|
||||
#define NETWORK_WIRELESS "network-wireless"
|
||||
#define PRINTER "printer"
|
||||
#define AUDIO_CARD "audio-card"
|
||||
#define AUDIO_INPUT_MICROPHONE "audio-input-microphone"
|
||||
#define BATTERY "battery"
|
||||
#define CAMERA_PHOTO "camera-photo"
|
||||
#define CAMERA_VIDEO "camera-video"
|
||||
#define COMPUTER "computer"
|
||||
#define DRIVE_CDROM "drive-cdrom"
|
||||
#define DRIVE_HARDDISK "drive-harddisk"
|
||||
#define DRIVE_REMOVABLE_MEDIA "drive-removable-media"
|
||||
#define INPUT_GAMING "input-gaming"
|
||||
#define INPUT_KEYBOARD "input-keyboard"
|
||||
#define INPUT_MOUSE "input-mouse"
|
||||
#define MEDIA_CDROM "media-cdrom"
|
||||
#define MEDIA_FLOPPY "media-floppy"
|
||||
#define MULTIMEDIA_PLAYER "multimedia-player"
|
||||
#define NETWORK_WIRED "network-wired"
|
||||
#define NETWORK_WIRELESS "network-wireless"
|
||||
#define PRINTER "printer"
|
||||
|
||||
#define EMBLEM_DEFAULT "emblem-default"
|
||||
#define EMBLEM_DOCUMENTS "emblem-documents"
|
||||
#define EMBLEM_DOWNLOADS "emblem-downloads"
|
||||
#define EMBLEM_FAVORITE "emblem-favorite"
|
||||
#define EMBLEM_IMPORTANT "emblem-important"
|
||||
#define EMBLEM_MAIL "emblem-mail"
|
||||
#define EMBLEM_PHOTOS "emblem-photos"
|
||||
#define EMBLEM_READONLY "emblem-readonly"
|
||||
#define EMBLEM_SHARED "emblem-shared"
|
||||
#define EMBLEM_SYMBOLIC_LINK "emblem-symbolic-link"
|
||||
#define EMBLEM_SYNCHRONIZED "emblem-synchronized"
|
||||
#define EMBLEM_SYSTEM "emblem-system"
|
||||
#define EMBLEM_UNREADABLE "emblem-unreadable"
|
||||
#define EMBLEM_DEFAULT "emblem-default"
|
||||
#define EMBLEM_DOCUMENTS "emblem-documents"
|
||||
#define EMBLEM_DOWNLOADS "emblem-downloads"
|
||||
#define EMBLEM_FAVORITE "emblem-favorite"
|
||||
#define EMBLEM_IMPORTANT "emblem-important"
|
||||
#define EMBLEM_MAIL "emblem-mail"
|
||||
#define EMBLEM_PHOTOS "emblem-photos"
|
||||
#define EMBLEM_READONLY "emblem-readonly"
|
||||
#define EMBLEM_SHARED "emblem-shared"
|
||||
#define EMBLEM_SYMBOLIC_LINK "emblem-symbolic-link"
|
||||
#define EMBLEM_SYNCHRONIZED "emblem-synchronized"
|
||||
#define EMBLEM_SYSTEM "emblem-system"
|
||||
#define EMBLEM_UNREADABLE "emblem-unreadable"
|
||||
|
||||
#define FACE_ANGEL "face-angel"
|
||||
#define FACE_CRYING "face-crying"
|
||||
#define FACE_DEVIL_GRIN "face-devil-grin"
|
||||
#define FACE_DEVIL_SAD "face-devil-sad"
|
||||
#define FACE_GLASSES "face-glasses"
|
||||
#define FACE_KISS "face-kiss"
|
||||
#define FACE_MONKEY "face-monkey"
|
||||
#define FACE_PLAIN "face-plain"
|
||||
#define FACE_SAD "face-sad"
|
||||
#define FACE_SMILE "face-smile"
|
||||
#define FACE_SMILE_BIG "face-smile-big"
|
||||
#define FACE_SMIRK "face-smirk"
|
||||
#define FACE_SURPRISE "face-surprise"
|
||||
#define FACE_WINK "face-wink"
|
||||
#define FACE_ANGEL "face-angel"
|
||||
#define FACE_CRYING "face-crying"
|
||||
#define FACE_DEVIL_GRIN "face-devil-grin"
|
||||
#define FACE_DEVIL_SAD "face-devil-sad"
|
||||
#define FACE_GLASSES "face-glasses"
|
||||
#define FACE_KISS "face-kiss"
|
||||
#define FACE_MONKEY "face-monkey"
|
||||
#define FACE_PLAIN "face-plain"
|
||||
#define FACE_SAD "face-sad"
|
||||
#define FACE_SMILE "face-smile"
|
||||
#define FACE_SMILE_BIG "face-smile-big"
|
||||
#define FACE_SMIRK "face-smirk"
|
||||
#define FACE_SURPRISE "face-surprise"
|
||||
#define FACE_WINK "face-wink"
|
||||
|
||||
#define APPLICATION_X_EXECUTABLE "application-x-executable"
|
||||
#define AUDIO_X_GENERIC "audio-x-generic"
|
||||
#define FONT_X_GENERIC "font-x-generic"
|
||||
#define IMAGE_X_GENERIC "image-x-generic"
|
||||
#define PACKAGE_X_GENERIC "package-x-generic"
|
||||
#define TEXT_HTML "text-html"
|
||||
#define TEXT_X_GENERIC "text-x-generic"
|
||||
#define TEXT_X_GENERIC_TEMPLATE "text-x-generic-template"
|
||||
#define TEXT_X_SCRIPT "text-x-script"
|
||||
#define VIDEO_X_GENERIC "video-x-generic"
|
||||
#define X_OFFICE_ADDRESS_BOOK "x-office-address-book"
|
||||
#define X_OFFICE_CALENDAR "x-office-calendar"
|
||||
#define X_OFFICE_DOCUMENT "x-office-document"
|
||||
#define X_OFFICE_PRESENTATION "x-office-presentation"
|
||||
#define X_OFFICE_SPREADSHEET "x-office-spreadsheet"
|
||||
#define APPLICATION_X_EXECUTABLE "application-x-executable"
|
||||
#define AUDIO_X_GENERIC "audio-x-generic"
|
||||
#define FONT_X_GENERIC "font-x-generic"
|
||||
#define IMAGE_X_GENERIC "image-x-generic"
|
||||
#define PACKAGE_X_GENERIC "package-x-generic"
|
||||
#define TEXT_HTML "text-html"
|
||||
#define TEXT_X_GENERIC "text-x-generic"
|
||||
#define TEXT_X_GENERIC_TEMPLATE "text-x-generic-template"
|
||||
#define TEXT_X_SCRIPT "text-x-script"
|
||||
#define VIDEO_X_GENERIC "video-x-generic"
|
||||
#define X_OFFICE_ADDRESS_BOOK "x-office-address-book"
|
||||
#define X_OFFICE_CALENDAR "x-office-calendar"
|
||||
#define X_OFFICE_DOCUMENT "x-office-document"
|
||||
#define X_OFFICE_PRESENTATION "x-office-presentation"
|
||||
#define X_OFFICE_SPREADSHEET "x-office-spreadsheet"
|
||||
|
||||
#define FOLDER "folder"
|
||||
#define FOLDER_REMOTE "folder-remote"
|
||||
#define NETWORK_SERVER "network-server"
|
||||
#define NETWORK_WORKGROUP "network-workgroup"
|
||||
#define START_HERE "start-here"
|
||||
#define USER_DESKTOP "user-desktop"
|
||||
#define USER_HOME "user-home"
|
||||
#define USER_TRASH "user-trash"
|
||||
#define FOLDER "folder"
|
||||
#define FOLDER_REMOTE "folder-remote"
|
||||
#define NETWORK_SERVER "network-server"
|
||||
#define NETWORK_WORKGROUP "network-workgroup"
|
||||
#define START_HERE "start-here"
|
||||
#define USER_DESKTOP "user-desktop"
|
||||
#define USER_HOME "user-home"
|
||||
#define USER_TRASH "user-trash"
|
||||
|
||||
#define APPOINTMENT_MISSED "appointment-missed"
|
||||
#define APPOINTMENT_SOON "appointment-soon"
|
||||
#define AUDIO_VOLUME_HIGH "audio-volume-high"
|
||||
#define AUDIO_VOLUME_LOW "audio-volume-low"
|
||||
#define AUDIO_VOLUME_MEDIUM "audio-volume-medium"
|
||||
#define AUDIO_VOLUME_MUTED "audio-volume-muted"
|
||||
#define BATTERY_CAUTION "battery-caution"
|
||||
#define BATTERY_LOW "battery-low"
|
||||
#define DIALOG_ERROR "dialog-error"
|
||||
#define DIALOG_INFORMATION "dialog-information"
|
||||
#define DIALOG_PASSWORD "dialog-password"
|
||||
#define DIALOG_QUESTION "dialog-question"
|
||||
#define DIALOG_WARNING "dialog-warning"
|
||||
#define FOLDER_DRAG_ACCEPT "folder-drag-accept"
|
||||
#define FOLDER_OPEN "folder-open"
|
||||
#define FOLDER_VISITING "folder-visiting"
|
||||
#define IMAGE_LOADING "image-loading"
|
||||
#define IMAGE_MISSING "image-missing"
|
||||
#define MAIL_ATTACHMENT "mail-attachment"
|
||||
#define MAIL_UNREAD "mail-unread"
|
||||
#define MAIL_READ "mail-read"
|
||||
#define MAIL_REPLIED "mail-replied"
|
||||
#define MAIL_SIGNED "mail-signed"
|
||||
#define MAIL_SIGNED_VERIFIED "mail-signed-verified"
|
||||
#define MEDIA_PLAYLIST_REPEAT "media-playlist-repeat"
|
||||
#define MEDIA_PLAYLIST_SHUFFLE "media-playlist-shuffle"
|
||||
#define NETWORK_ERROR "network-error"
|
||||
#define NETWORK_IDLE "network-idle"
|
||||
#define APPOINTMENT_MISSED "appointment-missed"
|
||||
#define APPOINTMENT_SOON "appointment-soon"
|
||||
#define AUDIO_VOLUME_HIGH "audio-volume-high"
|
||||
#define AUDIO_VOLUME_LOW "audio-volume-low"
|
||||
#define AUDIO_VOLUME_MEDIUM "audio-volume-medium"
|
||||
#define AUDIO_VOLUME_MUTED "audio-volume-muted"
|
||||
#define BATTERY_CAUTION "battery-caution"
|
||||
#define BATTERY_LOW "battery-low"
|
||||
#define DIALOG_ERROR "dialog-error"
|
||||
#define DIALOG_INFORMATION "dialog-information"
|
||||
#define DIALOG_PASSWORD "dialog-password"
|
||||
#define DIALOG_QUESTION "dialog-question"
|
||||
#define DIALOG_WARNING "dialog-warning"
|
||||
#define FOLDER_DRAG_ACCEPT "folder-drag-accept"
|
||||
#define FOLDER_OPEN "folder-open"
|
||||
#define FOLDER_VISITING "folder-visiting"
|
||||
#define IMAGE_LOADING "image-loading"
|
||||
#define IMAGE_MISSING "image-missing"
|
||||
#define MAIL_ATTACHMENT "mail-attachment"
|
||||
#define MAIL_UNREAD "mail-unread"
|
||||
#define MAIL_READ "mail-read"
|
||||
#define MAIL_REPLIED "mail-replied"
|
||||
#define MAIL_SIGNED "mail-signed"
|
||||
#define MAIL_SIGNED_VERIFIED "mail-signed-verified"
|
||||
#define MEDIA_PLAYLIST_REPEAT "media-playlist-repeat"
|
||||
#define MEDIA_PLAYLIST_SHUFFLE "media-playlist-shuffle"
|
||||
#define NETWORK_ERROR "network-error"
|
||||
#define NETWORK_IDLE "network-idle"
|
||||
|
||||
#define NETWORK_OFFLINE "network-offline"
|
||||
#define NETWORK_RECEIVE "network-receive"
|
||||
#define NETWORK_TRANSMIT "network-transmit"
|
||||
#define NETWORK_TRANSMIT_RECEIVE "network-transmit-receive"
|
||||
#define PRINTER_ERROR "printer-error"
|
||||
#define PRINTER_PRINTING "printer-printing"
|
||||
#define SOFTWARE_UPDATE_AVAILABLE "software-update-available"
|
||||
#define SOFTWARE_UPDATE_URGENT "software-update-urgent"
|
||||
#define SYNC_ERROR "sync-error"
|
||||
#define SYNC_SYNCHRONIZING "sync-synchronizing"
|
||||
#define TASK_DUE "task-due"
|
||||
#define TASK_PASSED_DUE "task-passed-due"
|
||||
#define USER_AWAY "user-away"
|
||||
#define USER_IDLE "user-idle"
|
||||
#define USER_OFFLINE "user-offline"
|
||||
#define USER_ONLINE "user-online"
|
||||
#define USER_TRASH_FULL "user-trash-full"
|
||||
#define WEATHER_CLEAR "weather-clear"
|
||||
#define WEATHER_CLEAR_NIGHT "weather-clear-night"
|
||||
#define WEATHER_FEW_CLOUDS "weather-few-clouds"
|
||||
#define WEATHER_FEW_CLOUDS_NIGHT "weather-few-clouds-night"
|
||||
#define WEATHER_FOG "weather-fog"
|
||||
#define WEATHER_OVERCAST "weather-overcast"
|
||||
#define WEATHER_SEVERE_ALERT "weather-severe-alert"
|
||||
#define WEATHER_SHOWERS "weather-showers"
|
||||
#define WEATHER_SHOWERS_SCATTERED "weather-showers-scattered"
|
||||
#define WEATHER_SNOW "weather-snow"
|
||||
#define WEATHER_STORM "weather-storm"
|
||||
#define NETWORK_OFFLINE "network-offline"
|
||||
#define NETWORK_RECEIVE "network-receive"
|
||||
#define NETWORK_TRANSMIT "network-transmit"
|
||||
#define NETWORK_TRANSMIT_RECEIVE "network-transmit-receive"
|
||||
#define PRINTER_ERROR "printer-error"
|
||||
#define PRINTER_PRINTING "printer-printing"
|
||||
#define SOFTWARE_UPDATE_AVAILABLE "software-update-available"
|
||||
#define SOFTWARE_UPDATE_URGENT "software-update-urgent"
|
||||
#define SYNC_ERROR "sync-error"
|
||||
#define SYNC_SYNCHRONIZING "sync-synchronizing"
|
||||
#define TASK_DUE "task-due"
|
||||
#define TASK_PASSED_DUE "task-passed-due"
|
||||
#define USER_AWAY "user-away"
|
||||
#define USER_IDLE "user-idle"
|
||||
#define USER_OFFLINE "user-offline"
|
||||
#define USER_ONLINE "user-online"
|
||||
#define USER_TRASH_FULL "user-trash-full"
|
||||
#define WEATHER_CLEAR "weather-clear"
|
||||
#define WEATHER_CLEAR_NIGHT "weather-clear-night"
|
||||
#define WEATHER_FEW_CLOUDS "weather-few-clouds"
|
||||
#define WEATHER_FEW_CLOUDS_NIGHT "weather-few-clouds-night"
|
||||
#define WEATHER_FOG "weather-fog"
|
||||
#define WEATHER_OVERCAST "weather-overcast"
|
||||
#define WEATHER_SEVERE_ALERT "weather-severe-alert"
|
||||
#define WEATHER_SHOWERS "weather-showers"
|
||||
#define WEATHER_SHOWERS_SCATTERED "weather-showers-scattered"
|
||||
#define WEATHER_SNOW "weather-snow"
|
||||
#define WEATHER_STORM "weather-storm"
|
||||
|
||||
const char *icons[] = {
|
||||
ADDRESS_BOOK_NEW,
|
||||
|
@ -414,7 +414,7 @@ const char *icons[] = {
|
|||
MULTIMEDIA_PLAYER,
|
||||
NETWORK_WIRED,
|
||||
NETWORK_WIRELESS,
|
||||
PRINTER,
|
||||
PRINTER,
|
||||
EMBLEM_DEFAULT,
|
||||
EMBLEM_DOCUMENTS,
|
||||
EMBLEM_DOWNLOADS,
|
||||
|
@ -525,4 +525,3 @@ const char *icons[] = {
|
|||
};
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -236,7 +236,7 @@ ef_cb_efreet_config_dirs(void)
|
|||
char dirs[128], *val;
|
||||
char *vals[] = {"/var/tmp/a", "/tmp/b", "/usr/local/share", "/etc", NULL};
|
||||
char *def_vals[] = {"/etc/xdg", NULL};
|
||||
|
||||
|
||||
dirs[0] = '\0';
|
||||
|
||||
for (i = 0; vals[i] != NULL; i++)
|
||||
|
@ -300,4 +300,3 @@ ef_cb_efreet_config_dirs(void)
|
|||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,7 +17,7 @@ ef_cb_desktop_parse(void)
|
|||
int ret = 1;
|
||||
|
||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
|
||||
if (!desktop)
|
||||
if (!desktop)
|
||||
{
|
||||
printf("No desktop found.\n");
|
||||
return 0;
|
||||
|
@ -29,7 +29,7 @@ ef_cb_desktop_parse(void)
|
|||
ret = 0;
|
||||
}
|
||||
|
||||
if (!desktop->generic_name ||
|
||||
if (!desktop->generic_name ||
|
||||
strcmp(desktop->generic_name, "Test Application"))
|
||||
{
|
||||
printf("Incorrent GenericName\n");
|
||||
|
@ -51,7 +51,7 @@ ef_cb_desktop_parse(void)
|
|||
ecore_list_first_goto(desktop->categories);
|
||||
while ((cat = ecore_list_next(desktop->categories)))
|
||||
{
|
||||
if (i >= num_categories)
|
||||
if (i >= num_categories)
|
||||
{
|
||||
printf("Too many categories found.\n");
|
||||
ret = 0;
|
||||
|
@ -318,7 +318,7 @@ ef_cb_desktop_command_get(void)
|
|||
|
||||
ret = info->error > 0 ? 0 : 1;
|
||||
free(info);
|
||||
|
||||
|
||||
chdir(olddir);
|
||||
|
||||
return ret;
|
||||
|
@ -367,10 +367,10 @@ ef_cb_desktop_type_parse(void)
|
|||
|
||||
/* add my custom desktop type to efreet */
|
||||
my_type = efreet_desktop_type_add("My_Type", cb_type_parse, NULL,
|
||||
(Efreet_Desktop_Type_Free_Cb)free);
|
||||
(Efreet_Desktop_Type_Free_Cb)free);
|
||||
|
||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test_type.desktop");
|
||||
if (!desktop)
|
||||
if (!desktop)
|
||||
{
|
||||
printf("No desktop found.\n");
|
||||
return 0;
|
||||
|
@ -388,10 +388,7 @@ ef_cb_desktop_type_parse(void)
|
|||
printf("Invalid value of custom key (%s).\n", val);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
||||
efreet_desktop_free(desktop);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
|
|
@ -12,9 +12,9 @@
|
|||
#define SIZE "128x128"
|
||||
#define THEME "Tango"
|
||||
|
||||
static void ef_icon_theme_themes_find(const char *search_dir,
|
||||
static void ef_icon_theme_themes_find(const char *search_dir,
|
||||
Ecore_Hash *themes);
|
||||
static void ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes,
|
||||
static void ef_icons_find(Efreet_Icon_Theme *theme, Ecore_List *themes,
|
||||
Ecore_Hash *icons);
|
||||
static void ef_read_dir(const char *dir, Ecore_Hash *icons);
|
||||
|
||||
|
@ -70,13 +70,13 @@ ef_cb_efreet_icon_theme_list(void)
|
|||
ecore_list_first_goto(icon_dirs);
|
||||
|
||||
ef_icon_theme_themes_find(efreet_icon_user_dir_get(), dirs);
|
||||
while ((dir = ecore_list_next(icon_dirs)))
|
||||
while ((dir = ecore_list_next(icon_dirs)))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s/icons", dir);
|
||||
ef_icon_theme_themes_find(buf, dirs);
|
||||
}
|
||||
ef_icon_theme_themes_find("/usr/share/pixmaps", dirs);
|
||||
|
||||
|
||||
themes = efreet_icon_theme_list_get();
|
||||
ecore_list_first_goto(themes);
|
||||
while ((theme = ecore_list_next(themes)))
|
||||
|
@ -159,7 +159,7 @@ ef_icon_theme_themes_find(const char *search_dir, Ecore_Hash *themes)
|
|||
ecore_list_destroy(dirs);
|
||||
}
|
||||
|
||||
const char *icons[] =
|
||||
const char *icons[] =
|
||||
{
|
||||
"address-book-new",
|
||||
"application-exit",
|
||||
|
@ -169,7 +169,7 @@ const char *icons[] =
|
|||
"dialog-cancel",
|
||||
"dialog-close",
|
||||
"dialog-ok",
|
||||
"document-new",
|
||||
"document-new",
|
||||
"document-open",
|
||||
"document-open-recent",
|
||||
"document-page-setup",
|
||||
|
@ -445,7 +445,7 @@ ef_cb_efreet_icon_match(void)
|
|||
ecore_hash_free_key_cb_set(icon_hash, free);
|
||||
ecore_hash_free_value_cb_set(icon_hash, free);
|
||||
|
||||
ef_icons_find(theme, themes, icon_hash);
|
||||
ef_icons_find(theme, themes, icon_hash);
|
||||
ecore_list_destroy(themes);
|
||||
|
||||
for (i = 0; icons[i] != NULL; i++)
|
||||
|
@ -580,7 +580,7 @@ ef_read_dir(const char *dir, Ecore_Hash *icons)
|
|||
char *p;
|
||||
|
||||
p = strrchr(file, '.');
|
||||
if (!p)
|
||||
if (!p)
|
||||
{
|
||||
FREE(file);
|
||||
continue;
|
||||
|
@ -599,4 +599,3 @@ ef_read_dir(const char *dir, Ecore_Hash *icons)
|
|||
}
|
||||
ecore_list_destroy(files);
|
||||
}
|
||||
|
||||
|
|
|
@ -13,7 +13,7 @@ ef_cb_ini_parse(void)
|
|||
putenv("LC_ALL=en_US");
|
||||
|
||||
ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/test.ini");
|
||||
if (!ini)
|
||||
if (!ini)
|
||||
{
|
||||
printf("efreet_ini_parse() Failed to initialize Efreet_Ini\n");
|
||||
return 0;
|
||||
|
@ -26,14 +26,14 @@ ef_cb_ini_parse(void)
|
|||
unsigned int bval;
|
||||
|
||||
val = efreet_ini_string_get(ini, "Name");
|
||||
if (!val || strcmp(val, "Foo Bar"))
|
||||
if (!val || strcmp(val, "Foo Bar"))
|
||||
{
|
||||
printf("efreet_ini_string_get() Name parsed incorrectly\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
val = efreet_ini_localestring_get(ini, "Name");
|
||||
if (!val || strcmp(val, "English Foo Bar"))
|
||||
if (!val || strcmp(val, "English Foo Bar"))
|
||||
{
|
||||
printf("efreet_ini_localestring_get() Name parsed incorrectly\n");
|
||||
ret = 0;
|
||||
|
@ -88,7 +88,7 @@ ef_cb_ini_parse(void)
|
|||
ret = 0;
|
||||
}
|
||||
}
|
||||
else
|
||||
else
|
||||
{
|
||||
printf("efreet_ini_section_set() Failed to set 'contact' section\n");
|
||||
ret = 0;
|
||||
|
@ -105,7 +105,7 @@ ef_cb_ini_long_line(void)
|
|||
Efreet_Ini *ini;
|
||||
int ret = 1;
|
||||
|
||||
struct
|
||||
struct
|
||||
{
|
||||
char *key;
|
||||
int len;
|
||||
|
@ -113,7 +113,7 @@ ef_cb_ini_long_line(void)
|
|||
{"key", 5099},
|
||||
{"key2", 5099},
|
||||
{NULL, 0}
|
||||
};
|
||||
};
|
||||
|
||||
ini = efreet_ini_new(PACKAGE_DATA_DIR"/efreet/test/long.ini");
|
||||
if (!ini)
|
||||
|
@ -121,7 +121,7 @@ ef_cb_ini_long_line(void)
|
|||
printf("Ini failed to parse.\n");
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
|
||||
if (ret) ret = efreet_ini_section_set(ini, "section");
|
||||
if (ret)
|
||||
{
|
||||
|
|
|
@ -12,7 +12,7 @@ ef_cb_locale(void)
|
|||
char *country;
|
||||
char *modifier;
|
||||
} langs[] = {
|
||||
/* these are ordered such that when we move from LANG to LC_MESSAGES
|
||||
/* these are ordered such that when we move from LANG to LC_MESSAGES
|
||||
* the LANG env will still be effect. Same with moving from
|
||||
* LC_MESSAGES to LANG */
|
||||
{"LANG=", NULL, NULL, NULL},
|
||||
|
@ -51,7 +51,7 @@ ef_cb_locale(void)
|
|||
if ((langs[i].lang && (!tmp || strcmp(tmp, langs[i].lang)))
|
||||
|| (!langs[i].lang && tmp))
|
||||
{
|
||||
printf("efreet_lang_get() is wrong (%s) with %s\n",
|
||||
printf("efreet_lang_get() is wrong (%s) with %s\n",
|
||||
tmp, langs[i].lang);
|
||||
ret = 0;
|
||||
}
|
||||
|
@ -60,13 +60,13 @@ ef_cb_locale(void)
|
|||
if ((langs[i].country && (!tmp || strcmp(tmp, langs[i].country)))
|
||||
|| (!langs[i].country && tmp))
|
||||
{
|
||||
printf("efreet_lang_country_get() is wrong (%s) with %s\n",
|
||||
printf("efreet_lang_country_get() is wrong (%s) with %s\n",
|
||||
tmp, langs[i].lang);
|
||||
ret = 0;
|
||||
}
|
||||
|
||||
tmp = efreet_lang_modifier_get();
|
||||
if ((langs[i].modifier && (!tmp || strcmp(tmp, langs[i].modifier)))
|
||||
if ((langs[i].modifier && (!tmp || strcmp(tmp, langs[i].modifier)))
|
||||
|| (!langs[i].modifier && tmp))
|
||||
{
|
||||
printf("efreet_lang_modifier_get() is wrong with %s with %s\n",
|
||||
|
@ -77,7 +77,6 @@ ef_cb_locale(void)
|
|||
efreet_shutdown();
|
||||
efreet_init();
|
||||
}
|
||||
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,7 @@ ef_cb_menu_edit(void)
|
|||
#endif
|
||||
|
||||
desktop = efreet_desktop_get(PACKAGE_DATA_DIR"/efreet/test/test.desktop");
|
||||
if (!desktop)
|
||||
if (!desktop)
|
||||
{
|
||||
efreet_menu_free(menu);
|
||||
printf("No desktop found.\n");
|
||||
|
@ -150,4 +150,3 @@ ef_cb_menu_edit(void)
|
|||
efreet_menu_free(menu);
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ ef_mime_cb_get(void)
|
|||
{
|
||||
const char *mime = NULL;
|
||||
int misses = 0, i = 0;
|
||||
struct
|
||||
struct
|
||||
{
|
||||
char *file;
|
||||
char *mime;
|
||||
|
@ -22,8 +22,8 @@ ef_mime_cb_get(void)
|
|||
{PACKAGE_DATA_DIR"/efreet/test/sub", "inode/directory"},
|
||||
{NULL, NULL}
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
if (!efreet_mime_init())
|
||||
{
|
||||
printf("Could not init efreet\n");
|
||||
|
@ -31,10 +31,10 @@ ef_mime_cb_get(void)
|
|||
}
|
||||
|
||||
for (i = 0; files[i].file != NULL; ++i)
|
||||
{
|
||||
{
|
||||
mime = efreet_mime_type_get(files[i].file);
|
||||
if (!mime)
|
||||
{
|
||||
{
|
||||
printf("Got %s as null instead of %s\n", files[i].file, files[i].mime);
|
||||
misses ++;
|
||||
}
|
||||
|
@ -44,8 +44,8 @@ ef_mime_cb_get(void)
|
|||
misses ++;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
efreet_mime_shutdown();
|
||||
|
||||
|
||||
return !misses;
|
||||
}
|
||||
|
|
|
@ -43,7 +43,7 @@ dump(Efreet_Menu *menu, const char *path)
|
|||
if (entry->type == EFREET_MENU_ENTRY_DESKTOP)
|
||||
{
|
||||
if (!path || !*path) path = "/";
|
||||
printf("%s\t%s\t%s\n", path, entry->id,
|
||||
printf("%s\t%s\t%s\n", path, entry->id,
|
||||
entry->desktop->orig_path);
|
||||
}
|
||||
else if (entry->type == EFREET_MENU_ENTRY_MENU)
|
||||
|
@ -55,4 +55,3 @@ dump(Efreet_Menu *menu, const char *path)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -135,9 +135,9 @@ main(int argc, char ** argv)
|
|||
double start;
|
||||
|
||||
/* we've been given specific tests and it isn't in the list */
|
||||
if (run && !ecore_list_find(run, ECORE_COMPARE_CB(strcasecmp),
|
||||
if (run && !ecore_list_find(run, ECORE_COMPARE_CB(strcasecmp),
|
||||
tests[i].name))
|
||||
continue;
|
||||
continue;
|
||||
|
||||
if (!efreet_init())
|
||||
{
|
||||
|
@ -147,11 +147,11 @@ main(int argc, char ** argv)
|
|||
|
||||
num_tests ++;
|
||||
|
||||
printf("%s:\t\t", tests[i].name);
|
||||
printf("%s:\t\t", tests[i].name);
|
||||
fflush(stdout);
|
||||
start = ecore_time_get();
|
||||
ret = tests[i].cb();
|
||||
printf("%s in %.3f seconds\n", (ret ? "PASSED" : "FAILED"),
|
||||
printf("%s in %.3f seconds\n", (ret ? "PASSED" : "FAILED"),
|
||||
ecore_time_get() - start);
|
||||
passed += ret;
|
||||
|
||||
|
@ -168,4 +168,3 @@ main(int argc, char ** argv)
|
|||
printf("Total run: %.3f seconds\n", ecore_time_get() - total);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -3,7 +3,7 @@
|
|||
#define EFREET_H
|
||||
|
||||
/**
|
||||
* @file Efreet.h
|
||||
* @file Efreet.h
|
||||
* @brief The file that must be included by any project wishing to use
|
||||
* Efreet. Efreet.h provides all of the necessary headers and includes to
|
||||
* work with Efreet.
|
||||
|
@ -17,7 +17,7 @@
|
|||
* Efreet is a library designed to help apps work several of the
|
||||
* Freedesktop.org standards regarding Icons, Desktop files and Menus. To
|
||||
* that end it implements the following specifications:
|
||||
*
|
||||
*
|
||||
* @li XDG Base Directory Specification
|
||||
* @li Icon Theme Specification
|
||||
* @li Desktop Entry Specification
|
||||
|
@ -42,4 +42,3 @@ int efreet_shutdown(void);
|
|||
#endif
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -3,9 +3,9 @@
|
|||
#define EFREET_MIME_H
|
||||
|
||||
/**
|
||||
* @file Efreet_Mime.h
|
||||
* @file Efreet_Mime.h
|
||||
* @brief The file that must be included by any project wishing to use
|
||||
* Efreet_Mime. Efreet_Mime.h provides all of the necessary headers and
|
||||
* Efreet_Mime. Efreet_Mime.h provides all of the necessary headers and
|
||||
* includes to work with Efreet_Mime.
|
||||
*/
|
||||
|
||||
|
@ -14,7 +14,7 @@
|
|||
*
|
||||
* @section intro Introduction
|
||||
*
|
||||
* Efreet Mime is a library designed to help apps work with the
|
||||
* Efreet Mime is a library designed to help apps work with the
|
||||
* Freedesktop.org Shared Mime Info standard.
|
||||
*/
|
||||
|
||||
|
@ -34,8 +34,8 @@ const char *efreet_mime_magic_type_get(const char *file);
|
|||
const char *efreet_mime_globs_type_get(const char *file);
|
||||
const char *efreet_mime_special_type_get(const char *file);
|
||||
const char *efreet_mime_fallback_type_get(const char *file);
|
||||
|
||||
char *efreet_mime_type_icon_get(const char *mime, const char *theme,
|
||||
|
||||
char *efreet_mime_type_icon_get(const char *mime, const char *theme,
|
||||
const char *size);
|
||||
|
||||
/**
|
||||
|
|
|
@ -16,7 +16,7 @@ efreet_desktop.h \
|
|||
efreet_icon.h \
|
||||
efreet_ini.h \
|
||||
efreet_menu.h \
|
||||
efreet_utils.h
|
||||
efreet_utils.h
|
||||
|
||||
EFREETSOURCES = \
|
||||
efreet.c \
|
||||
|
|
|
@ -32,7 +32,7 @@ efreet_init(void)
|
|||
* @return Returns the number of times the init function as been called
|
||||
* minus the corresponding init call.
|
||||
* @brief Shuts down Efreet if a balanced number of init/shutdown calls have
|
||||
* been made
|
||||
* been made
|
||||
*/
|
||||
int
|
||||
efreet_shutdown(void)
|
||||
|
@ -106,7 +106,7 @@ static void
|
|||
efreet_parse_locale(void)
|
||||
{
|
||||
efreet_parsed_locale = 1;
|
||||
|
||||
|
||||
if (efreet_parse_locale_setting("LC_ALL"))
|
||||
return;
|
||||
|
||||
|
@ -187,5 +187,3 @@ efreet_array_cat(char *buffer, size_t size, const char *strs[])
|
|||
}
|
||||
return n;
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@ static Ecore_List *xdg_data_dirs = NULL;
|
|||
static Ecore_List *xdg_config_dirs = NULL;
|
||||
|
||||
static const char *efreet_dir_get(const char *key, const char *fallback);
|
||||
static Ecore_List *efreet_dirs_get(const char *key,
|
||||
static Ecore_List *efreet_dirs_get(const char *key,
|
||||
const char *fallback);
|
||||
|
||||
/**
|
||||
|
@ -89,7 +89,7 @@ Ecore_List *
|
|||
efreet_data_dirs_get(void)
|
||||
{
|
||||
if (xdg_data_dirs) return xdg_data_dirs;
|
||||
xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS",
|
||||
xdg_data_dirs = efreet_dirs_get("XDG_DATA_DIRS",
|
||||
"/usr/local/share:/usr/share");
|
||||
return xdg_data_dirs;
|
||||
}
|
||||
|
@ -154,7 +154,7 @@ efreet_dir_get(const char *key, const char *fallback)
|
|||
{
|
||||
int len;
|
||||
const char *user;
|
||||
|
||||
|
||||
user = efreet_home_dir_get();
|
||||
len = strlen(user) + strlen(fallback) + 1;
|
||||
dir = malloc(sizeof(char) * len);
|
||||
|
@ -209,4 +209,3 @@ efreet_dirs_get(const char *key, const char *fallback)
|
|||
|
||||
return dirs;
|
||||
}
|
||||
|
||||
|
|
|
@ -4,9 +4,9 @@
|
|||
|
||||
/**
|
||||
* @file efreet_base.h
|
||||
* @brief Contains the methods used to support the FDO base directory
|
||||
* @brief Contains the methods used to support the FDO base directory
|
||||
* specification.
|
||||
* @addtogroup Efreet_Base Efreet_Base: The XDG Base Directory Specification
|
||||
* @addtogroup Efreet_Base Efreet_Base: The XDG Base Directory Specification
|
||||
* functions
|
||||
*
|
||||
* @{
|
||||
|
@ -28,4 +28,3 @@ const char *efreet_cache_home_get(void);
|
|||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
static const char *desktop_environment = NULL;
|
||||
|
||||
/**
|
||||
* A cache of all loaded desktops, hashed by file name.
|
||||
* A cache of all loaded desktops, hashed by file name.
|
||||
* Values are Efreet_Desktop structures
|
||||
*/
|
||||
static Ecore_Hash *efreet_desktop_cache = NULL;
|
||||
|
@ -49,53 +49,53 @@ struct Efreet_Desktop_Type_Info
|
|||
static int efreet_desktop_read(Efreet_Desktop *desktop);
|
||||
static void efreet_desktop_clear(Efreet_Desktop *desktop);
|
||||
static Efreet_Desktop_Type_Info *efreet_desktop_type_parse(const char *type_str);
|
||||
static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop,
|
||||
static void *efreet_desktop_application_fields_parse(Efreet_Desktop *desktop,
|
||||
Efreet_Ini *ini);
|
||||
static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop,
|
||||
static void efreet_desktop_application_fields_save(Efreet_Desktop *desktop,
|
||||
Efreet_Ini *ini);
|
||||
static void *efreet_desktop_link_fields_parse(Efreet_Desktop *desktop,
|
||||
Efreet_Ini *ini);
|
||||
static void efreet_desktop_link_fields_save(Efreet_Desktop *desktop,
|
||||
static void efreet_desktop_link_fields_save(Efreet_Desktop *desktop,
|
||||
Efreet_Ini *ini);
|
||||
static int efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop,
|
||||
static int efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop,
|
||||
Efreet_Ini *ini);
|
||||
static void efreet_desktop_generic_fields_save(Efreet_Desktop *desktop,
|
||||
static void efreet_desktop_generic_fields_save(Efreet_Desktop *desktop,
|
||||
Efreet_Ini *ini);
|
||||
static void efreet_desktop_x_fields_parse(Ecore_Hash_Node *node,
|
||||
static void efreet_desktop_x_fields_parse(Ecore_Hash_Node *node,
|
||||
Efreet_Desktop *desktop);
|
||||
static int efreet_desktop_environment_check(Efreet_Ini *ini);
|
||||
static char *efreet_string_append(char *dest, int *size,
|
||||
static char *efreet_string_append(char *dest, int *size,
|
||||
int *len, const char *src);
|
||||
static char *efreet_string_append_char(char *dest, int *size,
|
||||
static char *efreet_string_append_char(char *dest, int *size,
|
||||
int *len, char c);
|
||||
static Ecore_List *efreet_desktop_command_build(Efreet_Desktop_Command *command);
|
||||
static void efreet_desktop_command_free(Efreet_Desktop_Command *command);
|
||||
static char *efreet_desktop_command_append_quoted(char *dest, int *size,
|
||||
static char *efreet_desktop_command_append_quoted(char *dest, int *size,
|
||||
int *len, char *src);
|
||||
static char *efreet_desktop_command_append_icon(char *dest, int *size, int *len,
|
||||
Efreet_Desktop *desktop);
|
||||
static char *efreet_desktop_command_append_single(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command_File *file,
|
||||
static char *efreet_desktop_command_append_single(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command_File *file,
|
||||
char type);
|
||||
static char *efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command *command,
|
||||
static char *efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command *command,
|
||||
char type);
|
||||
|
||||
static char *efreet_desktop_command_path_absolute(const char *path);
|
||||
static Efreet_Desktop_Command_File *efreet_desktop_command_file_process(
|
||||
Efreet_Desktop_Command *command,
|
||||
Efreet_Desktop_Command *command,
|
||||
const char *file);
|
||||
static const char *efreet_desktop_command_file_uri_process(const char *uri);
|
||||
static void efreet_desktop_command_file_free(Efreet_Desktop_Command_File *file);
|
||||
|
||||
static void efreet_desktop_cb_download_complete(void *data, const char *file,
|
||||
static void efreet_desktop_cb_download_complete(void *data, const char *file,
|
||||
int status);
|
||||
static int efreet_desktop_cb_download_progress(void *data, const char *file,
|
||||
long int dltotal, long int dlnow,
|
||||
long int ultotal, long int ulnow);
|
||||
|
||||
|
||||
static void efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop,
|
||||
static void efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop,
|
||||
char *exec, int remaining);
|
||||
|
||||
static void efreet_desktop_type_info_free(Efreet_Desktop_Type_Info *info);
|
||||
|
@ -117,22 +117,22 @@ efreet_desktop_init(void)
|
|||
efreet_desktop_cache = ecore_hash_new(ecore_str_hash, ecore_str_compare);
|
||||
ecore_hash_free_key_cb_set(efreet_desktop_cache, ECORE_FREE_CB(free));
|
||||
#if 0
|
||||
ecore_hash_free_value_cb_set(efreet_desktop_cache,
|
||||
ecore_hash_free_value_cb_set(efreet_desktop_cache,
|
||||
ECORE_FREE_CB(efreet_desktop_free));
|
||||
#endif
|
||||
|
||||
efreet_desktop_types = ecore_list_new();
|
||||
ecore_list_free_cb_set(efreet_desktop_types,
|
||||
ecore_list_free_cb_set(efreet_desktop_types,
|
||||
ECORE_FREE_CB(efreet_desktop_type_info_free));
|
||||
|
||||
EFREET_DESKTOP_TYPE_APPLICATION = efreet_desktop_type_add("Application",
|
||||
efreet_desktop_application_fields_parse,
|
||||
efreet_desktop_application_fields_save,
|
||||
EFREET_DESKTOP_TYPE_APPLICATION = efreet_desktop_type_add("Application",
|
||||
efreet_desktop_application_fields_parse,
|
||||
efreet_desktop_application_fields_save,
|
||||
NULL);
|
||||
EFREET_DESKTOP_TYPE_LINK = efreet_desktop_type_add("Link",
|
||||
efreet_desktop_link_fields_parse,
|
||||
EFREET_DESKTOP_TYPE_LINK = efreet_desktop_type_add("Link",
|
||||
efreet_desktop_link_fields_parse,
|
||||
efreet_desktop_link_fields_save, NULL);
|
||||
EFREET_DESKTOP_TYPE_DIRECTORY = efreet_desktop_type_add("Directory", NULL,
|
||||
EFREET_DESKTOP_TYPE_DIRECTORY = efreet_desktop_type_add("Directory", NULL,
|
||||
NULL, NULL);
|
||||
|
||||
return init;
|
||||
|
@ -161,7 +161,7 @@ efreet_desktop_shutdown(void)
|
|||
* @internal
|
||||
* @param desktop: The desktop to check
|
||||
* @return Returns 1 if the cache is still valid, 0 otherwise
|
||||
* @brief This will check if the desktop cache is still valid.
|
||||
* @brief This will check if the desktop cache is still valid.
|
||||
*/
|
||||
static int
|
||||
efreet_desktop_cache_check(Efreet_Desktop *desktop)
|
||||
|
@ -169,7 +169,7 @@ efreet_desktop_cache_check(Efreet_Desktop *desktop)
|
|||
if (!desktop) return 0;
|
||||
|
||||
/* have we modified this file since we last read it in? */
|
||||
if ((desktop->cache_flush != cache_flush) ||
|
||||
if ((desktop->cache_flush != cache_flush) ||
|
||||
(ecore_file_mod_time(desktop->orig_path) != desktop->load_time))
|
||||
return 0;
|
||||
|
||||
|
@ -178,7 +178,7 @@ efreet_desktop_cache_check(Efreet_Desktop *desktop)
|
|||
|
||||
/**
|
||||
* @param file: The file to get the Efreet_Desktop from
|
||||
* @return Returns a reference to a cached Efreet_Desktop on success, NULL
|
||||
* @return Returns a reference to a cached Efreet_Desktop on success, NULL
|
||||
* on failure. This reference should not be freed.
|
||||
* @brief Gets a reference to an Efreet_Desktop structure representing the
|
||||
* contents of @a file or NULL if @a file is not a valid .desktop file.
|
||||
|
@ -188,7 +188,7 @@ efreet_desktop_get(const char *file)
|
|||
{
|
||||
Efreet_Desktop *desktop;
|
||||
|
||||
if (efreet_desktop_cache)
|
||||
if (efreet_desktop_cache)
|
||||
{
|
||||
desktop = ecore_hash_get(efreet_desktop_cache, file);
|
||||
if (desktop)
|
||||
|
@ -299,7 +299,7 @@ efreet_desktop_read(Efreet_Desktop *desktop)
|
|||
int ok;
|
||||
|
||||
ini = efreet_ini_new(desktop->orig_path);
|
||||
if (!ini->data)
|
||||
if (!ini->data)
|
||||
{
|
||||
efreet_ini_free(ini);
|
||||
return 0;
|
||||
|
@ -307,7 +307,7 @@ efreet_desktop_read(Efreet_Desktop *desktop)
|
|||
|
||||
ok = efreet_ini_section_set(ini, "Desktop Entry");
|
||||
if (!ok) ok = efreet_ini_section_set(ini, "KDE Desktop Entry");
|
||||
if (!ok)
|
||||
if (!ok)
|
||||
{
|
||||
printf("efreet_desktop_new error: no Desktop Entry section\n");
|
||||
error = 1;
|
||||
|
@ -324,7 +324,7 @@ efreet_desktop_read(Efreet_Desktop *desktop)
|
|||
desktop->version = efreet_ini_double_get(ini, "Version");
|
||||
|
||||
if (info->parse_func)
|
||||
desktop->type_data = info->parse_func(desktop, ini);
|
||||
desktop->type_data = info->parse_func(desktop, ini);
|
||||
}
|
||||
else
|
||||
error = 1;
|
||||
|
@ -377,7 +377,7 @@ efreet_desktop_clear(Efreet_Desktop *desktop)
|
|||
Efreet_Desktop_Type_Info *info;
|
||||
info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
|
||||
if (info->free_func)
|
||||
info->free_func(desktop->type_data);
|
||||
info->free_func(desktop->type_data);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -399,7 +399,7 @@ efreet_desktop_save(Efreet_Desktop *desktop)
|
|||
efreet_ini_section_set(ini, "Desktop Entry");
|
||||
|
||||
info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
|
||||
if (info)
|
||||
if (info)
|
||||
{
|
||||
efreet_ini_string_set(ini, "Type", info->type);
|
||||
if (info->save_func) info->save_func(desktop, ini);
|
||||
|
@ -434,7 +434,7 @@ efreet_desktop_save(Efreet_Desktop *desktop)
|
|||
if (desktop != ecore_hash_get(efreet_desktop_cache, desktop->orig_path))
|
||||
{
|
||||
desktop->cached = 1;
|
||||
ecore_hash_set(efreet_desktop_cache,
|
||||
ecore_hash_set(efreet_desktop_cache,
|
||||
strdup(desktop->orig_path), desktop);
|
||||
}
|
||||
}
|
||||
|
@ -504,7 +504,7 @@ efreet_desktop_free(Efreet_Desktop *desktop)
|
|||
Efreet_Desktop_Type_Info *info;
|
||||
info = ecore_list_index_goto(efreet_desktop_types, desktop->type);
|
||||
if (info->free_func)
|
||||
info->free_func(desktop->type_data);
|
||||
info->free_func(desktop->type_data);
|
||||
}
|
||||
|
||||
FREE(desktop);
|
||||
|
@ -524,7 +524,7 @@ efreet_desktop_exec(Efreet_Desktop *desktop, Ecore_List *files, void *data)
|
|||
}
|
||||
|
||||
static void
|
||||
efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
|
||||
efreet_desktop_exec_cb(void *data, Efreet_Desktop *desktop __UNUSED__,
|
||||
char *exec, int remaining __UNUSED__)
|
||||
{
|
||||
ecore_exe_run(exec, data);
|
||||
|
@ -581,14 +581,14 @@ efreet_desktop_category_add(Efreet_Desktop *desktop, const char *category)
|
|||
if (!desktop->categories)
|
||||
{
|
||||
desktop->categories = ecore_list_new();
|
||||
ecore_list_free_cb_set(desktop->categories,
|
||||
ecore_list_free_cb_set(desktop->categories,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
}
|
||||
else
|
||||
if (ecore_list_find(desktop->categories,
|
||||
if (ecore_list_find(desktop->categories,
|
||||
ECORE_COMPARE_CB(strcmp), category)) return;
|
||||
|
||||
ecore_list_append(desktop->categories,
|
||||
ecore_list_append(desktop->categories,
|
||||
(void *)ecore_string_instance(category));
|
||||
}
|
||||
|
||||
|
@ -604,8 +604,8 @@ efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
|
|||
int found = 0;
|
||||
if (!desktop || !desktop->categories) return 0;
|
||||
|
||||
if (ecore_list_find(desktop->categories,
|
||||
ECORE_COMPARE_CB(strcmp), category))
|
||||
if (ecore_list_find(desktop->categories,
|
||||
ECORE_COMPARE_CB(strcmp), category))
|
||||
{
|
||||
found = 1;
|
||||
ecore_list_remove(desktop->categories);
|
||||
|
@ -619,7 +619,7 @@ efreet_desktop_category_del(Efreet_Desktop *desktop, const char *category)
|
|||
* @param parse_func: a function to parse out custom fields
|
||||
* @param save_func: a function to save data returned from @a parse_func
|
||||
* @param free_func: a function to free data returned from @a parse_func
|
||||
* @return Returns the id of the new type
|
||||
* @return Returns the id of the new type
|
||||
* @brief Adds the given type to the list of types in the system
|
||||
*/
|
||||
int
|
||||
|
@ -652,7 +652,7 @@ efreet_desktop_type_add(const char *type, Efreet_Desktop_Type_Parse_Cb parse_fun
|
|||
* @param alias the alias
|
||||
* @return the new type id, or -1 if @p from_type was not valid
|
||||
*
|
||||
* This allows applications to add non-standard types that behave exactly as standard types.
|
||||
* This allows applications to add non-standard types that behave exactly as standard types.
|
||||
*/
|
||||
int
|
||||
efreet_desktop_type_alias (int from_type, const char *alias)
|
||||
|
@ -792,7 +792,7 @@ efreet_desktop_string_list_join(Ecore_List *list)
|
|||
|
||||
/**
|
||||
* @brief Tell Efreet to flush any cached desktop entries so it reloads on get.
|
||||
*
|
||||
*
|
||||
* This flags the cache to be invalid, so next time a desktop file is fetched
|
||||
* it will force it to be re-read off disk next time efreet_desktop_get() is
|
||||
* called.
|
||||
|
@ -850,13 +850,13 @@ efreet_desktop_application_fields_save(Efreet_Desktop *desktop, Efreet_Ini *ini)
|
|||
{
|
||||
char *val;
|
||||
|
||||
if (desktop->try_exec)
|
||||
if (desktop->try_exec)
|
||||
efreet_ini_string_set(ini, "TryExec", desktop->try_exec);
|
||||
|
||||
if (desktop->exec)
|
||||
if (desktop->exec)
|
||||
efreet_ini_string_set(ini, "Exec", desktop->exec);
|
||||
|
||||
if (desktop->path)
|
||||
if (desktop->path)
|
||||
efreet_ini_string_set(ini, "Path", desktop->path);
|
||||
|
||||
if (desktop->startup_wm_class)
|
||||
|
@ -924,7 +924,7 @@ efreet_desktop_generic_fields_parse(Efreet_Desktop *desktop, Efreet_Ini *ini)
|
|||
|
||||
val = efreet_ini_localestring_get(ini, "Name");
|
||||
if (val) desktop->name = strdup(val);
|
||||
else
|
||||
else
|
||||
{
|
||||
printf("efreet_desktop_generic_fields_parse error: no Name\n");
|
||||
return 0;
|
||||
|
@ -1005,9 +1005,9 @@ efreet_desktop_x_fields_parse(Ecore_Hash_Node *node, Efreet_Desktop *desktop)
|
|||
if (!desktop->x)
|
||||
{
|
||||
desktop->x = ecore_hash_new(ecore_str_hash, ecore_str_compare);
|
||||
ecore_hash_free_key_cb_set(desktop->x,
|
||||
ecore_hash_free_key_cb_set(desktop->x,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
ecore_hash_free_value_cb_set(desktop->x,
|
||||
ecore_hash_free_value_cb_set(desktop->x,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
}
|
||||
ecore_hash_set(desktop->x, (void *)ecore_string_instance(node->key),
|
||||
|
@ -1019,7 +1019,7 @@ efreet_desktop_x_fields_parse(Ecore_Hash_Node *node, Efreet_Desktop *desktop)
|
|||
* @internal
|
||||
* @param ini: The Efreet_Ini to parse values from
|
||||
* @return 1 if desktop should be included in current environement, 0 otherwise
|
||||
* @brief Determines if a desktop should be included in the current environment,
|
||||
* @brief Determines if a desktop should be included in the current environment,
|
||||
* based on the values of the OnlyShowIn and NotShowIn fields
|
||||
*/
|
||||
static int
|
||||
|
@ -1033,12 +1033,12 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
|
|||
{
|
||||
int found = 0;
|
||||
|
||||
if (desktop_environment)
|
||||
if (desktop_environment)
|
||||
{
|
||||
ecore_list_first_goto(list);
|
||||
while ((val = ecore_list_next(list)))
|
||||
{
|
||||
if (!strcmp(val, desktop_environment))
|
||||
if (!strcmp(val, desktop_environment))
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
|
@ -1050,7 +1050,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
|
|||
return found;
|
||||
}
|
||||
|
||||
if (desktop_environment)
|
||||
if (desktop_environment)
|
||||
{
|
||||
int found = 0;
|
||||
|
||||
|
@ -1060,7 +1060,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
|
|||
ecore_list_first_goto(list);
|
||||
while ((val = ecore_list_next(list)))
|
||||
{
|
||||
if (!strcmp(val, desktop_environment))
|
||||
if (!strcmp(val, desktop_environment))
|
||||
{
|
||||
found = 1;
|
||||
break;
|
||||
|
@ -1086,7 +1086,7 @@ efreet_desktop_environment_check(Efreet_Ini *ini)
|
|||
* @brief Get a command to use to execute a desktop entry.
|
||||
*/
|
||||
int
|
||||
efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files,
|
||||
efreet_desktop_command_get(Efreet_Desktop *desktop, Ecore_List *files,
|
||||
Efreet_Desktop_Command_Cb func, void *data)
|
||||
{
|
||||
return efreet_desktop_command_progress_get(desktop, files, func, NULL, data);
|
||||
|
@ -1115,7 +1115,7 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
|
|||
command->files = ecore_list_new();
|
||||
command->desktop = desktop;
|
||||
|
||||
ecore_list_free_cb_set(command->files,
|
||||
ecore_list_free_cb_set(command->files,
|
||||
ECORE_FREE_CB(efreet_desktop_command_file_free));
|
||||
|
||||
command->flags = efreet_desktop_command_flags_get(desktop);
|
||||
|
@ -1147,19 +1147,19 @@ efreet_desktop_command_local_get(Efreet_Desktop *desktop, Ecore_List *files)
|
|||
|
||||
/**
|
||||
* @param desktop: the desktop entry
|
||||
* @param files: an ecore list of file names to execute, as either absolute paths,
|
||||
* @param files: an ecore list of file names to execute, as either absolute paths,
|
||||
* relative paths, or uris
|
||||
* @param cb_command: a callback to call for each prepared command line
|
||||
* @param cb_progress: a callback to get progress for the downloads
|
||||
* @param data: user data passed to the callback
|
||||
* @return Returns 1 on success or 0 on failure
|
||||
* @brief Get a command to use to execute a desktop entry, and receive progress
|
||||
* @brief Get a command to use to execute a desktop entry, and receive progress
|
||||
* updates for downloading of remote URI's passed in.
|
||||
*/
|
||||
int
|
||||
efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
|
||||
Efreet_Desktop_Command_Cb cb_command,
|
||||
Efreet_Desktop_Progress_Cb cb_progress,
|
||||
efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
|
||||
Efreet_Desktop_Command_Cb cb_command,
|
||||
Efreet_Desktop_Progress_Cb cb_progress,
|
||||
void *data)
|
||||
{
|
||||
Efreet_Desktop_Command *command;
|
||||
|
@ -1176,7 +1176,7 @@ efreet_desktop_command_progress_get(Efreet_Desktop *desktop, Ecore_List *files,
|
|||
command->files = ecore_list_new();
|
||||
command->desktop = desktop;
|
||||
|
||||
ecore_list_free_cb_set(command->files,
|
||||
ecore_list_free_cb_set(command->files,
|
||||
ECORE_FREE_CB(efreet_desktop_command_file_free));
|
||||
|
||||
command->flags = efreet_desktop_command_flags_get(desktop);
|
||||
|
@ -1259,7 +1259,7 @@ efreet_desktop_command_flags_get(Efreet_Desktop *desktop)
|
|||
* @internal
|
||||
*
|
||||
* @brief Call the command callback for each exec in the list
|
||||
* @param command
|
||||
* @param command
|
||||
* @param execs
|
||||
*/
|
||||
static void
|
||||
|
@ -1277,8 +1277,8 @@ efreet_desktop_command_execs_process(Efreet_Desktop_Command *command, Ecore_List
|
|||
|
||||
|
||||
/**
|
||||
* @brief Builds the actual exec string from the raw string and a list of
|
||||
* processed filename information. The callback passed in to
|
||||
* @brief Builds the actual exec string from the raw string and a list of
|
||||
* processed filename information. The callback passed in to
|
||||
* efreet_desktop_command_get is called for each exec string created.
|
||||
*
|
||||
* @param command: the command to build
|
||||
|
@ -1296,9 +1296,9 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
|||
|
||||
ecore_list_first_goto(command->files);
|
||||
|
||||
/* if the Exec field appends multiple, that will run the list to the end,
|
||||
* causing this loop to only run once. otherwise, this loop will generate a
|
||||
* command for each file in the list. if the list is empty, this
|
||||
/* if the Exec field appends multiple, that will run the list to the end,
|
||||
* causing this loop to only run once. otherwise, this loop will generate a
|
||||
* command for each file in the list. if the list is empty, this
|
||||
* will run once, removing any file field codes */
|
||||
while ((file = ecore_list_next(command->files)) || first)
|
||||
{
|
||||
|
@ -1315,7 +1315,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
|||
|
||||
while (*p)
|
||||
{
|
||||
if (len >= size - 1)
|
||||
if (len >= size - 1)
|
||||
{
|
||||
size = len + 1024;
|
||||
exec = realloc(exec, size);
|
||||
|
@ -1328,42 +1328,42 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
|||
switch (*p)
|
||||
{
|
||||
case 'f':
|
||||
case 'u':
|
||||
case 'd':
|
||||
case 'n':
|
||||
if (file)
|
||||
case 'u':
|
||||
case 'd':
|
||||
case 'n':
|
||||
if (file)
|
||||
{
|
||||
exec = efreet_desktop_command_append_single(exec, &size,
|
||||
exec = efreet_desktop_command_append_single(exec, &size,
|
||||
&len, file, *p);
|
||||
file_added = 1;
|
||||
}
|
||||
break;
|
||||
case 'F':
|
||||
case 'U':
|
||||
case 'D':
|
||||
case 'N':
|
||||
if (file)
|
||||
case 'F':
|
||||
case 'U':
|
||||
case 'D':
|
||||
case 'N':
|
||||
if (file)
|
||||
{
|
||||
exec = efreet_desktop_command_append_multiple(exec, &size,
|
||||
exec = efreet_desktop_command_append_multiple(exec, &size,
|
||||
&len, command, *p);
|
||||
file_added = 1;
|
||||
}
|
||||
break;
|
||||
case 'i':
|
||||
exec = efreet_desktop_command_append_icon(exec, &size, &len,
|
||||
case 'i':
|
||||
exec = efreet_desktop_command_append_icon(exec, &size, &len,
|
||||
command->desktop);
|
||||
break;
|
||||
case 'c':
|
||||
case 'c':
|
||||
exec = efreet_desktop_command_append_quoted(exec, &size, &len,
|
||||
command->desktop->name);
|
||||
break;
|
||||
case 'k':
|
||||
exec = efreet_desktop_command_append_quoted(exec, &size, &len,
|
||||
case 'k':
|
||||
exec = efreet_desktop_command_append_quoted(exec, &size, &len,
|
||||
command->desktop->orig_path);
|
||||
break;
|
||||
case 'v':
|
||||
case 'm':
|
||||
printf("[Efreet]: Deprecated conversion char: '%c' in file '%s'\n",
|
||||
case 'v':
|
||||
case 'm':
|
||||
printf("[Efreet]: Deprecated conversion char: '%c' in file '%s'\n",
|
||||
*p, command->desktop->orig_path);
|
||||
break;
|
||||
case '%':
|
||||
|
@ -1384,7 +1384,7 @@ efreet_desktop_command_build(Efreet_Desktop_Command *command)
|
|||
|
||||
ecore_list_append(execs, exec);
|
||||
|
||||
/* If no file was added, then the Exec field doesn't contain any file
|
||||
/* If no file was added, then the Exec field doesn't contain any file
|
||||
* fields (fFuUdDnN). We only want to run the app once in this case. */
|
||||
if (!file_added) break;
|
||||
}
|
||||
|
@ -1397,7 +1397,7 @@ efreet_desktop_command_free(Efreet_Desktop_Command *command)
|
|||
{
|
||||
if (!command) return;
|
||||
|
||||
IF_FREE_LIST(command->files);
|
||||
IF_FREE_LIST(command->files);
|
||||
FREE(command);
|
||||
}
|
||||
|
||||
|
@ -1430,8 +1430,8 @@ efreet_desktop_command_append_quoted(char *dest, int *size, int *len, char *src)
|
|||
}
|
||||
|
||||
static char *
|
||||
efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command *command,
|
||||
efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command *command,
|
||||
char type)
|
||||
{
|
||||
Efreet_Desktop_Command_File *file;
|
||||
|
@ -1447,7 +1447,7 @@ efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
|
|||
else
|
||||
dest = efreet_string_append_char(dest, size, len, ' ');
|
||||
|
||||
dest = efreet_desktop_command_append_single(dest, size, len,
|
||||
dest = efreet_desktop_command_append_single(dest, size, len,
|
||||
file, tolower(type));
|
||||
}
|
||||
|
||||
|
@ -1455,8 +1455,8 @@ efreet_desktop_command_append_multiple(char *dest, int *size, int *len,
|
|||
}
|
||||
|
||||
static char *
|
||||
efreet_desktop_command_append_single(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command_File *file,
|
||||
efreet_desktop_command_append_single(char *dest, int *size, int *len,
|
||||
Efreet_Desktop_Command_File *file,
|
||||
char type)
|
||||
{
|
||||
char *str;
|
||||
|
@ -1488,7 +1488,7 @@ efreet_desktop_command_append_single(char *dest, int *size, int *len,
|
|||
}
|
||||
|
||||
static char *
|
||||
efreet_desktop_command_append_icon(char *dest, int *size, int *len,
|
||||
efreet_desktop_command_append_icon(char *dest, int *size, int *len,
|
||||
Efreet_Desktop *desktop)
|
||||
{
|
||||
if (!desktop->icon || !desktop->icon[0]) return dest;
|
||||
|
@ -1511,7 +1511,7 @@ efreet_string_append(char *dest, int *size, int *len, const char *src)
|
|||
|
||||
l = ecore_strlcpy(dest + *len, src, *size - *len);
|
||||
|
||||
while (l > *size - *len)
|
||||
while (l > *size - *len)
|
||||
{
|
||||
/* we successfully appended this much */
|
||||
off += *size - *len - 1;
|
||||
|
@ -1553,7 +1553,7 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
|
|||
const char *uri, *base;
|
||||
int nonlocal = 0;
|
||||
/*
|
||||
printf("FLAGS: %d, %d, %d, %d\n",
|
||||
printf("FLAGS: %d, %d, %d, %d\n",
|
||||
command->flags & EFREET_DESKTOP_EXEC_FLAG_FULLPATH ? 1 : 0,
|
||||
command->flags & EFREET_DESKTOP_EXEC_FLAG_URI ? 1 : 0,
|
||||
command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR ? 1 : 0,
|
||||
|
@ -1589,20 +1589,20 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
|
|||
{
|
||||
char buf[PATH_MAX];
|
||||
|
||||
snprintf(buf, PATH_MAX, "/tmp/%d-%d-%s", getpid(),
|
||||
snprintf(buf, PATH_MAX, "/tmp/%d-%d-%s", getpid(),
|
||||
efreet_desktop_command_file_id++, base);
|
||||
f->fullpath = strdup(buf);
|
||||
f->pending = 1;
|
||||
|
||||
ecore_file_download(uri, f->fullpath, efreet_desktop_cb_download_complete,
|
||||
ecore_file_download(uri, f->fullpath, efreet_desktop_cb_download_complete,
|
||||
efreet_desktop_cb_download_progress, f);
|
||||
}
|
||||
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_URI)
|
||||
f->uri = strdup(uri);
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR)
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR)
|
||||
f->dir = strdup("/tmp");
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE)
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE)
|
||||
f->file = strdup(base);
|
||||
}
|
||||
else
|
||||
|
@ -1618,9 +1618,9 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
|
|||
snprintf(buf, sizeof(buf), "file://%s", abs);
|
||||
f->uri = strdup(buf);
|
||||
}
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR)
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_DIR)
|
||||
f->dir = ecore_file_dir_get(abs);
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE)
|
||||
if (command->flags & EFREET_DESKTOP_EXEC_FLAG_FILE)
|
||||
f->file = strdup(ecore_file_file_get(file));
|
||||
|
||||
free(abs);
|
||||
|
@ -1637,7 +1637,7 @@ efreet_desktop_command_file_process(Efreet_Desktop_Command *command, const char
|
|||
/**
|
||||
* @brief Find the local path portion of a file uri.
|
||||
* @param uri: a uri beginning with "file:"
|
||||
* @return the location of the path portion of the uri,
|
||||
* @return the location of the path portion of the uri,
|
||||
* or NULL if the file is not on this machine
|
||||
*/
|
||||
static const char *
|
||||
|
@ -1647,7 +1647,7 @@ efreet_desktop_command_file_uri_process(const char *uri)
|
|||
int len = strlen(uri);
|
||||
|
||||
/* uri:foo/bar => relative path foo/bar*/
|
||||
if (len >= 4 && uri[5] != '/')
|
||||
if (len >= 4 && uri[5] != '/')
|
||||
path = uri + strlen("file:");
|
||||
|
||||
/* uri:/foo/bar => absolute path /foo/bar */
|
||||
|
@ -1664,14 +1664,14 @@ efreet_desktop_command_file_uri_process(const char *uri)
|
|||
if (p)
|
||||
{
|
||||
*p = '\0';
|
||||
if (!strcmp(tmp, "localhost"))
|
||||
if (!strcmp(tmp, "localhost"))
|
||||
path = uri + strlen("file://localhost");
|
||||
else
|
||||
else
|
||||
{
|
||||
int ret;
|
||||
|
||||
ret = gethostname(hostname, PATH_MAX);
|
||||
if ((ret == 0) && !strcmp(tmp, hostname))
|
||||
ret = gethostname(hostname, PATH_MAX);
|
||||
if ((ret == 0) && !strcmp(tmp, hostname))
|
||||
path = uri + strlen("file://") + strlen(hostname);
|
||||
}
|
||||
}
|
||||
|
@ -1700,7 +1700,7 @@ efreet_desktop_command_file_free(Efreet_Desktop_Command_File *file)
|
|||
|
||||
|
||||
static void
|
||||
efreet_desktop_cb_download_complete(void *data, const char *file __UNUSED__,
|
||||
efreet_desktop_cb_download_complete(void *data, const char *file __UNUSED__,
|
||||
int status __UNUSED__)
|
||||
{
|
||||
Efreet_Desktop_Command_File *f;
|
||||
|
@ -1731,8 +1731,8 @@ efreet_desktop_cb_download_progress(void *data,
|
|||
|
||||
dcf = data;
|
||||
if (dcf->command->cb_progress)
|
||||
return dcf->command->cb_progress(dcf->command->data,
|
||||
dcf->command->desktop,
|
||||
return dcf->command->cb_progress(dcf->command->data,
|
||||
dcf->command->desktop,
|
||||
dcf->uri, dltotal, dlnow);
|
||||
|
||||
return 0;
|
||||
|
|
|
@ -6,10 +6,10 @@
|
|||
|
||||
/**
|
||||
* @file efreet_desktop.h
|
||||
* @brief Contains the structures and methods used to support the
|
||||
* @brief Contains the structures and methods used to support the
|
||||
* FDO desktop entry specificiation.
|
||||
* @addtogroup Efreet_Desktop Efreet_Desktop: The FDO Desktop Entry
|
||||
* Specification functions and structures
|
||||
* Specification functions and structures
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
@ -31,13 +31,13 @@ typedef struct Efreet_Desktop Efreet_Desktop;
|
|||
/**
|
||||
* A callback used with efreet_desktop_command_get()
|
||||
*/
|
||||
typedef void (*Efreet_Desktop_Command_Cb) (void *data, Efreet_Desktop *desktop,
|
||||
typedef void (*Efreet_Desktop_Command_Cb) (void *data, Efreet_Desktop *desktop,
|
||||
char *command, int remaining);
|
||||
|
||||
/**
|
||||
* A callback used to get download progress of remote uris
|
||||
*/
|
||||
typedef int (*Efreet_Desktop_Progress_Cb) (void *data, Efreet_Desktop *desktop,
|
||||
typedef int (*Efreet_Desktop_Progress_Cb) (void *data, Efreet_Desktop *desktop,
|
||||
char *uri, long int total, long int current);
|
||||
|
||||
/**
|
||||
|
@ -62,14 +62,14 @@ typedef void *(*Efreet_Desktop_Type_Free_Cb) (void *data);
|
|||
struct Efreet_Desktop
|
||||
{
|
||||
int type; /**< type of desktop file */
|
||||
|
||||
|
||||
int ref; /**< reference count - internal */
|
||||
int cache_flush; /**< cache flush value - internal */
|
||||
|
||||
double version; /**< version of spec file conforms to */
|
||||
|
||||
char *orig_path; /**< original path to .desktop file */
|
||||
long long load_time; /**< modified time of .desktop on disk */
|
||||
long long load_time; /**< modified time of .desktop on disk */
|
||||
|
||||
char *name; /**< Specific name of the application */
|
||||
char *generic_name; /**< Generic name of the application */
|
||||
|
@ -82,9 +82,9 @@ struct Efreet_Desktop
|
|||
the given string as it's WM class or WM name */
|
||||
char *url; /**< URL to access if type is EFREET_TYPE_LINK */
|
||||
|
||||
Ecore_List *only_show_in; /**< list of environments that should
|
||||
Ecore_List *only_show_in; /**< list of environments that should
|
||||
display the icon */
|
||||
Ecore_List *not_show_in; /**< list of environments that shoudn't
|
||||
Ecore_List *not_show_in; /**< list of environments that shoudn't
|
||||
display the icon */
|
||||
Ecore_List *categories; /**< Categories in which item should be shown */
|
||||
Ecore_List *mime_types; /**< The mime types supppored by this app */
|
||||
|
@ -106,10 +106,10 @@ Efreet_Desktop *efreet_desktop_new(const char *file);
|
|||
void efreet_desktop_free(Efreet_Desktop *desktop);
|
||||
|
||||
int efreet_desktop_save(Efreet_Desktop *desktop);
|
||||
int efreet_desktop_save_as(Efreet_Desktop *desktop,
|
||||
int efreet_desktop_save_as(Efreet_Desktop *desktop,
|
||||
const char *file);
|
||||
|
||||
void efreet_desktop_exec(Efreet_Desktop *desktop,
|
||||
void efreet_desktop_exec(Efreet_Desktop *desktop,
|
||||
Ecore_List *files, void *data);
|
||||
|
||||
void efreet_desktop_environment_set(const char *environment);
|
||||
|
@ -131,9 +131,9 @@ void efreet_desktop_category_add(Efreet_Desktop *desktop,
|
|||
int efreet_desktop_category_del(Efreet_Desktop *desktop,
|
||||
const char *category);
|
||||
|
||||
int efreet_desktop_type_add(const char *type,
|
||||
Efreet_Desktop_Type_Parse_Cb parse_func,
|
||||
Efreet_Desktop_Type_Save_Cb save_func,
|
||||
int efreet_desktop_type_add(const char *type,
|
||||
Efreet_Desktop_Type_Parse_Cb parse_func,
|
||||
Efreet_Desktop_Type_Save_Cb save_func,
|
||||
Efreet_Desktop_Type_Free_Cb free_func);
|
||||
int efreet_desktop_type_alias (int from_type,
|
||||
const char *alias);
|
||||
|
@ -142,10 +142,9 @@ void *efreet_desktop_type_data_get(Efreet_Desktop *desktop);
|
|||
Ecore_List *efreet_desktop_string_list_parse(const char *string);
|
||||
char *efreet_desktop_string_list_join(Ecore_List *list);
|
||||
void efreet_desktop_cache_flush(void);
|
||||
|
||||
/**
|
||||
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -338,7 +338,7 @@ efreet_icon_path_find(const char *theme_name, const char *icon, const char *size
|
|||
char key[4096];
|
||||
Efreet_Icon_Cache *cache;
|
||||
Efreet_Icon_Theme *theme;
|
||||
|
||||
|
||||
snprintf(key, sizeof(key), "%s %s %s", theme_name, icon, size);
|
||||
cache = ecore_list_find(efreet_icon_cache, ECORE_COMPARE_CB(efreet_icon_cache_find), key);
|
||||
if (cache)
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
* @file efreet_icon.h
|
||||
* @brief Contains the structures and methods used to support the FDO icon
|
||||
* theme specificiation.
|
||||
* @addtogroup Efreet_Icon Efreet_Icon: The FDO Icon Theme
|
||||
* Specification functions and structures
|
||||
* @addtogroup Efreet_Icon Efreet_Icon: The FDO Icon Theme
|
||||
* Specification functions and structures
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
@ -30,9 +30,9 @@ enum Efreet_Icon_Theme_Context
|
|||
typedef enum Efreet_Icon_Theme_Context Efreet_Icon_Theme_Context;
|
||||
|
||||
/**
|
||||
* The possible size types for an icon directory
|
||||
* The possible size types for an icon directory
|
||||
*/
|
||||
enum Efreet_Icon_Size_Type
|
||||
enum Efreet_Icon_Size_Type
|
||||
{
|
||||
EFREET_ICON_SIZE_TYPE_NONE,
|
||||
EFREET_ICON_SIZE_TYPE_FIXED,
|
||||
|
@ -51,8 +51,8 @@ typedef enum Efreet_Icon_Size_Type Efreet_Icon_Size_Type;
|
|||
typedef struct Efreet_Icon_Theme Efreet_Icon_Theme;
|
||||
|
||||
/**
|
||||
* Efreet_Icon_Theme
|
||||
* @brief contains all of the known information about a given theme
|
||||
* Efreet_Icon_Theme
|
||||
* @brief contains all of the known information about a given theme
|
||||
*/
|
||||
struct Efreet_Icon_Theme
|
||||
{
|
||||
|
@ -82,8 +82,8 @@ struct Efreet_Icon_Theme
|
|||
|
||||
unsigned char hidden:1; /**< Should this theme be hidden from users */
|
||||
unsigned char valid:1; /**< Have we seen an index for this theme */
|
||||
unsigned char fake:1; /**< This isnt' a real theme but the user has
|
||||
tried to query from it. We create the
|
||||
unsigned char fake:1; /**< This isnt' a real theme but the user has
|
||||
tried to query from it. We create the
|
||||
fake one to give us the theme cache. */
|
||||
};
|
||||
|
||||
|
@ -93,7 +93,7 @@ struct Efreet_Icon_Theme
|
|||
typedef struct Efreet_Icon_Theme_Directory Efreet_Icon_Theme_Directory;
|
||||
|
||||
/**
|
||||
* Efreet_Icon_Theme_Directory
|
||||
* Efreet_Icon_Theme_Directory
|
||||
* @brief Contains all the information about a sub-directory of a theme
|
||||
*/
|
||||
struct Efreet_Icon_Theme_Directory
|
||||
|
@ -112,18 +112,18 @@ struct Efreet_Icon_Theme_Directory
|
|||
};
|
||||
|
||||
/**
|
||||
* Efreet_Icon
|
||||
* Efreet_Icon
|
||||
*/
|
||||
typedef struct Efreet_Icon Efreet_Icon;
|
||||
|
||||
/**
|
||||
* Efreet_Icon
|
||||
* Efreet_Icon
|
||||
* @brief Contains all the information about a given icon
|
||||
*/
|
||||
struct Efreet_Icon
|
||||
{
|
||||
char *path; /**< Full path to the icon */
|
||||
char *name; /**< Translated UTF8 string that can
|
||||
char *name; /**< Translated UTF8 string that can
|
||||
be used for the icon name */
|
||||
|
||||
struct
|
||||
|
@ -132,10 +132,10 @@ struct Efreet_Icon
|
|||
y0, /**< y0 position */
|
||||
x1, /**< x1 position */
|
||||
y1; /**< y1 position */
|
||||
} embedded_text_rectangle; /**< Rectangle where text can
|
||||
} embedded_text_rectangle; /**< Rectangle where text can
|
||||
be displayed on the icon */
|
||||
|
||||
Ecore_List *attach_points; /**< List of points to be used as anchor
|
||||
Ecore_List *attach_points; /**< List of points to be used as anchor
|
||||
points for emblems/overlays */
|
||||
|
||||
unsigned int ref_count; /**< References to this icon */
|
||||
|
@ -149,7 +149,7 @@ struct Efreet_Icon
|
|||
typedef struct Efreet_Icon_Point Efreet_Icon_Point;
|
||||
|
||||
/**
|
||||
* Efreet_Point
|
||||
* Efreet_Point
|
||||
* @brief Stores an x, y point.
|
||||
*/
|
||||
struct Efreet_Icon_Point
|
||||
|
@ -164,18 +164,17 @@ void efreet_icon_extension_add(const char *ext);
|
|||
Ecore_List *efreet_icon_extra_list_get(void);
|
||||
Ecore_List *efreet_icon_theme_list_get(void);
|
||||
Efreet_Icon_Theme *efreet_icon_theme_find(const char *theme_name);
|
||||
Efreet_Icon *efreet_icon_find(const char *theme_name, const char *icon,
|
||||
Efreet_Icon *efreet_icon_find(const char *theme_name, const char *icon,
|
||||
const char *size);
|
||||
char *efreet_icon_list_find(const char *theme_name,
|
||||
Ecore_List *icons,
|
||||
char *efreet_icon_list_find(const char *theme_name,
|
||||
Ecore_List *icons,
|
||||
const char *size);
|
||||
char *efreet_icon_path_find(const char *theme, const char *icon,
|
||||
const char *size);
|
||||
void efreet_icon_free(Efreet_Icon *icon);
|
||||
|
||||
/**
|
||||
/**
|
||||
* @}
|
||||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -45,8 +45,8 @@ efreet_ini_shutdown(void)
|
|||
* @return Returns a new Efreet_Ini structure initialized with the contents
|
||||
* of @a file, or NULL on memory allocation failure
|
||||
* @brief Creates and initializes a new Ini structure with the contents of
|
||||
* @a file, or NULL on failure
|
||||
*/
|
||||
* @a file, or NULL on failure
|
||||
*/
|
||||
Efreet_Ini *
|
||||
efreet_ini_new(const char *file)
|
||||
{
|
||||
|
@ -91,7 +91,7 @@ efreet_ini_parse(const char *file)
|
|||
|
||||
/* the current buffer to parse */
|
||||
char *buf;
|
||||
|
||||
|
||||
Ecore_Hash *data, *section = NULL;
|
||||
|
||||
/* start with the static buffer */
|
||||
|
@ -109,7 +109,7 @@ efreet_ini_parse(const char *file)
|
|||
|
||||
/* if a line is longer than the buffer size, this \n will get overwritten. */
|
||||
read_buf[read_len - 2] = '\n';
|
||||
while (fgets(read_buf, read_len, f) != NULL)
|
||||
while (fgets(read_buf, read_len, f) != NULL)
|
||||
{
|
||||
char *key, *value, *p;
|
||||
char *sep;
|
||||
|
@ -120,7 +120,7 @@ efreet_ini_parse(const char *file)
|
|||
int len;
|
||||
len = strlen(buf);
|
||||
|
||||
if (!big_buf)
|
||||
if (!big_buf)
|
||||
{
|
||||
/* create new big buffer and copy in contents of static buf */
|
||||
big_buf_len = 2 * big_buf_step;
|
||||
|
@ -169,7 +169,7 @@ efreet_ini_parse(const char *file)
|
|||
old = ecore_hash_remove(data, header);
|
||||
//if (old) printf("[efreet] Warning: duplicate section '%s' in file '%s'\n", header, file);
|
||||
IF_FREE_HASH(old);
|
||||
ecore_hash_set(data, (void *)ecore_string_instance(header),
|
||||
ecore_hash_set(data, (void *)ecore_string_instance(header),
|
||||
section);
|
||||
}
|
||||
else
|
||||
|
@ -202,7 +202,7 @@ efreet_ini_parse(const char *file)
|
|||
while (p > value && (*p == '\n' || *p == '\r')) p--;
|
||||
*(p + 1) = '\0';
|
||||
|
||||
if (key && value && *key && *value)
|
||||
if (key && value && *key && *value)
|
||||
{
|
||||
char *old;
|
||||
|
||||
|
@ -210,7 +210,7 @@ efreet_ini_parse(const char *file)
|
|||
//if (old) printf("[efreet] Warning: duplicate key '%s' in file '%s'\n", key, file);
|
||||
IF_FREE(old);
|
||||
|
||||
ecore_hash_set(section, (void *)ecore_string_instance(key),
|
||||
ecore_hash_set(section, (void *)ecore_string_instance(key),
|
||||
efreet_ini_unescape(value));
|
||||
}
|
||||
}
|
||||
|
@ -484,7 +484,7 @@ efreet_ini_boolean_set(Efreet_Ini *ini, const char *key, unsigned int value)
|
|||
* @internal
|
||||
* @param ini: The ini struct to work with
|
||||
* @param key: The key to search for
|
||||
* @return Returns the utf8 encoded string associated with @a key, or NULL
|
||||
* @return Returns the utf8 encoded string associated with @a key, or NULL
|
||||
* if none found
|
||||
* @brief Retrieves the utf8 encoded string associated with @a key in the current locale or NULL if none found
|
||||
*/
|
||||
|
|
|
@ -6,7 +6,7 @@
|
|||
* @internal
|
||||
* @file efreet_ini.h
|
||||
* @brief A simple and fast INI parser
|
||||
* @addtogroup Efreet_Ini Efreet_Ini: An INI parser
|
||||
* @addtogroup Efreet_Ini Efreet_Ini: An INI parser
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
@ -17,7 +17,7 @@
|
|||
typedef struct Efreet_Ini Efreet_Ini;
|
||||
|
||||
/**
|
||||
* Efreet_Ini
|
||||
* Efreet_Ini
|
||||
* @brief Contains all the information about an ini file.
|
||||
*/
|
||||
struct Efreet_Ini
|
||||
|
@ -34,22 +34,22 @@ int efreet_ini_section_set(Efreet_Ini *ini, const char *section);
|
|||
void efreet_ini_section_add(Efreet_Ini *ini, const char *section);
|
||||
|
||||
const char *efreet_ini_string_get(Efreet_Ini *ini, const char *key);
|
||||
void efreet_ini_string_set(Efreet_Ini *ini, const char *key,
|
||||
void efreet_ini_string_set(Efreet_Ini *ini, const char *key,
|
||||
const char *value);
|
||||
|
||||
const char *efreet_ini_localestring_get(Efreet_Ini *ini, const char *key);
|
||||
void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key,
|
||||
void efreet_ini_localestring_set(Efreet_Ini *ini, const char *key,
|
||||
const char *value);
|
||||
|
||||
unsigned int efreet_ini_boolean_get(Efreet_Ini *ini, const char *key);
|
||||
void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key,
|
||||
void efreet_ini_boolean_set(Efreet_Ini *ini, const char *key,
|
||||
unsigned int value);
|
||||
|
||||
int efreet_ini_int_get(Efreet_Ini *ini, const char *key);
|
||||
void efreet_ini_int_set(Efreet_Ini *ini, const char *key, int value);
|
||||
|
||||
double efreet_ini_double_get(Efreet_Ini *ini, const char *key);
|
||||
void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
|
||||
void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
|
||||
double value);
|
||||
|
||||
/**
|
||||
|
@ -57,4 +57,3 @@ void efreet_ini_double_set(Efreet_Ini *ini, const char *key,
|
|||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -119,7 +119,7 @@ enum Efreet_Menu_Filter_Type
|
|||
typedef enum Efreet_Menu_Filter_Type Efreet_Menu_Filter_Type;
|
||||
|
||||
/**
|
||||
* Efreet_Menu_Filter_Op
|
||||
* Efreet_Menu_Filter_Op
|
||||
*/
|
||||
typedef struct Efreet_Menu_Filter_Op Efreet_Menu_Filter_Op;
|
||||
|
||||
|
@ -145,7 +145,7 @@ typedef struct Efreet_Menu_Filter Efreet_Menu_Filter;
|
|||
|
||||
/**
|
||||
* Efreet_Menu_Filter
|
||||
* Stores information on a filter
|
||||
* Stores information on a filter
|
||||
*/
|
||||
struct Efreet_Menu_Filter
|
||||
{
|
||||
|
@ -176,7 +176,7 @@ typedef struct Efreet_Menu_Layout Efreet_Menu_Layout;
|
|||
|
||||
/**
|
||||
* Efreet_Menu_Layout
|
||||
* Stores information on a layout
|
||||
* Stores information on a layout
|
||||
*/
|
||||
struct Efreet_Menu_Layout
|
||||
{
|
||||
|
@ -222,7 +222,7 @@ static Ecore_Hash *efreet_menu_layout_cbs = NULL;
|
|||
static const char *efreet_menu_prefix_get(void);
|
||||
|
||||
static Efreet_Menu_Internal *efreet_menu_by_name_find(Efreet_Menu_Internal *internal,
|
||||
const char *name,
|
||||
const char *name,
|
||||
Efreet_Menu_Internal **parent);
|
||||
static int efreet_menu_cb_compare_names(Efreet_Menu_Internal *internal, const char *name);
|
||||
static int efreet_menu_cb_md_compare_ids(Efreet_Menu_Desktop *md, const char *name);
|
||||
|
@ -235,17 +235,17 @@ static int efreet_menu_cb_move_compare(Efreet_Menu_Move *move, const char *old);
|
|||
static int efreet_menu_process(Efreet_Menu_Internal *internal, unsigned int only_unallocated);
|
||||
static int efreet_menu_process_dirs(Efreet_Menu_Internal *internal);
|
||||
static int efreet_menu_app_dirs_process(Efreet_Menu_Internal *internal);
|
||||
static int efreet_menu_app_dir_scan(Efreet_Menu_Internal *internal,
|
||||
static int efreet_menu_app_dir_scan(Efreet_Menu_Internal *internal,
|
||||
const char *path,
|
||||
const char *id,
|
||||
int legacy);
|
||||
static int efreet_menu_directory_dirs_process(Efreet_Menu_Internal *internal);
|
||||
static int efreet_menu_directory_dir_scan(const char *path,
|
||||
const char *relative_path,
|
||||
static int efreet_menu_directory_dir_scan(const char *path,
|
||||
const char *relative_path,
|
||||
Ecore_Hash *cache);
|
||||
static Efreet_Desktop *efreet_menu_directory_get(Efreet_Menu_Internal *internal,
|
||||
static Efreet_Desktop *efreet_menu_directory_get(Efreet_Menu_Internal *internal,
|
||||
const char *path);
|
||||
static void efreet_menu_process_filters(Efreet_Menu_Internal *internal,
|
||||
static void efreet_menu_process_filters(Efreet_Menu_Internal *internal,
|
||||
unsigned int only_unallocated);
|
||||
static void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications,
|
||||
Ecore_Hash *matches,
|
||||
|
@ -322,9 +322,9 @@ static int efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xm
|
|||
static int efreet_menu_handle_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
|
||||
static int efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
|
||||
static int efreet_menu_handle_legacy_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
|
||||
static Efreet_Menu_Internal *efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
|
||||
Efreet_Menu_Internal *parent,
|
||||
const char *legacy_dir,
|
||||
static Efreet_Menu_Internal *efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
|
||||
Efreet_Menu_Internal *parent,
|
||||
const char *legacy_dir,
|
||||
const char *prefix);
|
||||
static int efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
|
||||
static int efreet_menu_handle_move(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
|
||||
|
@ -333,10 +333,10 @@ static int efreet_menu_handle_new(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
static int efreet_menu_handle_layout(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
|
||||
static int efreet_menu_handle_default_layout(Efreet_Menu_Internal *parent, Efreet_Xml *xml);
|
||||
|
||||
static int efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
|
||||
static int efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
|
||||
Efreet_Menu_Filter_Type type);
|
||||
static int efreet_menu_handle_filter_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml);
|
||||
static int efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
|
||||
static int efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
|
||||
Efreet_Menu_Filter_Op_Type type);
|
||||
|
||||
static int efreet_menu_handle_layout_menuname(Efreet_Menu_Internal *parent, Efreet_Xml *xml, int def);
|
||||
|
@ -441,17 +441,17 @@ efreet_menu_init(void)
|
|||
efreet_menu_filter_cbs = ecore_hash_new(NULL, NULL);
|
||||
efreet_menu_move_cbs = ecore_hash_new(NULL, NULL);
|
||||
efreet_menu_layout_cbs = ecore_hash_new(NULL, NULL);
|
||||
if (!efreet_menu_handle_cbs || !efreet_menu_filter_cbs
|
||||
|| !efreet_menu_move_cbs || !efreet_menu_layout_cbs)
|
||||
if (!efreet_menu_handle_cbs || !efreet_menu_filter_cbs
|
||||
|| !efreet_menu_move_cbs || !efreet_menu_layout_cbs)
|
||||
return 0;
|
||||
|
||||
ecore_hash_free_key_cb_set(efreet_menu_handle_cbs,
|
||||
ecore_hash_free_key_cb_set(efreet_menu_handle_cbs,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
ecore_hash_free_key_cb_set(efreet_menu_filter_cbs,
|
||||
ecore_hash_free_key_cb_set(efreet_menu_filter_cbs,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
ecore_hash_free_key_cb_set(efreet_menu_move_cbs,
|
||||
ecore_hash_free_key_cb_set(efreet_menu_move_cbs,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
ecore_hash_free_key_cb_set(efreet_menu_layout_cbs,
|
||||
ecore_hash_free_key_cb_set(efreet_menu_layout_cbs,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
|
||||
/* set Menu into it's own so we can check the XML is valid before trying
|
||||
|
@ -459,22 +459,22 @@ efreet_menu_init(void)
|
|||
efreet_tag_menu = ecore_string_instance(menu_cbs[0].key);
|
||||
|
||||
for (i = 0; menu_cbs[i].key != NULL; i++)
|
||||
ecore_hash_set(efreet_menu_handle_cbs,
|
||||
ecore_hash_set(efreet_menu_handle_cbs,
|
||||
(void *)ecore_string_instance(menu_cbs[i].key),
|
||||
menu_cbs[i].cb);
|
||||
|
||||
for (i = 0; filter_cbs[i].key != NULL; i++)
|
||||
ecore_hash_set(efreet_menu_filter_cbs,
|
||||
ecore_hash_set(efreet_menu_filter_cbs,
|
||||
(void *)ecore_string_instance(filter_cbs[i].key),
|
||||
filter_cbs[i].cb);
|
||||
|
||||
for (i = 0; move_cbs[i].key != NULL; i++)
|
||||
ecore_hash_set(efreet_menu_move_cbs,
|
||||
ecore_hash_set(efreet_menu_move_cbs,
|
||||
(void *)ecore_string_instance(move_cbs[i].key),
|
||||
move_cbs[i].cb);
|
||||
|
||||
for (i = 0; layout_cbs[i].key != NULL; i++)
|
||||
ecore_hash_set(efreet_menu_layout_cbs,
|
||||
ecore_hash_set(efreet_menu_layout_cbs,
|
||||
(void *)ecore_string_instance(layout_cbs[i].key),
|
||||
layout_cbs[i].cb);
|
||||
|
||||
|
@ -483,7 +483,7 @@ efreet_menu_init(void)
|
|||
|
||||
/**
|
||||
* @return Returns no value
|
||||
* @brief Initialize legacy kde support. This function blocks while
|
||||
* @brief Initialize legacy kde support. This function blocks while
|
||||
* the kde-config script is run.
|
||||
*/
|
||||
int
|
||||
|
@ -492,17 +492,17 @@ efreet_menu_kde_legacy_init(void)
|
|||
FILE *f;
|
||||
char buf[PATH_MAX];
|
||||
char *p, *s;
|
||||
|
||||
|
||||
IF_FREE_LIST(efreet_menu_kde_legacy_dirs);
|
||||
|
||||
f = popen("kde-config --path apps", "r");
|
||||
if (!f) return 0;
|
||||
|
||||
efreet_menu_kde_legacy_dirs = ecore_list_new();
|
||||
ecore_list_free_cb_set(efreet_menu_kde_legacy_dirs,
|
||||
ecore_list_free_cb_set(efreet_menu_kde_legacy_dirs,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
|
||||
/* XXX if the return from kde-config is a line longer than PATH_MAX,
|
||||
/* XXX if the return from kde-config is a line longer than PATH_MAX,
|
||||
* this won't be correct (increase buffer and get the rest...) */
|
||||
if (!fgets(buf, PATH_MAX, f))
|
||||
{
|
||||
|
@ -515,14 +515,14 @@ efreet_menu_kde_legacy_init(void)
|
|||
while (p)
|
||||
{
|
||||
*p = '\0';
|
||||
ecore_list_append(efreet_menu_kde_legacy_dirs,
|
||||
ecore_list_append(efreet_menu_kde_legacy_dirs,
|
||||
(void *)ecore_string_instance(s));
|
||||
s = p + 1;
|
||||
p = strchr(s, ':');
|
||||
}
|
||||
|
||||
if (*s)
|
||||
ecore_list_append(efreet_menu_kde_legacy_dirs,
|
||||
if (*s)
|
||||
ecore_list_append(efreet_menu_kde_legacy_dirs,
|
||||
(void *)ecore_string_instance(s));
|
||||
|
||||
pclose(f);
|
||||
|
@ -576,7 +576,7 @@ efreet_menu_get(void)
|
|||
Ecore_List *config_dirs;
|
||||
|
||||
/* check the users config directory first */
|
||||
snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
|
||||
snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
|
||||
efreet_config_home_get(), efreet_menu_prefix_get());
|
||||
if (ecore_file_exists(menu))
|
||||
return efreet_menu_parse(menu);
|
||||
|
@ -586,7 +586,7 @@ efreet_menu_get(void)
|
|||
ecore_list_first_goto(config_dirs);
|
||||
while ((dir = ecore_list_next(config_dirs)))
|
||||
{
|
||||
snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
|
||||
snprintf(menu, sizeof(menu), "%s/menus/%sapplications.menu",
|
||||
dir, efreet_menu_prefix_get());
|
||||
if (ecore_file_exists(menu))
|
||||
return efreet_menu_parse(menu);
|
||||
|
@ -842,8 +842,8 @@ efreet_menu_desktop_insert(Efreet_Menu *menu, Efreet_Desktop *desktop, int pos)
|
|||
* @brief Remove a desktop element in a menu structure. Only accepts desktop files
|
||||
* in default directories.
|
||||
*/
|
||||
int
|
||||
efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
|
||||
int
|
||||
efreet_menu_desktop_remove(Efreet_Menu *menu, Efreet_Desktop *desktop)
|
||||
{
|
||||
Efreet_Menu *entry;
|
||||
|
||||
|
@ -912,7 +912,7 @@ efreet_menu_dump(Efreet_Menu *menu, const char *indent)
|
|||
* dir, system dirs and given suffix.
|
||||
*/
|
||||
Ecore_List *
|
||||
efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs,
|
||||
efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs,
|
||||
const char *suffix)
|
||||
{
|
||||
const char *xdg_dir;
|
||||
|
@ -938,7 +938,7 @@ efreet_default_dirs_get(const char *user_dir, Ecore_List *system_dirs,
|
|||
/**
|
||||
* @internal
|
||||
* @return Returns a new Efreet_Menu_Internal struct
|
||||
* @brief Allocates and initializes a new Efreet_Menu_Internal structure
|
||||
* @brief Allocates and initializes a new Efreet_Menu_Internal structure
|
||||
*/
|
||||
static Efreet_Menu_Internal *
|
||||
efreet_menu_internal_new(void)
|
||||
|
@ -958,13 +958,13 @@ efreet_menu_internal_new(void)
|
|||
/**
|
||||
* @param menu: The menu to free
|
||||
* @return Returns no value
|
||||
* @brief Frees up the given menu structure
|
||||
* @brief Frees up the given menu structure
|
||||
*/
|
||||
void
|
||||
efreet_menu_internal_free(Efreet_Menu_Internal *internal)
|
||||
{
|
||||
if (!internal) return;
|
||||
|
||||
|
||||
IF_FREE(internal->file.path);
|
||||
IF_FREE(internal->file.name);
|
||||
|
||||
|
@ -1015,7 +1015,7 @@ efreet_menu_prefix_get(void)
|
|||
* @param xml: The xml dom tree to populate from
|
||||
* @return Returns 1 if this XML tree is valid, 0 otherwise
|
||||
* @brief Populates the given menu from the given xml structure
|
||||
*
|
||||
*
|
||||
* We walk the Menu children backwards. The reason for this is so that we
|
||||
* can deal with all the things that make us select the 'last' element
|
||||
* (MergeFile, Directory, etc). We'll see the last one first and can deal
|
||||
|
@ -1050,8 +1050,8 @@ efreet_menu_handle_menu(Efreet_Menu_Internal *internal, Efreet_Xml *xml)
|
|||
* @param parent: The parent Menu
|
||||
* @param xml: The xml that defines the menu
|
||||
* @return Returns 1 on success or 0 on failure
|
||||
* @brief Handles the sub-menu nodes of the XML file
|
||||
*/
|
||||
* @brief Handles the sub-menu nodes of the XML file
|
||||
*/
|
||||
static int
|
||||
efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
||||
{
|
||||
|
@ -1069,7 +1069,7 @@ efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
|
||||
/* if this menu already exists we just take this one and stick it on the
|
||||
* start of the existing one */
|
||||
if ((match = ecore_list_find(parent->sub_menus,
|
||||
if ((match = ecore_list_find(parent->sub_menus,
|
||||
ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), internal)))
|
||||
{
|
||||
|
||||
|
@ -1087,7 +1087,7 @@ efreet_menu_handle_sub_menu(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
* @param parent: The parent menu
|
||||
* @param xml: The xml tree
|
||||
* @return Returns 1 on success or 0 on failure
|
||||
* @brief Handles the AppDir tag
|
||||
* @brief Handles the AppDir tag
|
||||
*/
|
||||
static int
|
||||
efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
||||
|
@ -1102,7 +1102,7 @@ efreet_menu_handle_app_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
if (!path) return 0;
|
||||
|
||||
/* we've already got this guy in our list we can skip it */
|
||||
if (ecore_list_find(parent->app_dirs,
|
||||
if (ecore_list_find(parent->app_dirs,
|
||||
ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), path))
|
||||
{
|
||||
FREE(path);
|
||||
|
@ -1141,7 +1141,7 @@ efreet_menu_handle_default_app_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xm
|
|||
{
|
||||
Efreet_Menu_App_Dir *app_dir;
|
||||
|
||||
if (ecore_list_find(parent->app_dirs,
|
||||
if (ecore_list_find(parent->app_dirs,
|
||||
ECORE_COMPARE_CB(efreet_menu_cb_app_dirs_compare), dir))
|
||||
continue;
|
||||
|
||||
|
@ -1203,7 +1203,7 @@ efreet_menu_handle_default_directory_dirs(Efreet_Menu_Internal *parent, Efreet_X
|
|||
if (!parent) return 0;
|
||||
|
||||
efreet_menu_create_directory_dirs_list(parent);
|
||||
dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
|
||||
dirs = efreet_default_dirs_get(efreet_data_home_get(), efreet_data_dirs_get(),
|
||||
"desktop-directories");
|
||||
ecore_list_first_goto(dirs);
|
||||
while ((dir = ecore_list_next(dirs)))
|
||||
|
@ -1230,7 +1230,7 @@ static int
|
|||
efreet_menu_handle_name(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
||||
{
|
||||
/* not allowed to have two Name settings in a menu */
|
||||
if (parent->name.internal)
|
||||
if (parent->name.internal)
|
||||
{
|
||||
printf("efreet_menu_handle_name() setting second name into menu\n");
|
||||
return 0;
|
||||
|
@ -1354,12 +1354,12 @@ efreet_menu_handle_not_deleted(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
* @param parent: The parent menu
|
||||
* @param xml: The XML tree to work with
|
||||
* @return Returns 1 on success or 0 on failure
|
||||
* @brief Handles parsing the Include tag and all subtags
|
||||
* @brief Handles parsing the Include tag and all subtags
|
||||
*/
|
||||
static int
|
||||
efreet_menu_handle_include(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
||||
{
|
||||
return efreet_menu_handle_filter(parent, xml,
|
||||
return efreet_menu_handle_filter(parent, xml,
|
||||
EFREET_MENU_FILTER_INCLUDE);
|
||||
}
|
||||
|
||||
|
@ -1373,7 +1373,7 @@ efreet_menu_handle_include(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
static int
|
||||
efreet_menu_handle_exclude(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
||||
{
|
||||
return efreet_menu_handle_filter(parent, xml,
|
||||
return efreet_menu_handle_filter(parent, xml,
|
||||
EFREET_MENU_FILTER_EXCLUDE);
|
||||
}
|
||||
|
||||
|
@ -1442,7 +1442,7 @@ efreet_menu_handle_all(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
|
|||
|
||||
/**
|
||||
* @internal
|
||||
* @param op: The filter operation
|
||||
* @param op: The filter operation
|
||||
* @param xml: The xml tree
|
||||
* @return Returns 1 on success or 0 on failure
|
||||
* @brief Handles the And tag and all subtags
|
||||
|
@ -1452,7 +1452,7 @@ efreet_menu_handle_and(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
|
|||
{
|
||||
if (!op || !xml) return 0;
|
||||
|
||||
return efreet_menu_handle_filter_child_op(op, xml,
|
||||
return efreet_menu_handle_filter_child_op(op, xml,
|
||||
EFREET_MENU_FILTER_OP_AND);
|
||||
}
|
||||
|
||||
|
@ -1468,7 +1468,7 @@ efreet_menu_handle_or(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
|
|||
{
|
||||
if (!op || !xml) return 0;
|
||||
|
||||
return efreet_menu_handle_filter_child_op(op, xml,
|
||||
return efreet_menu_handle_filter_child_op(op, xml,
|
||||
EFREET_MENU_FILTER_OP_OR);
|
||||
}
|
||||
|
||||
|
@ -1484,7 +1484,7 @@ efreet_menu_handle_not(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml)
|
|||
{
|
||||
if (!op || !xml) return 0;
|
||||
|
||||
return efreet_menu_handle_filter_child_op(op, xml,
|
||||
return efreet_menu_handle_filter_child_op(op, xml,
|
||||
EFREET_MENU_FILTER_OP_NOT);
|
||||
}
|
||||
|
||||
|
@ -1522,7 +1522,7 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
const char *dir, *p;
|
||||
int len = 0;
|
||||
|
||||
if (!parent->file.path)
|
||||
if (!parent->file.path)
|
||||
{
|
||||
printf("efreet_menu_handle_merge_file() missing menu path ...\n");
|
||||
return 0;
|
||||
|
@ -1567,9 +1567,9 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
{
|
||||
char file[PATH_MAX];
|
||||
|
||||
snprintf(file, sizeof(file), "%s/%s/%s", dir, (p ? p : ""),
|
||||
parent->file.name);
|
||||
if (ecore_file_exists(file))
|
||||
snprintf(file, sizeof(file), "%s/%s/%s", dir, (p ? p : ""),
|
||||
parent->file.name);
|
||||
if (ecore_file_exists(file))
|
||||
{
|
||||
path = strdup(file);
|
||||
break;
|
||||
|
@ -1592,7 +1592,7 @@ efreet_menu_handle_merge_file(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
* @internal
|
||||
* @param parent: The parent menu to merge into
|
||||
* @param xml: The XML to be merged
|
||||
* @param path: The path to the .menu file to merge
|
||||
* @param path: The path to the .menu file to merge
|
||||
*/
|
||||
static int
|
||||
efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *path)
|
||||
|
@ -1607,7 +1607,7 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
|
|||
if (!ecore_file_exists(path)) return 1;
|
||||
|
||||
realpath = ecore_file_realpath(path);
|
||||
if (realpath[0] == '\0')
|
||||
if (realpath[0] == '\0')
|
||||
{
|
||||
printf("efreet_menu_merge() unable to get real path for %s\n", path);
|
||||
return 0;
|
||||
|
@ -1622,7 +1622,7 @@ efreet_menu_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *pat
|
|||
merge_xml = efreet_xml_new(realpath);
|
||||
FREE(realpath);
|
||||
|
||||
if (!merge_xml)
|
||||
if (!merge_xml)
|
||||
{
|
||||
printf("efreet_menu_merge() failed to read in the "
|
||||
"merge file (%s)\n", realpath);
|
||||
|
@ -1657,7 +1657,7 @@ efreet_menu_handle_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
|
||||
path = efreet_menu_path_get(parent, xml->text);
|
||||
if (!path) return 1;
|
||||
if (!ecore_file_exists(path))
|
||||
if (!ecore_file_exists(path))
|
||||
{
|
||||
FREE(path);
|
||||
return 1;
|
||||
|
@ -1677,7 +1677,7 @@ efreet_menu_handle_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
* @return Returns 1 on success or 0 on failure
|
||||
* @brief Find all of the .menu files in the given directory and merge them
|
||||
* into the @a parent menu.
|
||||
*/
|
||||
*/
|
||||
static int
|
||||
efreet_menu_merge_dir(Efreet_Menu_Internal *parent, Efreet_Xml *xml, const char *path)
|
||||
{
|
||||
|
@ -1727,17 +1727,17 @@ efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *
|
|||
const char *prefix;
|
||||
|
||||
if (!parent || !xml) return 0;
|
||||
|
||||
|
||||
prefix = efreet_menu_prefix_get();
|
||||
if (!strcmp(prefix, "gnome-") &&
|
||||
if (!strcmp(prefix, "gnome-") &&
|
||||
(!strcmp(parent->file.name, "gnome-applications.menu")))
|
||||
p = strdup("applications");
|
||||
|
||||
else if ((!strcmp(prefix, "kde-") &&
|
||||
else if ((!strcmp(prefix, "kde-") &&
|
||||
(!strcmp(parent->file.name, "kde-applications.menu"))))
|
||||
p = strdup("applications");
|
||||
|
||||
else
|
||||
else
|
||||
{
|
||||
char *s;
|
||||
|
||||
|
@ -1748,7 +1748,7 @@ efreet_menu_handle_default_merge_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *
|
|||
snprintf(path, sizeof(path), "menus/%s-merged", p);
|
||||
FREE(p);
|
||||
|
||||
dirs = efreet_default_dirs_get(efreet_config_home_get(),
|
||||
dirs = efreet_default_dirs_get(efreet_config_home_get(),
|
||||
efreet_config_dirs_get(), path);
|
||||
ecore_list_first_goto(dirs);
|
||||
while ((p = ecore_list_first_remove(dirs)))
|
||||
|
@ -1811,7 +1811,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
|
|||
path = efreet_menu_path_get(parent, legacy_dir);
|
||||
|
||||
/* nothing to do if the legacy path doesn't exist */
|
||||
if (!ecore_file_exists(path))
|
||||
if (!ecore_file_exists(path))
|
||||
{
|
||||
FREE(path);
|
||||
return NULL;
|
||||
|
@ -1869,7 +1869,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
|
|||
ecore_strlcpy(file_path, path, PATH_MAX);
|
||||
ecore_strlcpy(file_path + path_len, "/", PATH_MAX - path_len);
|
||||
ecore_strlcpy(file_path + path_len + 1, file->d_name, PATH_MAX - path_len - 1);
|
||||
|
||||
|
||||
/* recurse into sub directories */
|
||||
if (ecore_file_is_dir(file_path))
|
||||
{
|
||||
|
@ -1929,7 +1929,7 @@ efreet_menu_handle_legacy_dir_helper(Efreet_Menu_Internal *root,
|
|||
efreet_desktop_free(desktop);
|
||||
}
|
||||
closedir(files);
|
||||
|
||||
|
||||
FREE(path);
|
||||
return legacy_internal;
|
||||
}
|
||||
|
@ -1950,7 +1950,7 @@ efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml
|
|||
|
||||
if (!efreet_menu_kde_legacy_dirs) return 1;
|
||||
|
||||
/* XXX if one _helper() call succeeds, we return success. should this be flipped?
|
||||
/* XXX if one _helper() call succeeds, we return success. should this be flipped?
|
||||
* (return fail if on of them failed) */
|
||||
ecore_list_first_goto(efreet_menu_kde_legacy_dirs);
|
||||
while ((dir = ecore_list_next(efreet_menu_kde_legacy_dirs)))
|
||||
|
@ -1958,7 +1958,7 @@ efreet_menu_handle_kde_legacy_dirs(Efreet_Menu_Internal *parent, Efreet_Xml *xml
|
|||
Efreet_Menu_Internal *kde;
|
||||
|
||||
kde = efreet_menu_handle_legacy_dir_helper(NULL, parent, dir, "kde");
|
||||
if (kde)
|
||||
if (kde)
|
||||
{
|
||||
efreet_menu_concatenate(parent, kde);
|
||||
efreet_menu_internal_free(kde);
|
||||
|
@ -2023,7 +2023,7 @@ efreet_menu_handle_old(Efreet_Menu_Internal *parent, Efreet_Xml *xml)
|
|||
|
||||
if (!parent || !xml || !xml->text) return 0;
|
||||
|
||||
if (parent->current_move)
|
||||
if (parent->current_move)
|
||||
{
|
||||
printf("efreet_menu_handle_old() saw second <Old> "
|
||||
"before seeing <New>\n");
|
||||
|
@ -2291,13 +2291,13 @@ efreet_menu_handle_layout_merge(Efreet_Menu_Internal *parent, Efreet_Xml *xml, i
|
|||
* @brief Parses the given XML tree and adds the filter to the parent menu
|
||||
*/
|
||||
static int
|
||||
efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
|
||||
efreet_menu_handle_filter(Efreet_Menu_Internal *parent, Efreet_Xml *xml,
|
||||
Efreet_Menu_Filter_Type type)
|
||||
{
|
||||
Efreet_Menu_Filter *filter;
|
||||
|
||||
efreet_menu_create_filter_list(parent);
|
||||
|
||||
|
||||
/* filters have a default or relationship */
|
||||
filter = efreet_menu_filter_new();
|
||||
filter->type = type;
|
||||
|
@ -2423,7 +2423,7 @@ efreet_menu_layout_free(Efreet_Menu_Layout *layout)
|
|||
/**
|
||||
* @internal
|
||||
* @return Returns a new Efreet_Menu_Filter_Op on success or NULL on failure
|
||||
* @brief Creates and initializes an Efreet_Menu_Filter_Op structure
|
||||
* @brief Creates and initializes an Efreet_Menu_Filter_Op structure
|
||||
*/
|
||||
static Efreet_Menu_Filter_Op *
|
||||
efreet_menu_filter_op_new(void)
|
||||
|
@ -2445,7 +2445,7 @@ static void
|
|||
efreet_menu_filter_op_free(Efreet_Menu_Filter_Op *op)
|
||||
{
|
||||
if (!op) return;
|
||||
|
||||
|
||||
IF_FREE_LIST(op->categories);
|
||||
IF_FREE_LIST(op->filenames);
|
||||
IF_FREE_LIST(op->filters);
|
||||
|
@ -2523,7 +2523,7 @@ efreet_menu_free(Efreet_Menu *entry)
|
|||
* @brief Parses the given XML tree and populates a new child operation.
|
||||
*/
|
||||
static int
|
||||
efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
|
||||
efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
|
||||
Efreet_Menu_Filter_Op_Type type)
|
||||
{
|
||||
Efreet_Menu_Filter_Op *child_op;
|
||||
|
@ -2540,7 +2540,7 @@ efreet_menu_handle_filter_child_op(Efreet_Menu_Filter_Op *op, Efreet_Xml *xml,
|
|||
if (!op->filters)
|
||||
{
|
||||
op->filters = ecore_list_new();
|
||||
ecore_list_free_cb_set(op->filters,
|
||||
ecore_list_free_cb_set(op->filters,
|
||||
ECORE_FREE_CB(efreet_menu_filter_op_free));
|
||||
}
|
||||
|
||||
|
@ -2617,10 +2617,10 @@ efreet_menu_process_dirs(Efreet_Menu_Internal *internal)
|
|||
* @param menu: the menu to process
|
||||
* @param only_unallocated: Only handle menus taht deal with unallocated items
|
||||
* @return Returns no value
|
||||
* @brief Handles the processing of the filters attached to the given menu.
|
||||
* @brief Handles the processing of the filters attached to the given menu.
|
||||
*
|
||||
* For each include filter we'll add the items to our applications array. Each
|
||||
* exclude filter will remove items from the applications array
|
||||
* exclude filter will remove items from the applications array
|
||||
*/
|
||||
static void
|
||||
efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_unallocated)
|
||||
|
@ -2659,7 +2659,7 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
|
|||
|
||||
parent = internal->parent;
|
||||
do {
|
||||
efreet_menu_process_app_pool(parent->app_pool,
|
||||
efreet_menu_process_app_pool(parent->app_pool,
|
||||
internal->applications, matches, filter,
|
||||
internal->only_unallocated);
|
||||
} while ((parent = parent->parent));
|
||||
|
@ -2723,10 +2723,10 @@ efreet_menu_process_filters(Efreet_Menu_Internal *internal, unsigned int only_un
|
|||
* @brief This will iterate the items in @a pool and append them to @a
|
||||
* applications if they match the @a filter given and aren't previoulsy entered
|
||||
* in @a matches. If @a only_unallocated is set we'll only only at the
|
||||
* .desktop files that haven't been previoulsy matched
|
||||
* .desktop files that haven't been previoulsy matched
|
||||
*/
|
||||
static
|
||||
void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications,
|
||||
void efreet_menu_process_app_pool(Ecore_List *pool, Ecore_List *applications,
|
||||
Ecore_Hash *matches,
|
||||
Efreet_Menu_Filter *filter,
|
||||
unsigned int only_unallocated)
|
||||
|
@ -2761,7 +2761,7 @@ efreet_menu_filter_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *md)
|
|||
{
|
||||
if (op->type == EFREET_MENU_FILTER_OP_OR)
|
||||
return efreet_menu_filter_or_matches(op, md);
|
||||
|
||||
|
||||
if (op->type == EFREET_MENU_FILTER_OP_AND)
|
||||
return efreet_menu_filter_and_matches(op, md);
|
||||
|
||||
|
@ -2829,7 +2829,7 @@ efreet_menu_filter_and_matches(Efreet_Menu_Filter_Op *op, Efreet_Menu_Desktop *m
|
|||
Efreet_Menu_Filter_Op *child;
|
||||
char *t;
|
||||
|
||||
if (op->categories)
|
||||
if (op->categories)
|
||||
{
|
||||
if ((ecore_list_count(op->categories) > 0) && !md->desktop->categories)
|
||||
return 0;
|
||||
|
@ -2985,7 +2985,7 @@ efreet_menu_concatenate(Efreet_Menu_Internal *dest, Efreet_Menu_Internal *src)
|
|||
while ((submenu = ecore_list_last_remove(src->sub_menus)))
|
||||
{
|
||||
Efreet_Menu_Internal *match;
|
||||
|
||||
|
||||
/* if this menu is in the list already we just add to that */
|
||||
if ((match = ecore_list_find(dest->sub_menus,
|
||||
ECORE_COMPARE_CB(efreet_menu_cb_menu_compare), submenu)))
|
||||
|
@ -3021,7 +3021,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
|
|||
|
||||
/* nothing to do if this menu has no moves */
|
||||
if (!internal->moves) return;
|
||||
|
||||
|
||||
ecore_list_first_goto(internal->moves);
|
||||
while ((move = ecore_list_next(internal->moves)))
|
||||
{
|
||||
|
@ -3044,7 +3044,7 @@ efreet_menu_resolve_moves(Efreet_Menu_Internal *internal)
|
|||
/* if the dest path has /'s in it then we need to add menus to
|
||||
* fill out the paths */
|
||||
t = strdup(move->new_name);
|
||||
tmp = t;
|
||||
tmp = t;
|
||||
path = strchr(tmp, '/');
|
||||
while (path)
|
||||
{
|
||||
|
@ -3104,7 +3104,7 @@ efreet_menu_by_name_find(Efreet_Menu_Internal *internal, const char *name, Efree
|
|||
{
|
||||
*part = '\0';
|
||||
|
||||
if (!ecore_list_find(internal->sub_menus,
|
||||
if (!ecore_list_find(internal->sub_menus,
|
||||
ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr))
|
||||
{
|
||||
FREE(tmp);
|
||||
|
@ -3119,7 +3119,7 @@ efreet_menu_by_name_find(Efreet_Menu_Internal *internal, const char *name, Efree
|
|||
if (parent) *parent = internal;
|
||||
|
||||
/* find the menu in the parent list */
|
||||
if (!ecore_list_find(internal->sub_menus,
|
||||
if (!ecore_list_find(internal->sub_menus,
|
||||
ECORE_COMPARE_CB(efreet_menu_cb_compare_names), ptr))
|
||||
{
|
||||
FREE(tmp);
|
||||
|
@ -3199,7 +3199,7 @@ efreet_menu_app_dir_new(void)
|
|||
* @internal
|
||||
* @param dir: The app dir to free
|
||||
* @return Returns no value
|
||||
* @brief Frees @a dir
|
||||
* @brief Frees @a dir
|
||||
*/
|
||||
static void
|
||||
efreet_menu_app_dir_free(Efreet_Menu_App_Dir *dir)
|
||||
|
@ -3217,7 +3217,7 @@ efreet_menu_app_dir_free(Efreet_Menu_App_Dir *dir)
|
|||
* @param a: The app dir to compare too
|
||||
* @param b: The path to compare too
|
||||
* @return Returns 1 if the strings are equals, 0 otherwise
|
||||
* @brief Compares the too strings
|
||||
* @brief Compares the too strings
|
||||
*/
|
||||
static int
|
||||
efreet_menu_cb_app_dirs_compare(Efreet_Menu_App_Dir *a, const char *b)
|
||||
|
@ -3231,7 +3231,7 @@ efreet_menu_create_sub_menu_list(Efreet_Menu_Internal *internal)
|
|||
if (!internal || internal->sub_menus) return;
|
||||
|
||||
internal->sub_menus = ecore_list_new();
|
||||
ecore_list_free_cb_set(internal->sub_menus,
|
||||
ecore_list_free_cb_set(internal->sub_menus,
|
||||
ECORE_FREE_CB(efreet_menu_internal_free));
|
||||
}
|
||||
|
||||
|
@ -3241,7 +3241,7 @@ efreet_menu_create_app_dirs_list(Efreet_Menu_Internal *internal)
|
|||
if (!internal || internal->app_dirs) return;
|
||||
|
||||
internal->app_dirs = ecore_list_new();
|
||||
ecore_list_free_cb_set(internal->app_dirs,
|
||||
ecore_list_free_cb_set(internal->app_dirs,
|
||||
ECORE_FREE_CB(efreet_menu_app_dir_free));
|
||||
}
|
||||
|
||||
|
@ -3269,7 +3269,7 @@ efreet_menu_create_filter_list(Efreet_Menu_Internal *internal)
|
|||
if (!internal || internal->filters) return;
|
||||
|
||||
internal->filters = ecore_list_new();
|
||||
ecore_list_free_cb_set(internal->filters,
|
||||
ecore_list_free_cb_set(internal->filters,
|
||||
ECORE_FREE_CB(efreet_menu_filter_free));
|
||||
}
|
||||
|
||||
|
@ -3279,7 +3279,7 @@ efreet_menu_create_layout_list(Efreet_Menu_Internal *internal)
|
|||
if (!internal || internal->layout) return;
|
||||
|
||||
internal->layout = ecore_list_new();
|
||||
ecore_list_free_cb_set(internal->layout,
|
||||
ecore_list_free_cb_set(internal->layout,
|
||||
ECORE_FREE_CB(efreet_menu_layout_free));
|
||||
}
|
||||
|
||||
|
@ -3289,7 +3289,7 @@ efreet_menu_create_default_layout_list(Efreet_Menu_Internal *internal)
|
|||
if (!internal || internal->default_layout) return;
|
||||
|
||||
internal->default_layout = ecore_list_new();
|
||||
ecore_list_free_cb_set(internal->default_layout,
|
||||
ecore_list_free_cb_set(internal->default_layout,
|
||||
ECORE_FREE_CB(efreet_menu_layout_free));
|
||||
}
|
||||
|
||||
|
@ -3297,7 +3297,7 @@ static void
|
|||
efreet_menu_create_directories_list(Efreet_Menu_Internal *internal)
|
||||
{
|
||||
if (!internal || internal->directories) return;
|
||||
|
||||
|
||||
internal->directories = ecore_dlist_new();
|
||||
ecore_list_free_cb_set(internal->directories, free);
|
||||
}
|
||||
|
@ -3314,7 +3314,7 @@ efreet_menu_path_get(Efreet_Menu_Internal *internal, const char *suffix)
|
|||
|
||||
else
|
||||
{
|
||||
if (!internal->file.path)
|
||||
if (!internal->file.path)
|
||||
{
|
||||
printf("efreet_menu_handle_app_dir() missing menu path ...\n");
|
||||
return NULL;
|
||||
|
@ -3456,11 +3456,11 @@ efreet_menu_directory_dirs_process(Efreet_Menu_Internal *internal)
|
|||
* @param relative_path: The relative portion of the path
|
||||
* @param cache: The cache to populate
|
||||
* @return Returns 1 on success or 0 on failure
|
||||
* @brief Scans the given directory dir for .directory files and adds the
|
||||
* @brief Scans the given directory dir for .directory files and adds the
|
||||
* applications to the cache
|
||||
*/
|
||||
static int
|
||||
efreet_menu_directory_dir_scan(const char *path, const char *relative_path,
|
||||
efreet_menu_directory_dir_scan(const char *path, const char *relative_path,
|
||||
Ecore_Hash *cache)
|
||||
{
|
||||
Efreet_Desktop *desktop;
|
||||
|
@ -3874,7 +3874,7 @@ efreet_menu_layout_entries_get(Efreet_Menu *entry, Efreet_Menu_Internal *interna
|
|||
else if (internal->sub_menus && !strcmp(layout->name, "all"))
|
||||
{
|
||||
char *orig;
|
||||
|
||||
|
||||
orig = layout->name;
|
||||
layout->name = "menus";
|
||||
efreet_menu_layout_entries_get(entry, internal, layout);
|
||||
|
@ -3910,4 +3910,3 @@ efreet_menu_cb_move_compare(Efreet_Menu_Move *move, const char *old)
|
|||
{
|
||||
return ecore_str_compare(move->old_name, old);
|
||||
}
|
||||
|
||||
|
|
|
@ -4,7 +4,7 @@
|
|||
|
||||
/**
|
||||
* @file efreet_menu.h
|
||||
* @brief Contains the structures and methods to support the Desktop
|
||||
* @brief Contains the structures and methods to support the Desktop
|
||||
* Menu Specification.
|
||||
* @addtogroup Efreet_Menu Efreet_Menu: The FDO Desktop Menu Specification
|
||||
* functions and structures
|
||||
|
@ -67,4 +67,3 @@ void efreet_menu_dump(Efreet_Menu *menu, const char *indent);
|
|||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -18,14 +18,14 @@ static Ecore_Hash *monitors = NULL; /* contains file monitors */
|
|||
* @note This is set during efreet_mime_init based on
|
||||
* a runtime check.
|
||||
*/
|
||||
static enum
|
||||
{
|
||||
EFREET_ENDIAN_BIG = 0,
|
||||
EFREET_ENDIAN_LITTLE = 1
|
||||
static enum
|
||||
{
|
||||
EFREET_ENDIAN_BIG = 0,
|
||||
EFREET_ENDIAN_LITTLE = 1
|
||||
} efreet_mime_endianess = EFREET_ENDIAN_BIG;
|
||||
|
||||
/*
|
||||
* Buffer sized used for magic checks. The default is good enough for the
|
||||
* Buffer sized used for magic checks. The default is good enough for the
|
||||
* current set of magic rules. This setting is only here for the future.
|
||||
*/
|
||||
#define EFREET_MIME_MAGIC_BUFFER_SIZE 512
|
||||
|
@ -74,8 +74,8 @@ static void efreet_mime_mime_types_load(const char *file);
|
|||
static void efreet_mime_shared_mimeinfo_globs_load(const char *file);
|
||||
static void efreet_mime_shared_mimeinfo_magic_load(const char *file);
|
||||
static void efreet_mime_shared_mimeinfo_magic_parse(char *data, int size);
|
||||
static const char *efreet_mime_magic_check_priority(const char *file,
|
||||
unsigned int start,
|
||||
static const char *efreet_mime_magic_check_priority(const char *file,
|
||||
unsigned int start,
|
||||
unsigned int end);
|
||||
static int efreet_mime_init_files(void);
|
||||
static const char *efreet_mime_special_check(const char *file);
|
||||
|
@ -88,9 +88,9 @@ static int efreet_mime_glob_case_match(char *str, const char *glob);
|
|||
static int efreet_mime_endian_check(void);
|
||||
|
||||
static void efreet_mime_monitor_add(const char *file);
|
||||
static void efreet_mime_cb_update_file(void *data,
|
||||
static void efreet_mime_cb_update_file(void *data,
|
||||
Ecore_File_Monitor *monitor,
|
||||
Ecore_File_Event event,
|
||||
Ecore_File_Event event,
|
||||
const char *path);
|
||||
|
||||
/**
|
||||
|
@ -99,26 +99,26 @@ static void efreet_mime_cb_update_file(void *data,
|
|||
*/
|
||||
int
|
||||
efreet_mime_init(void)
|
||||
{
|
||||
{
|
||||
if (!ecore_init())
|
||||
return 0;
|
||||
|
||||
|
||||
if (!ecore_file_init())
|
||||
return 0;
|
||||
|
||||
|
||||
if (!efreet_init())
|
||||
return 0;
|
||||
|
||||
|
||||
efreet_mime_endianess = efreet_mime_endian_check();
|
||||
|
||||
|
||||
monitors = ecore_hash_new(ecore_str_hash, ecore_str_compare);
|
||||
ecore_hash_free_key_cb_set(monitors, ECORE_FREE_CB(free));
|
||||
ecore_hash_free_value_cb_set(monitors,
|
||||
ECORE_FREE_CB(ecore_file_monitor_del));
|
||||
|
||||
|
||||
if (!efreet_mime_init_files())
|
||||
return 0;
|
||||
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
@ -146,30 +146,30 @@ efreet_mime_shutdown(void)
|
|||
*/
|
||||
const char *
|
||||
efreet_mime_type_get(const char *file)
|
||||
{
|
||||
{
|
||||
const char *type = NULL;
|
||||
|
||||
|
||||
if ((type = efreet_mime_special_check(file)))
|
||||
return type;
|
||||
|
||||
|
||||
/*
|
||||
* Check magics with priority > 80
|
||||
*/
|
||||
if ((type = efreet_mime_magic_check_priority(file, 0, 80)))
|
||||
return type;
|
||||
|
||||
|
||||
/*
|
||||
* Check globs
|
||||
*/
|
||||
*/
|
||||
if ((type = efreet_mime_globs_type_get(file)))
|
||||
return type;
|
||||
|
||||
|
||||
/*
|
||||
* Check rest of magics
|
||||
*/
|
||||
if ((type = efreet_mime_magic_check_priority(file, 80, 0)))
|
||||
return type;
|
||||
|
||||
|
||||
return efreet_mime_fallback_check(file);
|
||||
}
|
||||
|
||||
|
@ -186,11 +186,11 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
|
|||
const char *env = NULL;
|
||||
char *p = NULL, *pp = NULL, *ppp = NULL;
|
||||
char buf[PATH_MAX];
|
||||
|
||||
|
||||
if (!mime || !theme || !size)
|
||||
return NULL;
|
||||
|
||||
icons = ecore_list_new();
|
||||
|
||||
icons = ecore_list_new();
|
||||
ecore_list_free_cb_set(icons, free);
|
||||
|
||||
/* Standard icon name */
|
||||
|
@ -203,17 +203,17 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
|
|||
pp++;
|
||||
}
|
||||
ecore_list_append(icons, p);
|
||||
|
||||
|
||||
/* Environment Based icon names */
|
||||
if ((env = efreet_desktop_environment_get()))
|
||||
{
|
||||
snprintf(buf, sizeof(buf), "%s-mime-%s", env, p);
|
||||
ecore_list_append(icons, strdup(buf));
|
||||
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s-%s", env, p);
|
||||
ecore_list_append(icons, strdup(buf));
|
||||
}
|
||||
|
||||
|
||||
/* Mime prefixed icon names */
|
||||
snprintf(buf, sizeof(buf), "mime-%s", p);
|
||||
ecore_list_append(icons, strdup(buf));
|
||||
|
@ -223,20 +223,20 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
|
|||
while ((ppp = strrchr(pp, '-')))
|
||||
{
|
||||
*ppp = '\0';
|
||||
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s-generic", pp);
|
||||
ecore_list_append(icons, strdup(buf));
|
||||
|
||||
|
||||
snprintf(buf, sizeof(buf), "%s", pp);
|
||||
ecore_list_append(icons, strdup(buf));
|
||||
}
|
||||
FREE(pp);
|
||||
|
||||
|
||||
/* Search for icons using list */
|
||||
icon = efreet_icon_list_find(theme, icons, size);
|
||||
|
||||
|
||||
ecore_list_destroy(icons);
|
||||
|
||||
|
||||
return icon;
|
||||
}
|
||||
|
||||
|
@ -248,7 +248,7 @@ efreet_mime_type_icon_get(const char *mime, const char *theme, const char *size)
|
|||
const char *
|
||||
efreet_mime_magic_type_get(const char *file)
|
||||
{
|
||||
return efreet_mime_magic_check_priority(file, 0, 0);
|
||||
return efreet_mime_magic_check_priority(file, 0, 0);
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -301,7 +301,7 @@ efreet_mime_globs_type_get(const char *file)
|
|||
if (efreet_mime_glob_case_match(ext, g->glob))
|
||||
return g->mime;
|
||||
}
|
||||
return NULL;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -348,7 +348,7 @@ efreet_mime_endian_check(void)
|
|||
* given file
|
||||
*/
|
||||
static void
|
||||
efreet_mime_monitor_add(const char *file)
|
||||
efreet_mime_monitor_add(const char *file)
|
||||
{
|
||||
Ecore_File_Monitor *fm = NULL;
|
||||
|
||||
|
@ -374,17 +374,17 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
|
|||
{
|
||||
char buf[4096];
|
||||
const char *datadir = NULL;
|
||||
|
||||
|
||||
IF_FREE_HASH(wild);
|
||||
wild = ecore_hash_new(ecore_str_hash, ecore_str_compare);
|
||||
ecore_hash_free_key_cb_set(wild, ECORE_FREE_CB(ecore_string_release));
|
||||
ecore_hash_free_value_cb_set(wild,
|
||||
ECORE_FREE_CB(ecore_string_release));
|
||||
IF_FREE_LIST(globs);
|
||||
globs = ecore_list_new();
|
||||
globs = ecore_list_new();
|
||||
ecore_list_free_cb_set(globs, efreet_mime_glob_free);
|
||||
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* This is here for legacy reasons. It is mentioned briefly
|
||||
* in the spec and seems to still be quite valid. It is
|
||||
|
@ -392,7 +392,7 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
|
|||
* in here.
|
||||
*/
|
||||
efreet_mime_mime_types_load("/etc/mime.types");
|
||||
|
||||
|
||||
datadir = datahome;
|
||||
ecore_list_first_goto(datadirs);
|
||||
while (datadir)
|
||||
|
@ -411,16 +411,16 @@ efreet_mime_load_globs(Ecore_List *datadirs, const char *datahome)
|
|||
* @return Returns no value
|
||||
* @brief Read all magic files in XDG data/home dirs.
|
||||
*/
|
||||
static void
|
||||
static void
|
||||
efreet_mime_load_magics(Ecore_List *datadirs, const char *datahome)
|
||||
{
|
||||
char buf[4096];
|
||||
const char *datadir = NULL;
|
||||
|
||||
|
||||
IF_FREE_LIST(magics);
|
||||
magics = ecore_list_new();
|
||||
ecore_list_free_cb_set(magics, efreet_mime_magic_free);
|
||||
|
||||
ecore_list_free_cb_set(magics, efreet_mime_magic_free);
|
||||
|
||||
datadir = datahome;
|
||||
ecore_list_first_goto(datadirs);
|
||||
while (datadir)
|
||||
|
@ -445,23 +445,23 @@ efreet_mime_load_magics(Ecore_List *datadirs, const char *datahome)
|
|||
* the globs are updated.
|
||||
*/
|
||||
static void
|
||||
efreet_mime_cb_update_file(void *data __UNUSED__,
|
||||
efreet_mime_cb_update_file(void *data __UNUSED__,
|
||||
Ecore_File_Monitor *monitor __UNUSED__,
|
||||
Ecore_File_Event event __UNUSED__,
|
||||
Ecore_File_Event event __UNUSED__,
|
||||
const char *path)
|
||||
{
|
||||
Ecore_List *datadirs = NULL;
|
||||
Ecore_List *datadirs = NULL;
|
||||
const char *datahome = NULL;
|
||||
|
||||
|
||||
if (!(datahome = efreet_data_home_get()))
|
||||
return;
|
||||
|
||||
|
||||
if (!(datadirs = efreet_data_dirs_get()))
|
||||
return;
|
||||
|
||||
if (strstr(path, "magic"))
|
||||
efreet_mime_load_magics(datadirs, datahome);
|
||||
else
|
||||
else
|
||||
efreet_mime_load_globs(datadirs, datahome);
|
||||
}
|
||||
|
||||
|
@ -475,20 +475,20 @@ efreet_mime_cb_update_file(void *data __UNUSED__,
|
|||
static int
|
||||
efreet_mime_init_files(void)
|
||||
{
|
||||
Ecore_List *datadirs = NULL;
|
||||
Ecore_List *datadirs = NULL;
|
||||
char buf[PATH_MAX];
|
||||
const char *datahome, *datadir = NULL;
|
||||
|
||||
|
||||
if (!(datahome = efreet_data_home_get()))
|
||||
return 0;
|
||||
|
||||
|
||||
if (!(datadirs = efreet_data_dirs_get()))
|
||||
return 0;
|
||||
|
||||
/*
|
||||
* Add our file monitors
|
||||
|
||||
/*
|
||||
* Add our file monitors
|
||||
* We watch the directories so we can watch for new files
|
||||
*/
|
||||
*/
|
||||
datadir = datahome;
|
||||
ecore_list_first_goto(datadirs);
|
||||
while (datadir)
|
||||
|
@ -499,7 +499,7 @@ efreet_mime_init_files(void)
|
|||
datadir = ecore_list_next(datadirs);
|
||||
}
|
||||
efreet_mime_monitor_add("/etc/mime.types");
|
||||
|
||||
|
||||
/* Load our mime information */
|
||||
efreet_mime_load_globs(datadirs, datahome);
|
||||
efreet_mime_load_magics(datadirs, datahome);
|
||||
|
@ -532,59 +532,59 @@ efreet_mime_init_files(void)
|
|||
*/
|
||||
static const char *
|
||||
efreet_mime_special_check(const char *file)
|
||||
{
|
||||
{
|
||||
struct stat s;
|
||||
int path_len = 0;
|
||||
|
||||
|
||||
if (!lstat(file, &s))
|
||||
{
|
||||
if (S_ISREG(s.st_mode))
|
||||
return NULL;
|
||||
|
||||
|
||||
if (S_ISLNK(s.st_mode))
|
||||
return "inode/symlink";
|
||||
|
||||
|
||||
if (S_ISFIFO(s.st_mode))
|
||||
return "inode/fifo";
|
||||
|
||||
|
||||
if (S_ISCHR(s.st_mode))
|
||||
return "inode/chardevice";
|
||||
|
||||
|
||||
if (S_ISBLK(s.st_mode))
|
||||
return "inode/blockdevice";
|
||||
|
||||
|
||||
if (S_ISSOCK(s.st_mode))
|
||||
return "inode/socket";
|
||||
|
||||
|
||||
if (S_ISDIR(s.st_mode))
|
||||
{
|
||||
struct stat s2;
|
||||
struct stat s2;
|
||||
char parent[PATH_MAX];
|
||||
char path[PATH_MAX];
|
||||
|
||||
|
||||
strncpy(path, file, PATH_MAX);
|
||||
|
||||
|
||||
path_len = strlen(file);
|
||||
strncpy(parent, path, PATH_MAX);
|
||||
|
||||
|
||||
/* Kill any trailing slash */
|
||||
parent[--path_len] = '\0';
|
||||
|
||||
parent[--path_len] = '\0';
|
||||
|
||||
/* Truncate to last slash */
|
||||
while (parent[--path_len] != '/') parent[path_len] = '\0';
|
||||
|
||||
|
||||
if (!lstat(parent, &s2))
|
||||
{
|
||||
if (s.st_dev != s2.st_dev)
|
||||
return "inode/mount-point";
|
||||
}
|
||||
|
||||
|
||||
return "inode/directory";
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
@ -592,7 +592,7 @@ efreet_mime_special_check(const char *file)
|
|||
* @internal
|
||||
* @param file: File to examine
|
||||
* @return Returns mime type or NULL if the file doesn't exist
|
||||
* @brief Returns text/plain if the file appears to contain text and
|
||||
* @brief Returns text/plain if the file appears to contain text and
|
||||
* returns application/octet-stream if it appears to be binary.
|
||||
*/
|
||||
static const char *
|
||||
|
@ -601,13 +601,13 @@ efreet_mime_fallback_check(const char *file)
|
|||
FILE *f = NULL;
|
||||
char buf[32];
|
||||
int i;
|
||||
|
||||
|
||||
if (!(f = fopen(file, "r")))
|
||||
return NULL;
|
||||
|
||||
|
||||
i = fread(buf, 1, sizeof(buf), f);
|
||||
fclose(f);
|
||||
|
||||
|
||||
if (i == 0)
|
||||
return "application/octet-stream";
|
||||
/*
|
||||
|
@ -617,13 +617,13 @@ efreet_mime_fallback_check(const char *file)
|
|||
*/
|
||||
for (i -= 1; i >= 0; --i)
|
||||
{
|
||||
if ((buf[i] < 0x20) &&
|
||||
if ((buf[i] < 0x20) &&
|
||||
(buf[i] != '\n') && /* Line Feed */
|
||||
(buf[i] != '\r') && /* Carriage Return */
|
||||
(buf[i] != '\t')) /* Tab */
|
||||
return "application/octet-stream";
|
||||
}
|
||||
|
||||
|
||||
return "text/plain";
|
||||
}
|
||||
|
||||
|
@ -637,7 +637,7 @@ static int
|
|||
efreet_mime_glob_remove(const char *glob)
|
||||
{
|
||||
Efreet_Mime_Glob *mime = NULL;
|
||||
|
||||
|
||||
mime = ecore_list_first_goto(globs);
|
||||
while ((mime = ecore_list_current(globs)))
|
||||
{
|
||||
|
@ -651,7 +651,7 @@ efreet_mime_glob_remove(const char *glob)
|
|||
}
|
||||
ecore_list_next(globs);
|
||||
}
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
@ -659,7 +659,7 @@ efreet_mime_glob_remove(const char *glob)
|
|||
* @internal
|
||||
* @param file: mime.types file to load
|
||||
* @return Returns no value
|
||||
* @brief Loads values from a mime.types style file
|
||||
* @brief Loads values from a mime.types style file
|
||||
* into the globs list.
|
||||
* @note Format:
|
||||
* application/msaccess mdb
|
||||
|
@ -688,7 +688,7 @@ efreet_mime_mime_types_load(const char *file)
|
|||
if ((*p == '\n') || (*p == 0)) continue;
|
||||
strncpy(mimetype, pp, (p - pp));
|
||||
mimetype[p - pp] = 0;
|
||||
|
||||
|
||||
do
|
||||
{
|
||||
while (isspace(*p) && (*p != 0) && (*p != '\n')) p++;
|
||||
|
@ -700,7 +700,7 @@ efreet_mime_mime_types_load(const char *file)
|
|||
|
||||
strncpy(ext, pp, (p - pp));
|
||||
ext[p - pp] = 0;
|
||||
|
||||
|
||||
ecore_hash_set(wild, (void*)ecore_string_instance(ext),
|
||||
(void*)ecore_string_instance(mimetype));
|
||||
}
|
||||
|
@ -713,7 +713,7 @@ efreet_mime_mime_types_load(const char *file)
|
|||
* @internal
|
||||
* @param file: globs file to load
|
||||
* @return Returns no value
|
||||
* @brief Loads values from a mime.types style file
|
||||
* @brief Loads values from a mime.types style file
|
||||
* into the globs list.
|
||||
* @note Format:
|
||||
* text/vnd.wap.wml:*.wml
|
||||
|
@ -730,7 +730,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
|
|||
|
||||
f = fopen(file, "rb");
|
||||
if (!f) return;
|
||||
|
||||
|
||||
while (fgets(buf, sizeof(buf), f))
|
||||
{
|
||||
p = buf;
|
||||
|
@ -747,7 +747,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
|
|||
mimetype[p - pp] = 0;
|
||||
p++;
|
||||
pp = ext;
|
||||
|
||||
|
||||
while ((*p != 0) && (*p != '\n'))
|
||||
{
|
||||
*pp = *p;
|
||||
|
@ -758,7 +758,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
|
|||
*pp = 0;
|
||||
|
||||
if (ext[0] == '*' && ext[1] == '.')
|
||||
{
|
||||
{
|
||||
ecore_hash_set(wild, (void*)ecore_string_instance(&(ext[2])),
|
||||
(void*)ecore_string_instance(mimetype));
|
||||
}
|
||||
|
@ -783,7 +783,7 @@ efreet_mime_shared_mimeinfo_globs_load(const char *file)
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
|
@ -798,10 +798,10 @@ static int
|
|||
efreet_mime_count_digits(int in)
|
||||
{
|
||||
int i = 1, j = in;
|
||||
|
||||
|
||||
if (j < 10) return 1;
|
||||
while ((j /= 10) > 0) ++i;
|
||||
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
|
@ -816,7 +816,7 @@ efreet_mime_shared_mimeinfo_magic_load(const char *file)
|
|||
{
|
||||
int fd = -1, size;
|
||||
char *data = (void *)-1;
|
||||
|
||||
|
||||
if (!file) return;
|
||||
|
||||
size = ecore_file_size(file);
|
||||
|
@ -838,7 +838,7 @@ efreet_mime_shared_mimeinfo_magic_load(const char *file)
|
|||
close(fd);
|
||||
}
|
||||
|
||||
/**
|
||||
/**
|
||||
* @param data: The data from the file
|
||||
* @return Returns no value
|
||||
* @brief Parses a magic file
|
||||
|
@ -856,23 +856,23 @@ efreet_mime_shared_mimeinfo_magic_load(const char *file)
|
|||
* ----------------------------------------------------------------------
|
||||
*
|
||||
* indent
|
||||
* The nesting depth of the rule, corresponding to the number of '>'
|
||||
* The nesting depth of the rule, corresponding to the number of '>'
|
||||
* characters in the traditional file format.
|
||||
* ">" start-offset
|
||||
* ">" start-offset
|
||||
* The offset into the file to look for a match.
|
||||
* "=" value
|
||||
* Two bytes giving the (big-endian) length of the value, followed by the
|
||||
* value itself.
|
||||
* "&" mask
|
||||
* The mask, which (if present) is exactly the same length as the value.
|
||||
* "~" word-size
|
||||
* Two bytes giving the (big-endian) length of the value, followed by the
|
||||
* value itself.
|
||||
* "&" mask
|
||||
* The mask, which (if present) is exactly the same length as the value.
|
||||
* "~" word-size
|
||||
* On little-endian machines, the size of each group to byte-swap.
|
||||
* "+" range-length
|
||||
* "+" range-length
|
||||
* The length of the region in the file to check.
|
||||
*
|
||||
* The indent, range-length, word-size and mask components are optional.
|
||||
* If missing, indent defaults to 0, range-length to 1, the word-size to 1,
|
||||
* and the mask to all 'one' bits. In our case, mask is null as it is
|
||||
* The indent, range-length, word-size and mask components are optional.
|
||||
* If missing, indent defaults to 0, range-length to 1, the word-size to 1,
|
||||
* and the mask to all 'one' bits. In our case, mask is null as it is
|
||||
* quicker, uses less memory and will acheive the same exact effect.
|
||||
*/
|
||||
static void
|
||||
|
@ -916,7 +916,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
|
||||
mime->mime = ecore_string_instance(buf);
|
||||
ptr = ++val;
|
||||
|
||||
|
||||
while (*ptr != '\n') ptr++;
|
||||
}
|
||||
else
|
||||
|
@ -941,7 +941,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
|
||||
ecore_list_append(mime->entries, entry);
|
||||
}
|
||||
|
||||
|
||||
switch(*ptr)
|
||||
{
|
||||
case '>':
|
||||
|
@ -952,7 +952,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
|
||||
case '=':
|
||||
ptr++;
|
||||
entry->value_len = ntohs(*((short*)(ptr)));
|
||||
entry->value_len = ntohs(*((short*)(ptr)));
|
||||
ptr += 2;
|
||||
|
||||
entry->value = NEW(1, entry->value_len);
|
||||
|
@ -970,9 +970,9 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
case '~':
|
||||
ptr++;
|
||||
entry->word_size = atoi(ptr);
|
||||
if (((entry->word_size != 0)
|
||||
if (((entry->word_size != 0)
|
||||
&& (entry->word_size != 1)
|
||||
&& (entry->word_size != 2)
|
||||
&& (entry->word_size != 2)
|
||||
&& (entry->word_size != 4))
|
||||
|| (entry->value_len % entry->word_size))
|
||||
{
|
||||
|
@ -984,7 +984,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
while (*ptr != '\n') ptr++;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
if (efreet_mime_endianess == EFREET_ENDIAN_LITTLE)
|
||||
{
|
||||
int j;
|
||||
|
@ -993,25 +993,25 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
{
|
||||
if (entry->word_size == 2)
|
||||
{
|
||||
((short*)entry->value)[j] =
|
||||
((short*)entry->value)[j] =
|
||||
ntohs(((short*)entry->value)[j]);
|
||||
|
||||
|
||||
if (entry->mask)
|
||||
((short*)entry->mask)[j] =
|
||||
((short*)entry->mask)[j] =
|
||||
ntohs(((short*)entry->mask)[j]);
|
||||
}
|
||||
else if (entry->word_size == 4)
|
||||
{
|
||||
((long*)entry->value)[j] =
|
||||
((long*)entry->value)[j] =
|
||||
ntohl(((long*)entry->value)[j]);
|
||||
|
||||
|
||||
if (entry->mask)
|
||||
((long*)entry->mask)[j] =
|
||||
((long*)entry->mask)[j] =
|
||||
ntohl(((long*)entry->mask)[j]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
ptr += efreet_mime_count_digits(entry->word_size);
|
||||
break;
|
||||
|
||||
|
@ -1020,7 +1020,7 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
entry->range_len = atoi(ptr);
|
||||
ptr += efreet_mime_count_digits(entry->range_len);
|
||||
break;
|
||||
|
||||
|
||||
case '\n':
|
||||
ptr++;
|
||||
entry = NULL;
|
||||
|
@ -1055,8 +1055,8 @@ efreet_mime_shared_mimeinfo_magic_parse(char *data, int size)
|
|||
* @brief Applies magic rules to a file given a start and end priority
|
||||
*/
|
||||
static const char *
|
||||
efreet_mime_magic_check_priority(const char *file,
|
||||
unsigned int start,
|
||||
efreet_mime_magic_check_priority(const char *file,
|
||||
unsigned int start,
|
||||
unsigned int end)
|
||||
{
|
||||
Efreet_Mime_Magic *m = NULL;
|
||||
|
@ -1068,30 +1068,30 @@ efreet_mime_magic_check_priority(const char *file,
|
|||
|
||||
f = fopen(file, "rb");
|
||||
if (!f) return NULL;
|
||||
|
||||
|
||||
if (!(m = ecore_list_first_goto(magics)))
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
if ((bytes_read = fread(buf, 1, sizeof(buf), f)) == 0)
|
||||
{
|
||||
fclose(f);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
while ((m = ecore_list_next(magics)))
|
||||
{
|
||||
if ((start != 0) && (m->priority > start))
|
||||
continue;
|
||||
|
||||
if (m->priority < end)
|
||||
|
||||
if (m->priority < end)
|
||||
break;
|
||||
|
||||
|
||||
ecore_list_first_goto(m->entries);
|
||||
while ((e = ecore_list_next(m->entries)))
|
||||
{
|
||||
{
|
||||
if ((level < e->indent) && !match)
|
||||
continue;
|
||||
|
||||
|
@ -1101,13 +1101,13 @@ efreet_mime_magic_check_priority(const char *file,
|
|||
else if ((level > e->indent) && match)
|
||||
{
|
||||
fclose(f);
|
||||
|
||||
|
||||
if (last_mime) return last_mime;
|
||||
}
|
||||
|
||||
|
||||
for (offset = e->offset; offset < e->offset + e->range_len; offset++)
|
||||
{
|
||||
if (((offset + e->value_len) > bytes_read) &&
|
||||
if (((offset + e->value_len) > bytes_read) &&
|
||||
(fseek(f, offset, SEEK_SET) == -1))
|
||||
break;
|
||||
|
||||
|
@ -1118,7 +1118,7 @@ efreet_mime_magic_check_priority(const char *file,
|
|||
c = fgetc(f);
|
||||
else
|
||||
c = buf[offset + i];
|
||||
|
||||
|
||||
v = e->value[i];
|
||||
if (e->mask) v &= e->mask[i];
|
||||
|
||||
|
@ -1128,8 +1128,8 @@ efreet_mime_magic_check_priority(const char *file,
|
|||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (match)
|
||||
|
||||
if (match)
|
||||
{
|
||||
level += 1;
|
||||
last_mime = m->mime;
|
||||
|
@ -1169,7 +1169,7 @@ static void
|
|||
efreet_mime_magic_free(void *data)
|
||||
{
|
||||
Efreet_Mime_Magic *m = data;
|
||||
|
||||
|
||||
IF_RELEASE(m->mime);
|
||||
IF_FREE_LIST(m->entries);
|
||||
IF_FREE(m);
|
||||
|
@ -1185,7 +1185,7 @@ static void
|
|||
efreet_mime_magic_entry_free(void *data)
|
||||
{
|
||||
Efreet_Mime_Magic_Entry *e = data;
|
||||
|
||||
|
||||
IF_FREE(e->mask);
|
||||
IF_FREE(e->value);
|
||||
IF_FREE(e);
|
||||
|
@ -1237,4 +1237,3 @@ efreet_mime_glob_case_match(char *str, const char *glob)
|
|||
if (!fnmatch(str, tglob, 0)) return 1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -43,14 +43,14 @@
|
|||
#define NEW(x, c) calloc(c, sizeof(x))
|
||||
|
||||
/**
|
||||
* @def FREE(x)
|
||||
* @def FREE(x)
|
||||
* Free x and set to NULL
|
||||
*/
|
||||
#define FREE(x) do { free(x); x = NULL; } while (0)
|
||||
|
||||
/**
|
||||
* @def IF_FREE(x)
|
||||
* If x is set, free x and set to NULL
|
||||
* @def IF_FREE(x)
|
||||
* If x is set, free x and set to NULL
|
||||
*/
|
||||
#define IF_FREE(x) do { if (x) FREE(x); } while (0)
|
||||
|
||||
|
@ -66,7 +66,7 @@
|
|||
} while (0)
|
||||
|
||||
/**
|
||||
* @def IF_FREE_LIST(x)
|
||||
* @def IF_FREE_LIST(x)
|
||||
* If x is a valid pointer destroy x and set to NULL
|
||||
*/
|
||||
#define IF_FREE_LIST(x) do { \
|
||||
|
@ -77,7 +77,7 @@
|
|||
} while (0)
|
||||
|
||||
/**
|
||||
* @def IF_FREE_DLIST(x)
|
||||
* @def IF_FREE_DLIST(x)
|
||||
* If x is a valid pointer destroy x and set to NULL
|
||||
*/
|
||||
#define IF_FREE_DLIST(x) do { \
|
||||
|
@ -88,7 +88,7 @@
|
|||
} while (0)
|
||||
|
||||
/**
|
||||
* @def IF_FREE_HASH(x)
|
||||
* @def IF_FREE_HASH(x)
|
||||
* If x is a valid pointer destroy x and set to NULL
|
||||
*/
|
||||
#define IF_FREE_HASH(x) do { \
|
||||
|
@ -120,7 +120,7 @@
|
|||
* @internal
|
||||
* The different types of commands in an Exec entry
|
||||
*/
|
||||
enum Efreet_Desktop_Command_Flag
|
||||
enum Efreet_Desktop_Command_Flag
|
||||
{
|
||||
EFREET_DESKTOP_EXEC_FLAG_FULLPATH = 0x0001,
|
||||
EFREET_DESKTOP_EXEC_FLAG_URI = 0x0002,
|
||||
|
@ -187,8 +187,8 @@ void efreet_icon_shutdown(void);
|
|||
|
||||
int efreet_menu_init(void);
|
||||
void efreet_menu_shutdown(void);
|
||||
Ecore_List *efreet_default_dirs_get(const char *user_dir,
|
||||
Ecore_List *system_dirs,
|
||||
Ecore_List *efreet_default_dirs_get(const char *user_dir,
|
||||
Ecore_List *system_dirs,
|
||||
const char *suffix);
|
||||
|
||||
int efreet_ini_init(void);
|
||||
|
@ -212,4 +212,3 @@ const char *efreet_desktop_environment_get(void);
|
|||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
|
@ -491,7 +491,7 @@ efreet_util_cache_fill(void *data __UNUSED__)
|
|||
printf("%d\n", ecore_hash_count(desktop_by_file_id));
|
||||
#endif
|
||||
ecore_event_add(EFREET_EVENT_DESKTOP_LIST_CHANGE, NULL, NULL, NULL);
|
||||
|
||||
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
@ -1047,7 +1047,7 @@ efreet_util_desktops_by_category_add(Efreet_Desktop *desktop)
|
|||
if (!list)
|
||||
{
|
||||
list = ecore_list_new();
|
||||
ecore_hash_set(desktops_by_category,
|
||||
ecore_hash_set(desktops_by_category,
|
||||
(void *)ecore_string_instance(category), list);
|
||||
}
|
||||
if (!ecore_list_goto(list, desktop))
|
||||
|
|
|
@ -6,7 +6,7 @@ static void efreet_xml_dump(Efreet_Xml *xml, int level);
|
|||
|
||||
static Efreet_Xml *efreet_xml_parse(char **data, int *size);
|
||||
static int efreet_xml_tag_parse(char **data, int *size, const char **tag);
|
||||
static void efreet_xml_attributes_parse(char **data, int *size,
|
||||
static void efreet_xml_attributes_parse(char **data, int *size,
|
||||
Efreet_Xml_Attribute ***attributes);
|
||||
static void efreet_xml_text_parse(char **data, int *size, char **text);
|
||||
|
||||
|
@ -117,7 +117,7 @@ efreet_xml_del(Efreet_Xml *xml)
|
|||
IF_FREE(xml->text);
|
||||
FREE(xml);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @param xml: The xml struct to work with
|
||||
* @param key: The attribute key to look for
|
||||
|
@ -150,7 +150,7 @@ efreet_xml_dump(Efreet_Xml *xml, int level)
|
|||
{
|
||||
int i;
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
for (i = 0; i < level; i++)
|
||||
printf("\t");
|
||||
printf("<%s", xml->tag);
|
||||
if (xml->attributes)
|
||||
|
@ -170,7 +170,7 @@ efreet_xml_dump(Efreet_Xml *xml, int level)
|
|||
while ((child = ecore_dlist_next(xml->children)))
|
||||
efreet_xml_dump(child, level + 1);
|
||||
|
||||
for (i = 0; i < level; i++)
|
||||
for (i = 0; i < level; i++)
|
||||
printf("\t");
|
||||
printf("</%s>\n", xml->tag);
|
||||
}
|
||||
|
@ -234,7 +234,7 @@ efreet_xml_tag_parse(char **data, int *size, const char **tag)
|
|||
if (*(*data + 1) == '/') return 0;
|
||||
|
||||
/* skip comments */
|
||||
if (*size > 3 && *(*data + 1) == '!' && *(*data + 2) == '-' && *(*data + 3) == '-')
|
||||
if (*size > 3 && *(*data + 1) == '!' && *(*data + 2) == '-' && *(*data + 3) == '-')
|
||||
{
|
||||
(*data) += 3;
|
||||
(*size) -= 3;
|
||||
|
@ -562,7 +562,7 @@ efreet_xml_tag_close(char **data, int *size, const char *tag)
|
|||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
static void
|
||||
efreet_xml_comment_skip(char **data, int *size)
|
||||
{
|
||||
while (*size > 2)
|
||||
|
|
|
@ -6,18 +6,18 @@
|
|||
* @internal
|
||||
* @file efreet_xml.h
|
||||
* @brief A simple and fast XML parser
|
||||
* @addtogroup Efreet_Xml Efreet_Xml: An XML parser
|
||||
* @addtogroup Efreet_Xml Efreet_Xml: An XML parser
|
||||
*
|
||||
* @{
|
||||
*/
|
||||
|
||||
/**
|
||||
* Efreet_Xml_Attributes
|
||||
* Efreet_Xml_Attributes
|
||||
*/
|
||||
typedef struct Efreet_Xml_Attribute Efreet_Xml_Attribute;
|
||||
|
||||
/**
|
||||
* Efreet_Xml_Attributes
|
||||
* Efreet_Xml_Attributes
|
||||
* @brief Contains information about a given XML attribute
|
||||
*/
|
||||
struct Efreet_Xml_Attribute
|
||||
|
@ -32,7 +32,7 @@ struct Efreet_Xml_Attribute
|
|||
typedef struct Efreet_Xml Efreet_Xml;
|
||||
|
||||
/**
|
||||
* Efreet_Xml
|
||||
* Efreet_Xml
|
||||
* @brief Contains the XML tree for a given XML document
|
||||
*/
|
||||
struct Efreet_Xml
|
||||
|
@ -58,4 +58,3 @@ const char *efreet_xml_attribute_get(Efreet_Xml *xml, const char *key);
|
|||
*/
|
||||
|
||||
#endif
|
||||
|
||||
|
|
Loading…
Reference in New Issue