code
stringlengths
3
1.01M
repo_name
stringlengths
5
116
path
stringlengths
3
311
language
stringclasses
30 values
license
stringclasses
15 values
size
int64
3
1.01M
/* * kernel/power/suspend.c - Suspend to RAM and standby functionality. * * Copyright (c) 2003 Patrick Mochel * Copyright (c) 2003 Open Source Development Lab * Copyright (c) 2009 Rafael J. Wysocki <rjw@sisk.pl>, Novell Inc. * * This file is released under the GPLv2. */ #define pr_fmt(fmt) "PM: " fmt #include <linux/string.h> #include <linux/delay.h> #include <linux/errno.h> #include <linux/init.h> #include <linux/console.h> #include <linux/cpu.h> #include <linux/cpuidle.h> #include <linux/syscalls.h> #include <linux/gfp.h> #include <linux/io.h> #include <linux/kernel.h> #include <linux/list.h> #include <linux/mm.h> #include <linux/slab.h> #include <linux/export.h> #include <linux/suspend.h> #include <linux/syscore_ops.h> #include <linux/ftrace.h> #include <trace/events/power.h> #include <linux/compiler.h> #include <linux/moduleparam.h> #include "power.h" const char * const pm_labels[] = { [PM_SUSPEND_TO_IDLE] = "freeze", [PM_SUSPEND_STANDBY] = "standby", [PM_SUSPEND_MEM] = "mem", }; const char *pm_states[PM_SUSPEND_MAX]; static const char * const mem_sleep_labels[] = { [PM_SUSPEND_TO_IDLE] = "s2idle", [PM_SUSPEND_STANDBY] = "shallow", [PM_SUSPEND_MEM] = "deep", }; const char *mem_sleep_states[PM_SUSPEND_MAX]; suspend_state_t mem_sleep_current = PM_SUSPEND_TO_IDLE; suspend_state_t mem_sleep_default = PM_SUSPEND_MAX; suspend_state_t pm_suspend_target_state; EXPORT_SYMBOL_GPL(pm_suspend_target_state); unsigned int pm_suspend_global_flags; EXPORT_SYMBOL_GPL(pm_suspend_global_flags); static const struct platform_suspend_ops *suspend_ops; static const struct platform_s2idle_ops *s2idle_ops; static DECLARE_WAIT_QUEUE_HEAD(s2idle_wait_head); enum s2idle_states __read_mostly s2idle_state; static DEFINE_SPINLOCK(s2idle_lock); void s2idle_set_ops(const struct platform_s2idle_ops *ops) { lock_system_sleep(); s2idle_ops = ops; unlock_system_sleep(); } static void s2idle_begin(void) { s2idle_state = S2IDLE_STATE_NONE; } static void s2idle_enter(void) { trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, true); spin_lock_irq(&s2idle_lock); if (pm_wakeup_pending()) goto out; s2idle_state = S2IDLE_STATE_ENTER; spin_unlock_irq(&s2idle_lock); get_online_cpus(); cpuidle_resume(); /* Push all the CPUs into the idle loop. */ wake_up_all_idle_cpus(); /* Make the current CPU wait so it can enter the idle loop too. */ wait_event(s2idle_wait_head, s2idle_state == S2IDLE_STATE_WAKE); cpuidle_pause(); put_online_cpus(); spin_lock_irq(&s2idle_lock); out: s2idle_state = S2IDLE_STATE_NONE; spin_unlock_irq(&s2idle_lock); trace_suspend_resume(TPS("machine_suspend"), PM_SUSPEND_TO_IDLE, false); } static void s2idle_loop(void) { pm_pr_dbg("suspend-to-idle\n"); for (;;) { int error; dpm_noirq_begin(); /* * Suspend-to-idle equals * frozen processes + suspended devices + idle processors. * Thus s2idle_enter() should be called right after * all devices have been suspended. */ error = dpm_noirq_suspend_devices(PMSG_SUSPEND); if (!error) s2idle_enter(); dpm_noirq_resume_devices(PMSG_RESUME); if (error && (error != -EBUSY || !pm_wakeup_pending())) { dpm_noirq_end(); break; } if (s2idle_ops && s2idle_ops->wake) s2idle_ops->wake(); dpm_noirq_end(); if (s2idle_ops && s2idle_ops->sync) s2idle_ops->sync(); if (pm_wakeup_pending()) break; pm_wakeup_clear(false); } pm_pr_dbg("resume from suspend-to-idle\n"); } void s2idle_wake(void) { unsigned long flags; spin_lock_irqsave(&s2idle_lock, flags); if (s2idle_state > S2IDLE_STATE_NONE) { s2idle_state = S2IDLE_STATE_WAKE; wake_up(&s2idle_wait_head); } spin_unlock_irqrestore(&s2idle_lock, flags); } EXPORT_SYMBOL_GPL(s2idle_wake); static bool valid_state(suspend_state_t state) { /* * PM_SUSPEND_STANDBY and PM_SUSPEND_MEM states need low level * support and need to be valid to the low level * implementation, no valid callback implies that none are valid. */ return suspend_ops && suspend_ops->valid && suspend_ops->valid(state); } void __init pm_states_init(void) { /* "mem" and "freeze" are always present in /sys/power/state. */ pm_states[PM_SUSPEND_MEM] = pm_labels[PM_SUSPEND_MEM]; pm_states[PM_SUSPEND_TO_IDLE] = pm_labels[PM_SUSPEND_TO_IDLE]; /* * Suspend-to-idle should be supported even without any suspend_ops, * initialize mem_sleep_states[] accordingly here. */ mem_sleep_states[PM_SUSPEND_TO_IDLE] = mem_sleep_labels[PM_SUSPEND_TO_IDLE]; } static int __init mem_sleep_default_setup(char *str) { suspend_state_t state; for (state = PM_SUSPEND_TO_IDLE; state <= PM_SUSPEND_MEM; state++) if (mem_sleep_labels[state] && !strcmp(str, mem_sleep_labels[state])) { mem_sleep_default = state; break; } return 1; } __setup("mem_sleep_default=", mem_sleep_default_setup); /** * suspend_set_ops - Set the global suspend method table. * @ops: Suspend operations to use. */ void suspend_set_ops(const struct platform_suspend_ops *ops) { lock_system_sleep(); suspend_ops = ops; if (valid_state(PM_SUSPEND_STANDBY)) { mem_sleep_states[PM_SUSPEND_STANDBY] = mem_sleep_labels[PM_SUSPEND_STANDBY]; pm_states[PM_SUSPEND_STANDBY] = pm_labels[PM_SUSPEND_STANDBY]; if (mem_sleep_default == PM_SUSPEND_STANDBY) mem_sleep_current = PM_SUSPEND_STANDBY; } if (valid_state(PM_SUSPEND_MEM)) { mem_sleep_states[PM_SUSPEND_MEM] = mem_sleep_labels[PM_SUSPEND_MEM]; if (mem_sleep_default >= PM_SUSPEND_MEM) mem_sleep_current = PM_SUSPEND_MEM; } unlock_system_sleep(); } EXPORT_SYMBOL_GPL(suspend_set_ops); /** * suspend_valid_only_mem - Generic memory-only valid callback. * * Platform drivers that implement mem suspend only and only need to check for * that in their .valid() callback can use this instead of rolling their own * .valid() callback. */ int suspend_valid_only_mem(suspend_state_t state) { return state == PM_SUSPEND_MEM; } EXPORT_SYMBOL_GPL(suspend_valid_only_mem); static bool sleep_state_supported(suspend_state_t state) { return state == PM_SUSPEND_TO_IDLE || (suspend_ops && suspend_ops->enter); } static int platform_suspend_prepare(suspend_state_t state) { return state != PM_SUSPEND_TO_IDLE && suspend_ops->prepare ? suspend_ops->prepare() : 0; } static int platform_suspend_prepare_late(suspend_state_t state) { return state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->prepare ? s2idle_ops->prepare() : 0; } static int platform_suspend_prepare_noirq(suspend_state_t state) { return state != PM_SUSPEND_TO_IDLE && suspend_ops->prepare_late ? suspend_ops->prepare_late() : 0; } static void platform_resume_noirq(suspend_state_t state) { if (state != PM_SUSPEND_TO_IDLE && suspend_ops->wake) suspend_ops->wake(); } static void platform_resume_early(suspend_state_t state) { if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->restore) s2idle_ops->restore(); } static void platform_resume_finish(suspend_state_t state) { if (state != PM_SUSPEND_TO_IDLE && suspend_ops->finish) suspend_ops->finish(); } static int platform_suspend_begin(suspend_state_t state) { if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->begin) return s2idle_ops->begin(); else if (suspend_ops && suspend_ops->begin) return suspend_ops->begin(state); else return 0; } static void platform_resume_end(suspend_state_t state) { if (state == PM_SUSPEND_TO_IDLE && s2idle_ops && s2idle_ops->end) s2idle_ops->end(); else if (suspend_ops && suspend_ops->end) suspend_ops->end(); } static void platform_recover(suspend_state_t state) { if (state != PM_SUSPEND_TO_IDLE && suspend_ops->recover) suspend_ops->recover(); } static bool platform_suspend_again(suspend_state_t state) { return state != PM_SUSPEND_TO_IDLE && suspend_ops->suspend_again ? suspend_ops->suspend_again() : false; } #ifdef CONFIG_PM_DEBUG static unsigned int pm_test_delay = 5; module_param(pm_test_delay, uint, 0644); MODULE_PARM_DESC(pm_test_delay, "Number of seconds to wait before resuming from suspend test"); #endif static int suspend_test(int level) { #ifdef CONFIG_PM_DEBUG if (pm_test_level == level) { pr_info("suspend debug: Waiting for %d second(s).\n", pm_test_delay); mdelay(pm_test_delay * 1000); return 1; } #endif /* !CONFIG_PM_DEBUG */ return 0; } /** * suspend_prepare - Prepare for entering system sleep state. * * Common code run for every system sleep state that can be entered (except for * hibernation). Run suspend notifiers, allocate the "suspend" console and * freeze processes. */ static int suspend_prepare(suspend_state_t state) { int error, nr_calls = 0; if (!sleep_state_supported(state)) return -EPERM; pm_prepare_console(); error = __pm_notifier_call_chain(PM_SUSPEND_PREPARE, -1, &nr_calls); if (error) { nr_calls--; goto Finish; } trace_suspend_resume(TPS("freeze_processes"), 0, true); error = suspend_freeze_processes(); trace_suspend_resume(TPS("freeze_processes"), 0, false); if (!error) return 0; suspend_stats.failed_freeze++; dpm_save_failed_step(SUSPEND_FREEZE); Finish: __pm_notifier_call_chain(PM_POST_SUSPEND, nr_calls, NULL); pm_restore_console(); return error; } /* default implementation */ void __weak arch_suspend_disable_irqs(void) { local_irq_disable(); } /* default implementation */ void __weak arch_suspend_enable_irqs(void) { local_irq_enable(); } /** * suspend_enter - Make the system enter the given sleep state. * @state: System sleep state to enter. * @wakeup: Returns information that the sleep state should not be re-entered. * * This function should be called after devices have been suspended. */ static int suspend_enter(suspend_state_t state, bool *wakeup) { int error; error = platform_suspend_prepare(state); if (error) goto Platform_finish; error = dpm_suspend_late(PMSG_SUSPEND); if (error) { pr_err("late suspend of devices failed\n"); goto Platform_finish; } error = platform_suspend_prepare_late(state); if (error) goto Devices_early_resume; if (state == PM_SUSPEND_TO_IDLE && pm_test_level != TEST_PLATFORM) { s2idle_loop(); goto Platform_early_resume; } error = dpm_suspend_noirq(PMSG_SUSPEND); if (error) { pr_err("noirq suspend of devices failed\n"); goto Platform_early_resume; } error = platform_suspend_prepare_noirq(state); if (error) goto Platform_wake; if (suspend_test(TEST_PLATFORM)) goto Platform_wake; error = disable_nonboot_cpus(); if (error || suspend_test(TEST_CPUS)) goto Enable_cpus; arch_suspend_disable_irqs(); BUG_ON(!irqs_disabled()); error = syscore_suspend(); if (!error) { *wakeup = pm_wakeup_pending(); if (!(suspend_test(TEST_CORE) || *wakeup)) { trace_suspend_resume(TPS("machine_suspend"), state, true); error = suspend_ops->enter(state); trace_suspend_resume(TPS("machine_suspend"), state, false); events_check_enabled = false; } else if (*wakeup) { error = -EBUSY; } syscore_resume(); } arch_suspend_enable_irqs(); BUG_ON(irqs_disabled()); Enable_cpus: enable_nonboot_cpus(); Platform_wake: platform_resume_noirq(state); dpm_resume_noirq(PMSG_RESUME); Platform_early_resume: platform_resume_early(state); Devices_early_resume: dpm_resume_early(PMSG_RESUME); Platform_finish: platform_resume_finish(state); return error; } /** * suspend_devices_and_enter - Suspend devices and enter system sleep state. * @state: System sleep state to enter. */ int suspend_devices_and_enter(suspend_state_t state) { int error; bool wakeup = false; if (!sleep_state_supported(state)) return -ENOSYS; pm_suspend_target_state = state; error = platform_suspend_begin(state); if (error) goto Close; suspend_console(); suspend_test_start(); error = dpm_suspend_start(PMSG_SUSPEND); if (error) { pr_err("Some devices failed to suspend, or early wake event detected\n"); goto Recover_platform; } suspend_test_finish("suspend devices"); if (suspend_test(TEST_DEVICES)) goto Recover_platform; do { error = suspend_enter(state, &wakeup); } while (!error && !wakeup && platform_suspend_again(state)); Resume_devices: suspend_test_start(); dpm_resume_end(PMSG_RESUME); suspend_test_finish("resume devices"); trace_suspend_resume(TPS("resume_console"), state, true); resume_console(); trace_suspend_resume(TPS("resume_console"), state, false); Close: platform_resume_end(state); pm_suspend_target_state = PM_SUSPEND_ON; return error; Recover_platform: platform_recover(state); goto Resume_devices; } /** * suspend_finish - Clean up before finishing the suspend sequence. * * Call platform code to clean up, restart processes, and free the console that * we've allocated. This routine is not called for hibernation. */ static void suspend_finish(void) { suspend_thaw_processes(); pm_notifier_call_chain(PM_POST_SUSPEND); pm_restore_console(); } /** * enter_state - Do common work needed to enter system sleep state. * @state: System sleep state to enter. * * Make sure that no one else is trying to put the system into a sleep state. * Fail if that's not the case. Otherwise, prepare for system suspend, make the * system enter the given sleep state and clean up after wakeup. */ static int enter_state(suspend_state_t state) { int error; trace_suspend_resume(TPS("suspend_enter"), state, true); if (state == PM_SUSPEND_TO_IDLE) { #ifdef CONFIG_PM_DEBUG if (pm_test_level != TEST_NONE && pm_test_level <= TEST_CPUS) { pr_warn("Unsupported test mode for suspend to idle, please choose none/freezer/devices/platform.\n"); return -EAGAIN; } #endif } else if (!valid_state(state)) { return -EINVAL; } if (!mutex_trylock(&pm_mutex)) return -EBUSY; if (state == PM_SUSPEND_TO_IDLE) s2idle_begin(); #ifndef CONFIG_SUSPEND_SKIP_SYNC trace_suspend_resume(TPS("sync_filesystems"), 0, true); pr_info("Syncing filesystems ... "); sys_sync(); pr_cont("done.\n"); trace_suspend_resume(TPS("sync_filesystems"), 0, false); #endif pm_pr_dbg("Preparing system for sleep (%s)\n", mem_sleep_labels[state]); pm_suspend_clear_flags(); error = suspend_prepare(state); if (error) goto Unlock; if (suspend_test(TEST_FREEZER)) goto Finish; trace_suspend_resume(TPS("suspend_enter"), state, false); pm_pr_dbg("Suspending system (%s)\n", mem_sleep_labels[state]); pm_restrict_gfp_mask(); error = suspend_devices_and_enter(state); pm_restore_gfp_mask(); Finish: pm_pr_dbg("Finishing wakeup.\n"); suspend_finish(); Unlock: mutex_unlock(&pm_mutex); return error; } /** * pm_suspend - Externally visible function for suspending the system. * @state: System sleep state to enter. * * Check if the value of @state represents one of the supported states, * execute enter_state() and update system suspend statistics. */ int pm_suspend(suspend_state_t state) { int error; if (state <= PM_SUSPEND_ON || state >= PM_SUSPEND_MAX) return -EINVAL; pr_info("suspend entry (%s)\n", mem_sleep_labels[state]); error = enter_state(state); if (error) { suspend_stats.fail++; dpm_save_failed_errno(error); } else { suspend_stats.success++; } pr_info("suspend exit\n"); return error; } EXPORT_SYMBOL(pm_suspend);
jmahler/linux-next
kernel/power/suspend.c
C
gpl-2.0
15,184
require 'faker' FactoryBot.define do factory :kudo do |f| f.commentable_id { FactoryBot.create(:work).id } f.commentable_type { "Work" } end end
ariana-paris/otwarchive
factories/kudos.rb
Ruby
gpl-2.0
158
/* * Copyright(c) 2009 Intel Corporation. All rights reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms and conditions of the GNU General Public License, * version 2, as published by the Free Software Foundation. * * This program is distributed in the hope it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along with * this program; if not, write to the Free Software Foundation, Inc., * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA. * * Maintained at www.Open-FCoE.org */ #ifndef _FCOE_H_ #define _FCOE_H_ #include <linux/skbuff.h> #include <linux/kthread.h> #define FCOE_MAX_QUEUE_DEPTH 256 #define FCOE_MIN_QUEUE_DEPTH 32 #define FCOE_WORD_TO_BYTE 4 #define FCOE_VERSION "0.1" #define FCOE_NAME "fcoe" #define FCOE_VENDOR "Open-FCoE.org" #define FCOE_MAX_LUN 0xFFFF #define FCOE_MAX_FCP_TARGET 256 #define FCOE_MAX_OUTSTANDING_COMMANDS 1024 #define FCOE_MIN_XID 0x0000 /* */ #define FCOE_MAX_XID 0x0FFF /* */ extern unsigned int fcoe_debug_logging; #define FCOE_LOGGING 0x01 /* */ #define FCOE_NETDEV_LOGGING 0x02 /* */ #define FCOE_CHECK_LOGGING(LEVEL, CMD) \ do { \ if (unlikely(fcoe_debug_logging & LEVEL)) \ do { \ CMD; \ } while (0); \ } while (0) #define FCOE_DBG(fmt, args...) \ FCOE_CHECK_LOGGING(FCOE_LOGGING, \ printk(KERN_INFO "fcoe: " fmt, ##args);) #define FCOE_NETDEV_DBG(netdev, fmt, args...) \ FCOE_CHECK_LOGGING(FCOE_NETDEV_LOGGING, \ printk(KERN_INFO "fcoe: %s: " fmt, \ netdev->name, ##args);) /* */ struct fcoe_interface { struct list_head list; struct net_device *netdev; struct net_device *realdev; struct packet_type fcoe_packet_type; struct packet_type fip_packet_type; struct fcoe_ctlr ctlr; struct fc_exch_mgr *oem; }; #define fcoe_from_ctlr(fip) container_of(fip, struct fcoe_interface, ctlr) /* */ static inline struct net_device *fcoe_netdev(const struct fc_lport *lport) { return ((struct fcoe_interface *) ((struct fcoe_port *)lport_priv(lport))->priv)->netdev; } #endif /* */
curbthepain/revkernel_us990
drivers/scsi/fcoe/fcoe.h
C
gpl-2.0
3,041
/**************************************************************************** ** ** This file is part of the Qt Extended Opensource Package. ** ** Copyright (C) 2009 Trolltech ASA. ** ** Contact: Qt Extended Information (info@qtextended.org) ** ** This file may be used under the terms of the GNU General Public License ** version 2.0 as published by the Free Software Foundation and appearing ** in the file LICENSE.GPL included in the packaging of this file. ** ** Please review the following information to ensure GNU General Public ** Licensing requirements will be met: ** http://www.fsf.org/licensing/licenses/info/GPLv2.html. ** ** ****************************************************************************/ #ifndef SLIDEINMESSAGEBOX_H #define SLIDEINMESSAGEBOX_H #include <QWidget> #include "qabstractmessagebox.h" class QString; class SlideInMessageBoxPrivate; class SlideInMessageBox : public QAbstractMessageBox { Q_OBJECT public: SlideInMessageBox(QWidget *parent = 0, Qt::WFlags flags = 0); virtual ~SlideInMessageBox(); virtual void setButtons(Button button1, Button button2); virtual void setButtons(const QString &button0Text, const QString &button1Text, const QString &button2Text, int defaultButtonNumber, int escapeButtonNumber); virtual Icon icon() const; virtual void setIcon(Icon); virtual void setIconPixmap(const QPixmap&); virtual QString title() const; virtual void setTitle(const QString &); virtual QString text() const; virtual void setText(const QString &); virtual QSize sizeHint() const; virtual QPixmap pixmap() const; protected: virtual void showEvent(QShowEvent *); virtual void paintEvent(QPaintEvent *); virtual void keyPressEvent(QKeyEvent *); private slots: void valueChanged(qreal); private: void renderBox(); void animate(); void drawFrame(QPainter *painter, const QRect &r, const QString &title); SlideInMessageBoxPrivate *d; }; #endif
liuyanghejerry/qtextended
src/server/ui/abstractinterfaces/slideinmessagebox/slideinmessagebox.h
C
gpl-2.0
1,994
<?php /** * @version $Id: moduleposition.php 4795 2012-10-30 23:22:49Z steph $ * @author RocketTheme http://www.rockettheme.com * @copyright Copyright (C) 2007 - 2015 RocketTheme, LLC * @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPLv2 only */ defined('JPATH_BASE') or die; jimport('joomla.form.formfield'); JFormHelper::loadFieldClass('text'); /** * Supports a modal article picker. * * @package Joomla.Administrator * @subpackage com_content * @since 1.6 */ class JFormFieldModulePosition extends JFormFieldText { /** * The form field type. * * @var string * @since 1.6 */ protected $type = 'ModulePosition'; /** * Method to get the field input markup. * * @return string The field input markup. * @since 1.6 */ protected function getInput() { $lang = JFactory::getLanguage(); $lang->load('mod_roknavmenu', JPATH_BASE, null, false, false) || $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', null, false, false) || $lang->load('mod_roknavmenu', JPATH_BASE, $lang->getDefault(), false, false) || $lang->load('mod_roknavmenu', JPATH_SITE.'/modules/mod_roknavmenu', $lang->getDefault(), false, false); // Get the client id. $clientId = $this->element['client_id']; if (!isset($clientId)) { $clientName = $this->element['client']; if (isset($clientName)) { $client = JApplicationHelper::getClientInfo($clientName, true); $clientId = $client->id; } } if (!isset($clientId) && $this->form instanceof JForm) { $clientId = $this->form->getValue('client_id'); } $clientId = (int) $clientId; // Load the modal behavior script. JHtml::_('behavior.modal', 'a.modal'); // Build the script. $script = array(); $script[] = ' function jSelectPosition_'.$this->id.'(name) {'; $script[] = ' document.id("'.$this->id.'").value = name;'; $script[] = ' SqueezeBox.close();'; $script[] = ' }'; // Add the script to the document head. JFactory::getDocument()->addScriptDeclaration(implode("\n", $script)); // Setup variables for display. $html = array(); $link = 'index.php?option=com_modules&amp;view=positions&amp;layout=modal&amp;tmpl=component&amp;function=jSelectPosition_'.$this->id.'&amp;client_id='.$clientId; // The current user display field. $html[] = '<div class="fltlft">'; $html[] = parent::getInput(); $html[] = '</div>'; // The user select button. $html[] = '<div class="button2-left">'; $html[] = ' <div class="blank">'; $html[] = ' <a class="modal" title="'.JText::_('MOD_ROKNAVMENU_SELECT_MODULE_POSITION').'" href="'.$link.'" rel="{handler: \'iframe\', size: {x: 800, y: 450}}">'.JText::_('MOD_ROKNAVMENU_SELECT_MODULE_POSITION').'</a>'; $html[] = ' </div>'; $html[] = '</div>'; return implode("\n", $html); } }
aarguellesuninorte/espanolsinrollos
tmp/install_5541379120743/mod_roknavmenu/fields/moduleposition.php
PHP
gpl-2.0
2,830
<?php class UpdateObject { var $soapclient; function UpdateObject() { $this->soapclient = new SoapClient("http://".$GLOBALS['apiusername'].":".$GLOBALS['apipassword']."@".$GLOBALS['epacehost']."/rpc/services/UpdateObject?wsdl", array("trace"=> 1,'login' => $GLOBALS['apiusername'], 'password' => $GLOBALS['apipassword'])); } function setJob($job) { $this->soapclient->updateJob( array('job' => $job) ); } } ?>
tmansuri/dev.transport.tc
wp-content/plugins/orders/classes/pace/updateObject.php
PHP
gpl-2.0
448
@charset "iso-8859-1"; A:link {text-decoration: none; color: #000066;} A:hover {text-decoration: underline; color: #3333ff; } A:active {text-decoration: none;} A:visited {text-decoration: none; color: #000066;} A:visited:hover {text-decoration: underline; color: #3333ff; }
timschofield/care2x
css/linkcolor.css
CSS
gpl-2.0
275
/********************************************************************* * * Filename: ircomm_tty_attach.h * Version: * Description: * Status: Experimental. * Author: Dag Brattli <dagb@cs.uit.no> * Created at: Wed Jun 9 15:55:18 1999 * Modified at: Fri Dec 10 21:04:55 1999 * Modified by: Dag Brattli <dagb@cs.uit.no> * * Copyright (c) 1999 Dag Brattli, All Rights Reserved. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA * ********************************************************************/ #ifndef IRCOMM_TTY_ATTACH_H #define IRCOMM_TTY_ATTACH_H #include <net/irda/ircomm_tty.h> typedef enum { IRCOMM_TTY_IDLE, IRCOMM_TTY_SEARCH, IRCOMM_TTY_QUERY_PARAMETERS, IRCOMM_TTY_QUERY_LSAP_SEL, IRCOMM_TTY_SETUP, IRCOMM_TTY_READY, } IRCOMM_TTY_STATE; /* IrCOMM TTY Events */ typedef enum { IRCOMM_TTY_ATTACH_CABLE, IRCOMM_TTY_DETACH_CABLE, IRCOMM_TTY_DATA_REQUEST, IRCOMM_TTY_DATA_INDICATION, IRCOMM_TTY_DISCOVERY_REQUEST, IRCOMM_TTY_DISCOVERY_INDICATION, IRCOMM_TTY_CONNECT_CONFIRM, IRCOMM_TTY_CONNECT_INDICATION, IRCOMM_TTY_DISCONNECT_REQUEST, IRCOMM_TTY_DISCONNECT_INDICATION, IRCOMM_TTY_WD_TIMER_EXPIRED, IRCOMM_TTY_GOT_PARAMETERS, IRCOMM_TTY_GOT_LSAPSEL, } IRCOMM_TTY_EVENT; /* Used for passing information through the state-machine */ struct ircomm_tty_info { __u32 saddr; /* Source device address */ __u32 daddr; /* Destination device address */ __u8 dlsap_sel; }; extern const char *const ircomm_state[]; extern const char *const ircomm_tty_state[]; int ircomm_tty_do_event(struct ircomm_tty_cb *self, IRCOMM_TTY_EVENT event, struct sk_buff *skb, struct ircomm_tty_info *info); int ircomm_tty_attach_cable(struct ircomm_tty_cb *self); void ircomm_tty_detach_cable(struct ircomm_tty_cb *self); void ircomm_tty_connect_confirm(void *instance, void *sap, struct qos_info *qos, __u32 max_sdu_size, __u8 max_header_size, struct sk_buff *skb); void ircomm_tty_disconnect_indication(void *instance, void *sap, LM_REASON reason, struct sk_buff *skb); void ircomm_tty_connect_indication(void *instance, void *sap, struct qos_info *qos, __u32 max_sdu_size, __u8 max_header_size, struct sk_buff *skb); int ircomm_tty_send_initial_parameters(struct ircomm_tty_cb *self); void ircomm_tty_link_established(struct ircomm_tty_cb *self); #endif /* IRCOMM_TTY_ATTACH_H */
davidmueller13/arter97_bb
include/net/irda/ircomm_tty_attach.h
C
gpl-2.0
3,199
<?php /** * @package Joomla.Platform * @subpackage Google * * @copyright (C) 2013 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE */ defined('JPATH_PLATFORM') or die; use Joomla\Registry\Registry; /** * Google+ data class for the Joomla Platform. * * @since 3.1.4 * @deprecated 4.0 Use the `joomla/google` package via Composer instead */ class JGoogleDataPlusComments extends JGoogleData { /** * Constructor. * * @param Registry $options Google options object * @param JGoogleAuth $auth Google data http client object * * @since 3.1.4 */ public function __construct(Registry $options = null, JGoogleAuth $auth = null) { parent::__construct($options, $auth); if (isset($this->auth) && !$this->auth->getOption('scope')) { $this->auth->setOption('scope', 'https://www.googleapis.com/auth/plus.me'); } } /** * List all of the comments for an activity. * * @param string $activityId The ID of the activity to get comments for. * @param string $fields Used to specify the fields you want returned. * @param integer $max The maximum number of people to include in the response, used for paging. * @param string $order The order in which to sort the list of comments. Acceptable values are "ascending" and "descending". * @param string $token The continuation token, used to page through large result sets. To get the next page of results, set this * parameter to the value of "nextPageToken" from the previous response. This token may be of any length. * @param string $alt Specifies an alternative representation type. Acceptable values are: "json" - Use JSON format (default) * * @return mixed Data from Google * * @since 3.1.4 */ public function listComments($activityId, $fields = null, $max = 20, $order = null, $token = null, $alt = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'activities/' . $activityId . '/comments'; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } // Check if max is specified. if ($max != 20) { $url .= (strpos($url, '?') === false) ? '?maxResults=' : '&maxResults='; $url .= $max; } // Check if order is specified. if ($order) { $url .= (strpos($url, '?') === false) ? '?orderBy=' : '&orderBy='; $url .= $order; } // Check of token is specified. if ($token) { $url .= (strpos($url, '?') === false) ? '?pageToken=' : '&pageToken='; $url .= $token; } // Check if alt is specified. if ($alt) { $url .= (strpos($url, '?') === false) ? '?alt=' : '&alt='; $url .= $alt; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } /** * Get a comment. * * @param string $id The ID of the comment to get. * @param string $fields Used to specify the fields you want returned. * * @return mixed Data from Google * * @since 3.1.4 */ public function getComment($id, $fields = null) { if ($this->isAuthenticated()) { $url = $this->getOption('api.url') . 'comments/' . $id; // Check if fields is specified. if ($fields) { $url .= '?fields=' . $fields; } $jdata = $this->auth->query($url); return json_decode($jdata->body, true); } else { return false; } } }
zero-24/joomla-cms
libraries/joomla/google/data/plus/comments.php
PHP
gpl-2.0
3,539
/* * Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * This is not a regression test, but a micro-benchmark. * * I have run this as follows: * * repeat 5 for f in -client -server; do mergeBench dolphin . jr -dsa -da $f RangeCheckMicroBenchmark.java; done * * * @author Martin Buchholz */ import java.util.*; import java.util.regex.Pattern; import java.util.concurrent.CountDownLatch; public class RangeCheckMicroBenchmark { abstract static class Job { private final String name; Job(String name) { this.name = name; } String name() { return name; } abstract void work() throws Throwable; } private static void collectAllGarbage() { final CountDownLatch drained = new CountDownLatch(1); try { System.gc(); // enqueue finalizable objects new Object() { protected void finalize() { drained.countDown(); }}; System.gc(); // enqueue detector drained.await(); // wait for finalizer queue to drain System.gc(); // cleanup finalized objects } catch (InterruptedException e) { throw new Error(e); } } /** * Runs each job for long enough that all the runtime compilers * have had plenty of time to warm up, i.e. get around to * compiling everything worth compiling. * Returns array of average times per job per run. */ private static long[] time0(Job ... jobs) throws Throwable { final long warmupNanos = 10L * 1000L * 1000L * 1000L; long[] nanoss = new long[jobs.length]; for (int i = 0; i < jobs.length; i++) { collectAllGarbage(); long t0 = System.nanoTime(); long t; int j = 0; do { jobs[i].work(); j++; } while ((t = System.nanoTime() - t0) < warmupNanos); nanoss[i] = t/j; } return nanoss; } private static void time(Job ... jobs) throws Throwable { long[] warmup = time0(jobs); // Warm up run long[] nanoss = time0(jobs); // Real timing run long[] milliss = new long[jobs.length]; double[] ratios = new double[jobs.length]; final String nameHeader = "Method"; final String millisHeader = "Millis"; final String ratioHeader = "Ratio"; int nameWidth = nameHeader.length(); int millisWidth = millisHeader.length(); int ratioWidth = ratioHeader.length(); for (int i = 0; i < jobs.length; i++) { nameWidth = Math.max(nameWidth, jobs[i].name().length()); milliss[i] = nanoss[i]/(1000L * 1000L); millisWidth = Math.max(millisWidth, String.format("%d", milliss[i]).length()); ratios[i] = (double) nanoss[i] / (double) nanoss[0]; ratioWidth = Math.max(ratioWidth, String.format("%.3f", ratios[i]).length()); } String format = String.format("%%-%ds %%%dd %%%d.3f%%n", nameWidth, millisWidth, ratioWidth); String headerFormat = String.format("%%-%ds %%%ds %%%ds%%n", nameWidth, millisWidth, ratioWidth); System.out.printf(headerFormat, "Method", "Millis", "Ratio"); // Print out absolute and relative times, calibrated against first job for (int i = 0; i < jobs.length; i++) System.out.printf(format, jobs[i].name(), milliss[i], ratios[i]); } private static String keywordValue(String[] args, String keyword) { for (String arg : args) if (arg.startsWith(keyword)) return arg.substring(keyword.length() + 1); return null; } private static int intArg(String[] args, String keyword, int defaultValue) { String val = keywordValue(args, keyword); return val == null ? defaultValue : Integer.parseInt(val); } private static Pattern patternArg(String[] args, String keyword) { String val = keywordValue(args, keyword); return val == null ? null : Pattern.compile(val); } private static Job[] filter(Pattern filter, Job[] jobs) { if (filter == null) return jobs; Job[] newJobs = new Job[jobs.length]; int n = 0; for (Job job : jobs) if (filter.matcher(job.name()).find()) newJobs[n++] = job; // Arrays.copyOf not available in JDK 5 Job[] ret = new Job[n]; System.arraycopy(newJobs, 0, ret, 0, n); return ret; } private static void deoptimize(ArrayList<Integer> list) { for (Integer x : list) if (x == null) throw new Error(); } /** * Usage: [iterations=N] [size=N] [filter=REGEXP] */ public static void main(String[] args) throws Throwable { final int iterations = intArg(args, "iterations", 30000); final int size = intArg(args, "size", 1000); final Pattern filter = patternArg(args, "filter"); final ArrayList<Integer> list = new ArrayList<>(); final Random rnd = new Random(); for (int i = 0; i < size; i++) list.add(rnd.nextInt()); final Job[] jobs = { new Job("get") { void work() { for (int i = 0; i < iterations; i++) { for (int k = 0; k < size; k++) if (list.get(k) == 42) throw new Error(); } deoptimize(list);}}, new Job("set") { void work() { Integer[] xs = list.toArray(new Integer[size]); for (int i = 0; i < iterations; i++) { for (int k = 0; k < size; k++) list.set(k, xs[k]); } deoptimize(list);}}, new Job("get/set") { void work() { for (int i = 0; i < iterations; i++) { for (int k = 0; k < size; k++) list.set(k, list.get(size - k - 1)); } deoptimize(list);}}, new Job("add/remove at end") { void work() { Integer x = rnd.nextInt(); for (int i = 0; i < iterations; i++) { for (int k = 0; k < size - 1; k++) { list.add(size, x); list.remove(size); } } deoptimize(list);}}, new Job("subList get") { void work() { List<Integer> sublist = list.subList(0, list.size()); for (int i = 0; i < iterations; i++) { for (int k = 0; k < size; k++) if (sublist.get(k) == 42) throw new Error(); } deoptimize(list);}}, new Job("subList set") { void work() { List<Integer> sublist = list.subList(0, list.size()); Integer[] xs = sublist.toArray(new Integer[size]); for (int i = 0; i < iterations; i++) { for (int k = 0; k < size; k++) sublist.set(k, xs[k]); } deoptimize(list);}}, new Job("subList get/set") { void work() { List<Integer> sublist = list.subList(0, list.size()); for (int i = 0; i < iterations; i++) { for (int k = 0; k < size; k++) sublist.set(k, sublist.get(size - k - 1)); } deoptimize(list);}}, new Job("subList add/remove at end") { void work() { List<Integer> sublist = list.subList(0, list.size()); Integer x = rnd.nextInt(); for (int i = 0; i < iterations; i++) { for (int k = 0; k < size - 1; k++) { sublist.add(size, x); sublist.remove(size); } } deoptimize(list);}} }; time(filter(filter, jobs)); } }
YouDiSN/OpenJDK-Research
jdk9/jdk/test/java/util/ArrayList/RangeCheckMicroBenchmark.java
Java
gpl-2.0
9,205
/* * This file is part of the TrinityCore Project. See AUTHORS file for Copyright information * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for * more details. * * You should have received a copy of the GNU General Public License along * with this program. If not, see <http://www.gnu.org/licenses/>. */ #ifndef ConnectionService_h__ #define ConnectionService_h__ #include "Common.h" #include "Service.h" #include "connection_service.pb.h" namespace Battlenet { class Session; namespace Services { class Connection : public Service<connection::v1::ConnectionService> { typedef Service<connection::v1::ConnectionService> ConnectionService; public: Connection(Session* session); uint32 HandleConnect(connection::v1::ConnectRequest const* request, connection::v1::ConnectResponse* response, std::function<void(ServiceBase*, uint32, ::google::protobuf::Message const*)>& continuation) override; uint32 HandleKeepAlive(NoData const* request) override; uint32 HandleRequestDisconnect(connection::v1::DisconnectRequest const* request) override; }; } } #endif // ConnectionService_h__
Regigicas/TrinityCore
src/server/bnetserver/Services/ConnectionService.h
C
gpl-2.0
1,635
<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8" /> <title>Aloha Editor</title> <meta name="description" content="The world's most advanced browser HTML5 based WYSIWYG editor lets you experience a whole new way of editing." /> <meta name="viewport" content="width=device-width, initial-scale=1.0" /> <link rel="stylesheet" href="css/api.css" /> <script src="http://ajax.googleapis.com/ajax/libs/jquery/1.5.1/jquery.js"></script> <script src="js/jquery-bbq.js"></script> <script src="js/api.js"></script> <script src="js/lib/modernizr-1.7.min.js"></script> <!--[if lt IE 9]> <script src="http://html5shim.googlecode.com/svn/trunk/html5.js"></script> <![endif]--> </head> <body id="docs"> <!-- ============================== header ================================= --> <!-- begin static/header.html --> <header role="banner"> <div class="container"> <h1 id="logo"> <a href="http://aloha-editor.org"><img src="img/logo.png" alt="Aloha Editor" /></a> </h1> <nav role="navigation"> <ul> <li><a href="http://aloha-editor.org/about.php">About</a></li> <li><a href="#">Guides</a></li> <li class="active"><a href="http://aloha-editor.org/api" >API Docs</a></li> <li><a href="http://getsatisfaction.com/aloha_editor">Forum</a></li> </ul> </nav> </div> </header> <!-- end static/header.html --> <!-- ============================== classes index ============================ --> <section id="list"> <header> <form action="#" role="search"> <input type="text" /> <a href="#" class="search-reset"></a> </form> </header> <div> <span class="odd active"><a href="/">API Documentation Index</a></span> <span class='even' global><a href="../symbols/_global_.html">_global_</a></span> <span class='odd'><a href="../symbols/Aloha.Editable.html">Aloha.Editable</a></span> <span class='even'><a href="../symbols/Aloha.Message.html">Aloha.Message</a></span> <span class='odd'><a href="../symbols/Aloha.RepositoryDocument.html">Aloha.RepositoryDocument</a></span> <span class='even'><a href="../symbols/Aloha.RepositoryFolder.html">Aloha.RepositoryFolder</a></span> <span class='odd'><a href="../symbols/Aloha.RepositoryManager.html">Aloha.RepositoryManager</a></span> <span class='even'><a href="../symbols/Aloha.ui.Button.html">Aloha.ui.Button</a></span> <span class='odd'><a href="../symbols/Aloha.ui.MultiSplitButton.html">Aloha.ui.MultiSplitButton</a></span> <span class='even'><a href="../symbols/Array.html">Array</a></span> <span class='odd'><a href="../symbols/block.html">block</a></span> <span class='even'><a href="../symbols/block.block.html">block.block</a></span> <span class='odd'><a href="../symbols/block.block.AbstractBlock.html">block.block.AbstractBlock</a></span> <span class='even'><a href="../symbols/block.block.DebugBlock.html">block.block.DebugBlock</a></span> <span class='odd'><a href="../symbols/block.block.DefaultBlock.html">block.block.DefaultBlock</a></span> <span class='even'><a href="../symbols/block.BlockContentHandler.html">block.BlockContentHandler</a></span> <span class='odd'><a href="../symbols/block.blockmanager.html">block.blockmanager</a></span> <span class='even'><a href="../symbols/block.editor.html">block.editor</a></span> <span class='odd'><a href="../symbols/block.editor.AbstractEditor.html">block.editor.AbstractEditor</a></span> <span class='even'><a href="../symbols/block.editor.AbstractFormElementEditor.html">block.editor.AbstractFormElementEditor</a></span> <span class='odd'><a href="../symbols/block.editor.EmailEditor.html">block.editor.EmailEditor</a></span> <span class='even'><a href="../symbols/block.editor.NumberEditor.html">block.editor.NumberEditor</a></span> <span class='odd'><a href="../symbols/block.editor.StringEditor.html">block.editor.StringEditor</a></span> <span class='even'><a href="../symbols/block.editor.UrlEditor.html">block.editor.UrlEditor</a></span> <span class='odd'><a href="../symbols/block.editormanager.html">block.editormanager</a></span> <span class='even'><a href="../symbols/block.sidebarattributeeditor.html">block.sidebarattributeeditor</a></span> <span class='odd'><a href="../symbols/Boolean.html">Boolean</a></span> <span class='even'><a href="../symbols/contenthandler.html">contenthandler</a></span> <span class='odd'><a href="../symbols/Date.html">Date</a></span> <span class='even'><a href="../symbols/diff_match_patch.html">diff_match_patch</a></span> <span class='odd'><a href="../symbols/Ext.html">Ext</a></span> <span class='even'><a href="../symbols/Ext.DomQuery.html">Ext.DomQuery</a></span> <span class='odd'><a href="../symbols/Ext.TaskMgr.html">Ext.TaskMgr</a></span> <span class='even'><a href="../symbols/Ext.util.TaskRunner.html">Ext.util.TaskRunner</a></span> <span class='odd'><a href="../symbols/Function.html">Function</a></span> <span class='even'><a href="../symbols/GENTICS.Utils.RangeObject.html">GENTICS.Utils.RangeObject</a></span> <span class='odd'><a href="../symbols/GENTICS.Utils.RangeTree.html">GENTICS.Utils.RangeTree</a></span> <span class='even'><a href="../symbols/jQuery.html">jQuery</a></span> <span class='odd'><a href="../symbols/jQuery.fn.html">jQuery.fn</a></span> <span class='even'><a href="../symbols/patch_obj.html">patch_obj</a></span> <span class='odd'><a href="../symbols/rangy-Module.html">rangy-Module</a></span> <span class='even'><a href="../symbols/String.html">String</a></span> <span class='odd'><a href="../symbols/Ui.AttributeField.html">Ui.AttributeField</a></span> </div> </section> <footer> <a href="https://github.com/alohaeditor/Aloha-Editor/issues" class="button secondary">REPORT AN ISSUE</a> </footer> <div role="main"> <section id="documentation"> <!-- ============================== class title ============================ --> <h1 class="classTitle"> Class: block.editor.EmailEditor </h1> <!-- ============================== class summary ========================== --> <p class="description"> <span class="extends"> <br />Extends <a href="../symbols/block.editor.AbstractFormElementEditor.html">block.editor.AbstractFormElementEditor</a>.<br /> </span> An editor for email addresses <span class="definedin">Defined in: <a href="../symbols/src/_Users_rene_evo42_app_aloha_Aloha-Editor_src_plugins_common_block_lib_editor.js.html">editor.js</a>.</span> </p> <!-- ============================== properties summary ===================== --> <!-- ============================== methods summary ======================== --> <!-- ============================== events summary ======================== --> <!-- ============================== field details ========================== --> <!-- ============================== method details ========================= --> <!-- ============================== event details ========================= --> <!-- ============================== footer ================================= --> <div class="fineprint" style="clear:both"> Documentation generated by <a href="http://code.google.com/p/jsdoc-toolkit/" target="_blank">JsDoc Toolkit</a> 2.4.0 on Wed Nov 30 2011 13:33:45 GMT+0100 (CET) </div> </section> </div> </body> </html>
scottkjameson/Aloha-Editor
doc/api/output/symbols/block.editor.EmailEditor.html
HTML
gpl-2.0
7,782
/* */ #include <linux/kernel.h> #include <linux/device.h> #include <linux/mutex.h> #include <linux/module.h> #include <linux/gpio.h> #include <linux/i2c.h> #include <linux/spi/spi.h> #include <linux/spi/mcp23s08.h> #include <linux/slab.h> #include <asm/byteorder.h> /* */ #define MCP_TYPE_S08 0 #define MCP_TYPE_S17 1 #define MCP_TYPE_008 2 #define MCP_TYPE_017 3 /* */ #define MCP_IODIR 0x00 /* */ #define MCP_IPOL 0x01 #define MCP_GPINTEN 0x02 #define MCP_DEFVAL 0x03 #define MCP_INTCON 0x04 #define MCP_IOCON 0x05 # define IOCON_SEQOP (1 << 5) # define IOCON_HAEN (1 << 3) # define IOCON_ODR (1 << 2) # define IOCON_INTPOL (1 << 1) #define MCP_GPPU 0x06 #define MCP_INTF 0x07 #define MCP_INTCAP 0x08 #define MCP_GPIO 0x09 #define MCP_OLAT 0x0a struct mcp23s08; struct mcp23s08_ops { int (*read)(struct mcp23s08 *mcp, unsigned reg); int (*write)(struct mcp23s08 *mcp, unsigned reg, unsigned val); int (*read_regs)(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n); }; struct mcp23s08 { u8 addr; u16 cache[11]; /* */ struct mutex lock; struct gpio_chip chip; const struct mcp23s08_ops *ops; void *data; /* */ }; /* */ struct mcp23s08_driver_data { unsigned ngpio; struct mcp23s08 *mcp[8]; struct mcp23s08 chip[]; }; /* */ #ifdef CONFIG_I2C static int mcp23008_read(struct mcp23s08 *mcp, unsigned reg) { return i2c_smbus_read_byte_data(mcp->data, reg); } static int mcp23008_write(struct mcp23s08 *mcp, unsigned reg, unsigned val) { return i2c_smbus_write_byte_data(mcp->data, reg, val); } static int mcp23008_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n) { while (n--) { int ret = mcp23008_read(mcp, reg++); if (ret < 0) return ret; *vals++ = ret; } return 0; } static int mcp23017_read(struct mcp23s08 *mcp, unsigned reg) { return i2c_smbus_read_word_data(mcp->data, reg << 1); } static int mcp23017_write(struct mcp23s08 *mcp, unsigned reg, unsigned val) { return i2c_smbus_write_word_data(mcp->data, reg << 1, val); } static int mcp23017_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n) { while (n--) { int ret = mcp23017_read(mcp, reg++); if (ret < 0) return ret; *vals++ = ret; } return 0; } static const struct mcp23s08_ops mcp23008_ops = { .read = mcp23008_read, .write = mcp23008_write, .read_regs = mcp23008_read_regs, }; static const struct mcp23s08_ops mcp23017_ops = { .read = mcp23017_read, .write = mcp23017_write, .read_regs = mcp23017_read_regs, }; #endif /* */ /* */ #ifdef CONFIG_SPI_MASTER static int mcp23s08_read(struct mcp23s08 *mcp, unsigned reg) { u8 tx[2], rx[1]; int status; tx[0] = mcp->addr | 0x01; tx[1] = reg; status = spi_write_then_read(mcp->data, tx, sizeof tx, rx, sizeof rx); return (status < 0) ? status : rx[0]; } static int mcp23s08_write(struct mcp23s08 *mcp, unsigned reg, unsigned val) { u8 tx[3]; tx[0] = mcp->addr; tx[1] = reg; tx[2] = val; return spi_write_then_read(mcp->data, tx, sizeof tx, NULL, 0); } static int mcp23s08_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n) { u8 tx[2], *tmp; int status; if ((n + reg) > sizeof mcp->cache) return -EINVAL; tx[0] = mcp->addr | 0x01; tx[1] = reg; tmp = (u8 *)vals; status = spi_write_then_read(mcp->data, tx, sizeof tx, tmp, n); if (status >= 0) { while (n--) vals[n] = tmp[n]; /* */ } return status; } static int mcp23s17_read(struct mcp23s08 *mcp, unsigned reg) { u8 tx[2], rx[2]; int status; tx[0] = mcp->addr | 0x01; tx[1] = reg << 1; status = spi_write_then_read(mcp->data, tx, sizeof tx, rx, sizeof rx); return (status < 0) ? status : (rx[0] | (rx[1] << 8)); } static int mcp23s17_write(struct mcp23s08 *mcp, unsigned reg, unsigned val) { u8 tx[4]; tx[0] = mcp->addr; tx[1] = reg << 1; tx[2] = val; tx[3] = val >> 8; return spi_write_then_read(mcp->data, tx, sizeof tx, NULL, 0); } static int mcp23s17_read_regs(struct mcp23s08 *mcp, unsigned reg, u16 *vals, unsigned n) { u8 tx[2]; int status; if ((n + reg) > sizeof mcp->cache) return -EINVAL; tx[0] = mcp->addr | 0x01; tx[1] = reg << 1; status = spi_write_then_read(mcp->data, tx, sizeof tx, (u8 *)vals, n * 2); if (status >= 0) { while (n--) vals[n] = __le16_to_cpu((__le16)vals[n]); } return status; } static const struct mcp23s08_ops mcp23s08_ops = { .read = mcp23s08_read, .write = mcp23s08_write, .read_regs = mcp23s08_read_regs, }; static const struct mcp23s08_ops mcp23s17_ops = { .read = mcp23s17_read, .write = mcp23s17_write, .read_regs = mcp23s17_read_regs, }; #endif /* */ /* */ static int mcp23s08_direction_input(struct gpio_chip *chip, unsigned offset) { struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip); int status; mutex_lock(&mcp->lock); mcp->cache[MCP_IODIR] |= (1 << offset); status = mcp->ops->write(mcp, MCP_IODIR, mcp->cache[MCP_IODIR]); mutex_unlock(&mcp->lock); return status; } static int mcp23s08_get(struct gpio_chip *chip, unsigned offset) { struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip); int status; mutex_lock(&mcp->lock); /* */ status = mcp->ops->read(mcp, MCP_GPIO); if (status < 0) status = 0; else { mcp->cache[MCP_GPIO] = status; status = !!(status & (1 << offset)); } mutex_unlock(&mcp->lock); return status; } static int __mcp23s08_set(struct mcp23s08 *mcp, unsigned mask, int value) { unsigned olat = mcp->cache[MCP_OLAT]; if (value) olat |= mask; else olat &= ~mask; mcp->cache[MCP_OLAT] = olat; return mcp->ops->write(mcp, MCP_OLAT, olat); } static void mcp23s08_set(struct gpio_chip *chip, unsigned offset, int value) { struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip); unsigned mask = 1 << offset; mutex_lock(&mcp->lock); __mcp23s08_set(mcp, mask, value); mutex_unlock(&mcp->lock); } static int mcp23s08_direction_output(struct gpio_chip *chip, unsigned offset, int value) { struct mcp23s08 *mcp = container_of(chip, struct mcp23s08, chip); unsigned mask = 1 << offset; int status; mutex_lock(&mcp->lock); status = __mcp23s08_set(mcp, mask, value); if (status == 0) { mcp->cache[MCP_IODIR] &= ~mask; status = mcp->ops->write(mcp, MCP_IODIR, mcp->cache[MCP_IODIR]); } mutex_unlock(&mcp->lock); return status; } /* */ #ifdef CONFIG_DEBUG_FS #include <linux/seq_file.h> /* */ static void mcp23s08_dbg_show(struct seq_file *s, struct gpio_chip *chip) { struct mcp23s08 *mcp; char bank; int t; unsigned mask; mcp = container_of(chip, struct mcp23s08, chip); /* */ bank = '0' + ((mcp->addr >> 1) & 0x7); mutex_lock(&mcp->lock); t = mcp->ops->read_regs(mcp, 0, mcp->cache, ARRAY_SIZE(mcp->cache)); if (t < 0) { seq_printf(s, " I/O ERROR %d\n", t); goto done; } for (t = 0, mask = 1; t < chip->ngpio; t++, mask <<= 1) { const char *label; label = gpiochip_is_requested(chip, t); if (!label) continue; seq_printf(s, " gpio-%-3d P%c.%d (%-12s) %s %s %s", chip->base + t, bank, t, label, (mcp->cache[MCP_IODIR] & mask) ? "in " : "out", (mcp->cache[MCP_GPIO] & mask) ? "hi" : "lo", (mcp->cache[MCP_GPPU] & mask) ? " " : "up"); /* */ seq_printf(s, "\n"); } done: mutex_unlock(&mcp->lock); } #else #define mcp23s08_dbg_show NULL #endif /* */ static int mcp23s08_probe_one(struct mcp23s08 *mcp, struct device *dev, void *data, unsigned addr, unsigned type, unsigned base, unsigned pullups) { int status; mutex_init(&mcp->lock); mcp->data = data; mcp->addr = addr; mcp->chip.direction_input = mcp23s08_direction_input; mcp->chip.get = mcp23s08_get; mcp->chip.direction_output = mcp23s08_direction_output; mcp->chip.set = mcp23s08_set; mcp->chip.dbg_show = mcp23s08_dbg_show; switch (type) { #ifdef CONFIG_SPI_MASTER case MCP_TYPE_S08: mcp->ops = &mcp23s08_ops; mcp->chip.ngpio = 8; mcp->chip.label = "mcp23s08"; break; case MCP_TYPE_S17: mcp->ops = &mcp23s17_ops; mcp->chip.ngpio = 16; mcp->chip.label = "mcp23s17"; break; #endif /* */ #ifdef CONFIG_I2C case MCP_TYPE_008: mcp->ops = &mcp23008_ops; mcp->chip.ngpio = 8; mcp->chip.label = "mcp23008"; break; case MCP_TYPE_017: mcp->ops = &mcp23017_ops; mcp->chip.ngpio = 16; mcp->chip.label = "mcp23017"; break; #endif /* */ default: dev_err(dev, "invalid device type (%d)\n", type); return -EINVAL; } mcp->chip.base = base; mcp->chip.can_sleep = 1; mcp->chip.dev = dev; mcp->chip.owner = THIS_MODULE; /* */ status = mcp->ops->read(mcp, MCP_IOCON); if (status < 0) goto fail; if ((status & IOCON_SEQOP) || !(status & IOCON_HAEN)) { /* */ status &= ~(IOCON_SEQOP | (IOCON_SEQOP << 8)); status |= IOCON_HAEN | (IOCON_HAEN << 8); status = mcp->ops->write(mcp, MCP_IOCON, status); if (status < 0) goto fail; } /* */ status = mcp->ops->write(mcp, MCP_GPPU, pullups); if (status < 0) goto fail; status = mcp->ops->read_regs(mcp, 0, mcp->cache, ARRAY_SIZE(mcp->cache)); if (status < 0) goto fail; /* */ if (mcp->cache[MCP_IPOL] != 0) { mcp->cache[MCP_IPOL] = 0; status = mcp->ops->write(mcp, MCP_IPOL, 0); if (status < 0) goto fail; } /* */ if (mcp->cache[MCP_GPINTEN] != 0) { mcp->cache[MCP_GPINTEN] = 0; status = mcp->ops->write(mcp, MCP_GPINTEN, 0); if (status < 0) goto fail; } status = gpiochip_add(&mcp->chip); fail: if (status < 0) dev_dbg(dev, "can't setup chip %d, --> %d\n", addr, status); return status; } /* */ #ifdef CONFIG_I2C static int __devinit mcp230xx_probe(struct i2c_client *client, const struct i2c_device_id *id) { struct mcp23s08_platform_data *pdata; struct mcp23s08 *mcp; int status; pdata = client->dev.platform_data; if (!pdata || !gpio_is_valid(pdata->base)) { dev_dbg(&client->dev, "invalid or missing platform data\n"); return -EINVAL; } mcp = kzalloc(sizeof *mcp, GFP_KERNEL); if (!mcp) return -ENOMEM; status = mcp23s08_probe_one(mcp, &client->dev, client, client->addr, id->driver_data, pdata->base, pdata->chip[0].pullups); if (status) goto fail; i2c_set_clientdata(client, mcp); return 0; fail: kfree(mcp); return status; } static int __devexit mcp230xx_remove(struct i2c_client *client) { struct mcp23s08 *mcp = i2c_get_clientdata(client); int status; status = gpiochip_remove(&mcp->chip); if (status == 0) kfree(mcp); return status; } static const struct i2c_device_id mcp230xx_id[] = { { "mcp23008", MCP_TYPE_008 }, { "mcp23017", MCP_TYPE_017 }, { }, }; MODULE_DEVICE_TABLE(i2c, mcp230xx_id); static struct i2c_driver mcp230xx_driver = { .driver = { .name = "mcp230xx", .owner = THIS_MODULE, }, .probe = mcp230xx_probe, .remove = __devexit_p(mcp230xx_remove), .id_table = mcp230xx_id, }; static int __init mcp23s08_i2c_init(void) { return i2c_add_driver(&mcp230xx_driver); } static void mcp23s08_i2c_exit(void) { i2c_del_driver(&mcp230xx_driver); } #else static int __init mcp23s08_i2c_init(void) { return 0; } static void mcp23s08_i2c_exit(void) { } #endif /* */ /* */ #ifdef CONFIG_SPI_MASTER static int mcp23s08_probe(struct spi_device *spi) { struct mcp23s08_platform_data *pdata; unsigned addr; unsigned chips = 0; struct mcp23s08_driver_data *data; int status, type; unsigned base; type = spi_get_device_id(spi)->driver_data; pdata = spi->dev.platform_data; if (!pdata || !gpio_is_valid(pdata->base)) { dev_dbg(&spi->dev, "invalid or missing platform data\n"); return -EINVAL; } for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) { if (!pdata->chip[addr].is_present) continue; chips++; if ((type == MCP_TYPE_S08) && (addr > 3)) { dev_err(&spi->dev, "mcp23s08 only supports address 0..3\n"); return -EINVAL; } } if (!chips) return -ENODEV; data = kzalloc(sizeof *data + chips * sizeof(struct mcp23s08), GFP_KERNEL); if (!data) return -ENOMEM; spi_set_drvdata(spi, data); base = pdata->base; for (addr = 0; addr < ARRAY_SIZE(pdata->chip); addr++) { if (!pdata->chip[addr].is_present) continue; chips--; data->mcp[addr] = &data->chip[chips]; status = mcp23s08_probe_one(data->mcp[addr], &spi->dev, spi, 0x40 | (addr << 1), type, base, pdata->chip[addr].pullups); if (status < 0) goto fail; base += (type == MCP_TYPE_S17) ? 16 : 8; } data->ngpio = base - pdata->base; /* */ return 0; fail: for (addr = 0; addr < ARRAY_SIZE(data->mcp); addr++) { int tmp; if (!data->mcp[addr]) continue; tmp = gpiochip_remove(&data->mcp[addr]->chip); if (tmp < 0) dev_err(&spi->dev, "%s --> %d\n", "remove", tmp); } kfree(data); return status; } static int mcp23s08_remove(struct spi_device *spi) { struct mcp23s08_driver_data *data = spi_get_drvdata(spi); unsigned addr; int status = 0; for (addr = 0; addr < ARRAY_SIZE(data->mcp); addr++) { int tmp; if (!data->mcp[addr]) continue; tmp = gpiochip_remove(&data->mcp[addr]->chip); if (tmp < 0) { dev_err(&spi->dev, "%s --> %d\n", "remove", tmp); status = tmp; } } if (status == 0) kfree(data); return status; } static const struct spi_device_id mcp23s08_ids[] = { { "mcp23s08", MCP_TYPE_S08 }, { "mcp23s17", MCP_TYPE_S17 }, { }, }; MODULE_DEVICE_TABLE(spi, mcp23s08_ids); static struct spi_driver mcp23s08_driver = { .probe = mcp23s08_probe, .remove = mcp23s08_remove, .id_table = mcp23s08_ids, .driver = { .name = "mcp23s08", .owner = THIS_MODULE, }, }; static int __init mcp23s08_spi_init(void) { return spi_register_driver(&mcp23s08_driver); } static void mcp23s08_spi_exit(void) { spi_unregister_driver(&mcp23s08_driver); } #else static int __init mcp23s08_spi_init(void) { return 0; } static void mcp23s08_spi_exit(void) { } #endif /* */ /* */ static int __init mcp23s08_init(void) { int ret; ret = mcp23s08_spi_init(); if (ret) goto spi_fail; ret = mcp23s08_i2c_init(); if (ret) goto i2c_fail; return 0; i2c_fail: mcp23s08_spi_exit(); spi_fail: return ret; } /* */ subsys_initcall(mcp23s08_init); static void __exit mcp23s08_exit(void) { mcp23s08_spi_exit(); mcp23s08_i2c_exit(); } module_exit(mcp23s08_exit); MODULE_LICENSE("GPL");
holyangel/LGE_G3
drivers/gpio/gpio-mcp23s08.c
C
gpl-2.0
16,031
<?php defined('_JEXEC') or die; if (JFactory::getApplication()->isSite()) { JSession::checkToken('get') or die(JText::_('JINVALID_TOKEN')); } JHtml::_('behavior.tooltip'); $function = JRequest::getCmd('function', 'jSelectCallback'); $listOrder = $this->escape($this->state->get('list.ordering')); $listDirn = $this->escape($this->state->get('list.direction')); $states = array(); $states[0] = array("class" => "unpublish", "description" => "JUNPUBLISHED"); $states[1] = array("class" => "publish", "description" => "JPUBLISHED"); $states[-2] = array("class" => "trash", "description" => "JTRASHED"); ?> <form action="<?php echo JRoute::_('index.php?option=com_oziogallery3&view=galleries&layout=modal&tmpl=component&function=' . $function . '&' . JSession::getFormToken().'=1');?>" method="post" name="adminForm" id="adminForm"> <fieldset class="filter clearfix"> <div class="left"> <label for="filter_search"> <?php echo JText::_('JSEARCH_FILTER_LABEL'); ?> </label> <input type="text" name="filter_search" id="filter_search" value="<?php echo $this->escape($this->state->get('filter.search')); ?>" size="30" title="<?php echo JText::_('COM_CONTENT_FILTER_SEARCH_DESC'); ?>" /> <button type="submit"> <?php echo JText::_('JSEARCH_FILTER_SUBMIT'); ?></button> <button type="button" onclick="document.id('filter_search').value='';this.form.submit();"> <?php echo JText::_('JSEARCH_FILTER_CLEAR'); ?></button> </div> <div class="right"> <select name="filter_published" class="inputbox" onchange="this.form.submit()"> <option value=""><?php echo JText::_('JOPTION_SELECT_PUBLISHED');?></option> <?php echo JHtml::_('select.options', JHtml::_('jgrid.publishedOptions', array('archived' => false)), 'value', 'text', $this->state->get('filter.published'), true);?> </select> </div> </fieldset> <table class="adminlist"> <thead> <tr> <th class="title"> <?php echo JHtml::_('grid.sort', 'JGLOBAL_TITLE', 'a.title', $listDirn, $listOrder); /* Note that it is a.title and not a.itemtitle. See galleries.php function getListQuery() */?> </th> <th width="5%"> <?php echo JHtml::_('grid.sort', 'JSTATUS', 'a.published', $listDirn, $listOrder); ?> </th> <th width="15%"> <?php echo JHtml::_('grid.sort', 'JOPTION_MENUS', 'a.menutype', $listDirn, $listOrder); ?> </th> <th width="15%"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_MENU_ITEM_TYPE', 'a.link', $listDirn, $listOrder); ?> </th> <th width="1%" class="nowrap"> <?php echo JHtml::_('grid.sort', 'JGRID_HEADING_ID', 'a.id', $listDirn, $listOrder); ?> </th> </tr> </thead> <tfoot> <tr> <td colspan="15"> <?php echo $this->pagination->getListFooter(); ?> </td> </tr> </tfoot> <tbody> <?php foreach ($this->items as $i => $item) : ?> <?php // Parse the link to get the value of the view $link = NULL; // Remove the "index.php?" part that hurts $item->link = str_replace("index.php?", "", $item->link); // Parse the values parse_str($item->link, $link); // Todo: We should consider the metadata.xml case (see administrator/components/com_menus/views/items/view.html.php function display()) $viewname = JText::_($link["option"] . '_' . $link["view"] . "_VIEW_DEFAULT_TITLE"); ?> <tr class="row<?php echo $i % 2; ?>"> <td> <a class="pointer" onclick="if (window.parent) window.parent.<?php echo $this->escape($function);?>('<?php echo $item->id; ?>');"> <?php echo $this->escape($item->itemtitle); ?></a> </td> <td class="center"> <div class="jgrid"><span class="state <?php echo $states[(int)$item->published]["class"]; ?>"><span class="text"><?php echo $states[(int)$item->published]["class"]; ?></span></span></div> </td> <td class="center"> <?php echo $this->escape($item->title); ?> </td> <td class="center"> <?php echo $this->escape($viewname); ?> </td> <td class="center"> <?php echo (int) $item->id; ?> </td> </tr> <?php endforeach; ?> </tbody> </table> <div> <input type="hidden" name="task" value="" /> <input type="hidden" name="boxchecked" value="0" /> <input type="hidden" name="filter_order" value="<?php echo $listOrder; ?>" /> <input type="hidden" name="filter_order_Dir" value="<?php echo $listDirn; ?>" /> <?php echo JHtml::_('form.token'); ?> </div> </form>
scarsroga/blog-soa
administrator/components/com_oziogallery3/views/galleries/tmpl/modal.php
PHP
gpl-2.0
4,459
using MediaBrowser.Common; using MediaBrowser.Common.Configuration; using MediaBrowser.Common.ScheduledTasks; using MediaBrowser.Model.Logging; using System; using System.Collections.Generic; using System.Threading; using System.Threading.Tasks; namespace MediaBrowser.Server.Implementations.ScheduledTasks { /// <summary> /// Plugin Update Task /// </summary> public class SystemUpdateTask : IScheduledTask, IHasKey { /// <summary> /// The _app host /// </summary> private readonly IApplicationHost _appHost; /// <summary> /// Gets or sets the configuration manager. /// </summary> /// <value>The configuration manager.</value> private IConfigurationManager ConfigurationManager { get; set; } /// <summary> /// Gets or sets the logger. /// </summary> /// <value>The logger.</value> private ILogger Logger { get; set; } /// <summary> /// Initializes a new instance of the <see cref="SystemUpdateTask" /> class. /// </summary> /// <param name="appHost">The app host.</param> /// <param name="configurationManager">The configuration manager.</param> /// <param name="logger">The logger.</param> public SystemUpdateTask(IApplicationHost appHost, IConfigurationManager configurationManager, ILogger logger) { _appHost = appHost; ConfigurationManager = configurationManager; Logger = logger; } /// <summary> /// Creates the triggers that define when the task will run /// </summary> /// <returns>IEnumerable{BaseTaskTrigger}.</returns> public IEnumerable<ITaskTrigger> GetDefaultTriggers() { // Until we can vary these default triggers per server and MBT, we need something that makes sense for both return new ITaskTrigger[] { // At startup new StartupTrigger(), // Every so often new IntervalTrigger { Interval = TimeSpan.FromHours(24)} }; } /// <summary> /// Returns the task to be executed /// </summary> /// <param name="cancellationToken">The cancellation token.</param> /// <param name="progress">The progress.</param> /// <returns>Task.</returns> public async Task Execute(CancellationToken cancellationToken, IProgress<double> progress) { EventHandler<double> innerProgressHandler = (sender, e) => progress.Report(e * .1); // Create a progress object for the update check var innerProgress = new Progress<double>(); innerProgress.ProgressChanged += innerProgressHandler; var updateInfo = await _appHost.CheckForApplicationUpdate(cancellationToken, innerProgress).ConfigureAwait(false); // Release the event handler innerProgress.ProgressChanged -= innerProgressHandler; progress.Report(10); if (!updateInfo.IsUpdateAvailable) { Logger.Debug("No application update available."); progress.Report(100); return; } cancellationToken.ThrowIfCancellationRequested(); if (!_appHost.CanSelfUpdate) return; if (ConfigurationManager.CommonConfiguration.EnableAutoUpdate) { Logger.Info("Update Revision {0} available. Updating...", updateInfo.AvailableVersion); innerProgressHandler = (sender, e) => progress.Report((e * .9) + .1); innerProgress = new Progress<double>(); innerProgress.ProgressChanged += innerProgressHandler; await _appHost.UpdateApplication(updateInfo.Package, cancellationToken, innerProgress).ConfigureAwait(false); // Release the event handler innerProgress.ProgressChanged -= innerProgressHandler; } else { Logger.Info("A new version of " + _appHost.Name + " is available."); } progress.Report(100); } /// <summary> /// Gets the name of the task /// </summary> /// <value>The name.</value> public string Name { get { return "Check for application updates"; } } /// <summary> /// Gets the description. /// </summary> /// <value>The description.</value> public string Description { get { return "Downloads and installs application updates."; } } /// <summary> /// Gets the category. /// </summary> /// <value>The category.</value> public string Category { get { return "Application"; } } public string Key { get { return "SystemUpdateTask"; } } } }
AreaKode/Emby
MediaBrowser.Server.Implementations/ScheduledTasks/SystemUpdateTask.cs
C#
gpl-2.0
5,031
<?php /** * User utilities. * * Copyright: © 2009-2011 * {@link http://www.websharks-inc.com/ WebSharks, Inc.} * (coded in the USA) * * Released under the terms of the GNU General Public License. * You should have received a copy of the GNU General Public License, * along with this software. In the main directory, see: /licensing/ * If not, see: {@link http://www.gnu.org/licenses/}. * * @package s2Member\Utilities * @since 3.5 */ if (realpath (__FILE__) === realpath ($_SERVER["SCRIPT_FILENAME"])) exit ("Do not access this file directly."); if (!class_exists ("c_ws_plugin__s2member_utils_users")) { /** * User utilities. * * @package s2Member\Utilities * @since 3.5 */ class c_ws_plugin__s2member_utils_users { /** * Determines the total Users/Members in the database. * * @package s2Member\Utilities * @since 3.5 * * @return int Number of Users in the database, total. */ public static function users_in_database () { global /* Global database object reference. */ $wpdb; $q1 = mysql_query ("SELECT SQL_CALC_FOUND_ROWS `" . $wpdb->users . "`.`ID` FROM `" . $wpdb->users . "`, `" . $wpdb->usermeta . "` WHERE `" . $wpdb->users . "`.`ID` = `" . $wpdb->usermeta . "`.`user_id` AND `" . $wpdb->usermeta . "`.`meta_key` = '" . esc_sql ($wpdb->prefix . "capabilities") . "' LIMIT 1", $wpdb->dbh); $q2 = mysql_query ("SELECT FOUND_ROWS()", $wpdb->dbh); $users = (int)mysql_result ($q2, 0); mysql_free_result ($q2); mysql_free_result ($q1); return $users; } /** * Obtains Custom String for an existing Member, referenced by a Subscr. or Transaction ID. * * A second lookup parameter can be provided as well *(optional)*. * * @package s2Member\Utilities * @since 3.5 * * @param str $subscr_or_txn_id Either a Paid Subscr. ID, or a Paid Transaction ID. * @param str $os0 Optional. A second lookup parameter, usually the `os0` value for PayPal® integrations. * @return str|bool The Custom String value on success, else false on failure. */ public static function get_user_custom_with ($subscr_or_txn_id = FALSE, $os0 = FALSE) { global /* Need global DB obj. */ $wpdb; if /* This case includes some additional routines that can use the ``$os0`` value. */ ($subscr_or_txn_id && $os0) { if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE (`meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' OR `meta_key` = '" . $wpdb->prefix . "s2member_first_payment_txn_id') AND (`meta_value` = '" . $wpdb->escape ($subscr_or_txn_id) . "' OR `meta_value` = '" . $wpdb->escape ($os0) . "') LIMIT 1")) || ($q = $wpdb->get_row ("SELECT `ID` AS `user_id` FROM `" . $wpdb->users . "` WHERE `ID` = '" . $wpdb->escape ($os0) . "' LIMIT 1"))) if (($custom = get_user_option ("s2member_custom", $q->user_id))) return $custom; } else if /* Otherwise, if all we have is a Subscr./Txn. ID value. */ ($subscr_or_txn_id) { if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE (`meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' OR `meta_key` = '" . $wpdb->prefix . "s2member_first_payment_txn_id') AND `meta_value` = '" . $wpdb->escape ($subscr_or_txn_id) . "' LIMIT 1"))) if (($custom = get_user_option ("s2member_custom", $q->user_id))) return $custom; } return /* Otherwise, return false. */ false; } /** * Obtains the User ID for an existing Member, referenced by a Subscr. or Transaction ID. * * A second lookup parameter can be provided as well *(optional)*. * * @package s2Member\Utilities * @since 3.5 * * @param str $subscr_or_txn_id Either a Paid Subscr. ID, or a Paid Transaction ID. * @param str $os0 Optional. A second lookup parameter, usually the `os0` value for PayPal® integrations. * @return int|bool A WordPress® User ID on success, else false on failure. */ public static function get_user_id_with ($subscr_or_txn_id = FALSE, $os0 = FALSE) { global /* Need global DB obj. */ $wpdb; if /* This case includes some additional routines that can use the ``$os0`` value. */($subscr_or_txn_id && $os0) { if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE (`meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' OR `meta_key` = '" . $wpdb->prefix . "s2member_first_payment_txn_id') AND (`meta_value` = '" . $wpdb->escape ($subscr_or_txn_id) . "' OR `meta_value` = '" . $wpdb->escape ($os0) . "') LIMIT 1")) || ($q = $wpdb->get_row ("SELECT `ID` AS `user_id` FROM `" . $wpdb->users . "` WHERE `ID` = '" . $wpdb->escape ($os0) . "' LIMIT 1"))) return $q->user_id; } else if /* Otherwise, if all we have is a Subscr./Txn. ID value. */ ($subscr_or_txn_id) { if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE (`meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' OR `meta_key` = '" . $wpdb->prefix . "s2member_first_payment_txn_id') AND `meta_value` = '" . $wpdb->escape ($subscr_or_txn_id) . "' LIMIT 1"))) return $q->user_id; } return /* Otherwise, return false. */ false; } /** * Obtains the Email Address for an existing Member, referenced by a Subscr. or Transaction ID. * * A second lookup parameter can be provided as well *(optional)*. * * @package s2Member\Utilities * @since 3.5 * * @param str $subscr_or_txn_id Either a Paid Subscr. ID, or a Paid Transaction ID. * @param str $os0 Optional. A second lookup parameter, usually the `os0` value for PayPal® integrations. * @return int|bool A User's Email Address on success, else false on failure. */ public static function get_user_email_with ($subscr_or_txn_id = FALSE, $os0 = FALSE) { global /* Need global DB obj. */ $wpdb; if /* This case includes some additional routines that can use the ``$os0`` value. */($subscr_or_txn_id && $os0) { if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE (`meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' OR `meta_key` = '" . $wpdb->prefix . "s2member_first_payment_txn_id') AND (`meta_value` = '" . $wpdb->escape ($subscr_or_txn_id) . "' OR `meta_value` = '" . $wpdb->escape ($os0) . "') LIMIT 1")) || ($q = $wpdb->get_row ("SELECT `ID` AS `user_id` FROM `" . $wpdb->users . "` WHERE `ID` = '" . $wpdb->escape ($os0) . "' LIMIT 1"))) if (is_object ($user = new WP_User ($q->user_id)) && !empty ($user->ID) && ($email = $user->user_email)) return $email; } else if /* Otherwise, if all we have is a Subscr./Txn. ID value. */($subscr_or_txn_id) { if (($q = $wpdb->get_row ("SELECT `user_id` FROM `" . $wpdb->usermeta . "` WHERE (`meta_key` = '" . $wpdb->prefix . "s2member_subscr_id' OR `meta_key` = '" . $wpdb->prefix . "s2member_first_payment_txn_id') AND `meta_value` = '" . $wpdb->escape ($subscr_or_txn_id) . "' LIMIT 1"))) if (is_object ($user = new WP_User ($q->user_id)) && !empty ($user->ID) && ($email = $user->user_email)) return $email; } return /* Otherwise, return false. */ false; } /** * Retrieves IPN Signup Vars & validates their Subscription ID. * * The ``$user_id`` can be passed in directly; or a lookup can be performed with ``$subscr_id``. * * @package s2Member\Utilities * @since 3.5 * * @param int|str $user_id Optional. A numeric WordPress® User ID. * @param str $subscr_id Optional. Can be used instead of passing in a ``$user_id``. * If ``$subscr_id`` is passed in, it has to match the one found inside the resulting IPN Signup Vars collected by this routine. * If neither of these parameters are passed in, the current User is assumed instead, obtained through ``wp_get_current_user()``. * @return array|bool A User's IPN Signup Vars on success, else false on failure. */ public static function get_user_ipn_signup_vars ($user_id = FALSE, $subscr_id = FALSE) { if ($user_id || ($subscr_id && ($user_id = c_ws_plugin__s2member_utils_users::get_user_id_with ($subscr_id))) || (!$user_id && !$subscr_id && is_object ($user = wp_get_current_user ()) && !empty ($user->ID) && ($user_id = $user->ID))) { if (($_subscr_id = get_user_option ("s2member_subscr_id", $user_id)) && (!$subscr_id || $subscr_id === $_subscr_id) && ($subscr_id = $_subscr_id)) if (is_array ($ipn_signup_vars = get_user_option ("s2member_ipn_signup_vars", $user_id))) if ($ipn_signup_vars["subscr_id"] === $subscr_id) return $ipn_signup_vars; } return /* Otherwise, return false. */ false; } /** * Retrieves IPN Signup Var & validates their Subscription ID. * * The ``$user_id`` can be passed in directly; or a lookup can be performed with ``$subscr_id``. * * @package s2Member\Utilities * @since 110912 * * @param str $var Required. The requested Signup Var. * @param int|str $user_id Optional. A numeric WordPress® User ID. * @param str $subscr_id Optional. Can be used instead of passing in a ``$user_id``. * If ``$subscr_id`` is passed in, it has to match the one found inside the resulting IPN Signup Vars collected by this routine. * If neither of these parameters are passed in, the current User is assumed instead, obtained through ``wp_get_current_user()``. * @return mixed|bool A User's IPN Signup Var on success, else false on failure. */ public static function get_user_ipn_signup_var ($var = FALSE, $user_id = FALSE, $subscr_id = FALSE) { if (!empty ($var) && is_array ($user_ipn_signup_vars = c_ws_plugin__s2member_utils_users::get_user_ipn_signup_vars ($user_id, $subscr_id))) { if /* Available? */(isset ($user_ipn_signup_vars[$var])) return $user_ipn_signup_vars[$var]; } return /* Otherwise, return false. */ false; } /** * Obtains a User's Paid Subscr. ID *(if available)*; otherwise their WP User ID. * * If ``$user`` IS passed in, this function will return data from a specific ``$user``, or fail if not possible. * If ``$user`` is NOT passed in, check the current User/Member. * * @package s2Member\Utilities * @since 3.5 * * @param obj $user Optional. A `WP_User` object. * In order to check the current User, you must call this function with no arguments/parameters. * @return int|str|bool If possible, the User's Paid Subscr. ID, else their WordPress® User ID, else false. */ public static function get_user_subscr_or_wp_id ($user = FALSE) { if ((func_num_args () && (!is_object ($user) || empty ($user->ID))) || (!func_num_args () && (!is_object ($user = (is_user_logged_in ()) ? wp_get_current_user () : false) || empty ($user->ID)))) { return /* The ``$user`` was passed in but is NOT an object; or nobody is logged in. */ false; } else // Else return Paid Subscr. ID (if available), otherwise return their WP database User ID. return ($subscr_id = get_user_option ("s2member_subscr_id", $user->ID)) ? $subscr_id : $user->ID; } /** * Determines whether or not a Username/Email is already in the database. * * Returns the WordPress® User ID if they exist. * * @package s2Member\Utilities * @since 3.5 * * @param str $user_login A User's Username. * @param str $user_email A User's Email Address. * @return int|bool If exists, a WordPress® User ID, else false. */ public static function user_login_email_exists ($user_login = FALSE, $user_email = FALSE) { global /* Global database object reference. */ $wpdb; if /* Only if we have both of these. */ ($user_login && $user_email) if (($user_id = $wpdb->get_var ("SELECT `ID` FROM `" . $wpdb->users . "` WHERE `user_login` LIKE '" . esc_sql (like_escape ($user_login)) . "' AND `user_email` LIKE '" . esc_sql (like_escape ($user_email)) . "' LIMIT 1"))) return /* Return the associated WordPress® ID. */$user_id; return /* Else return false. */false; } /** * Determines whether or not a Username/Email is already in the database for this Blog. * * Returns the WordPress® User ID if they exist. * * @package s2Member\Utilities * @since 3.5 * * @param str $user_login A User's Username. * @param str $user_email A User's Email Address. * @param int|str $blog_id A numeric WordPress® Blog ID. * @return int|bool If exists *(but not on Blog)*, a WordPress® User ID, else false. */ public static function ms_user_login_email_exists_but_not_on_blog ($user_login = FALSE, $user_email = FALSE, $blog_id = FALSE) { if /* Only if we have both of these. */ ($user_login && $user_email) if (is_multisite () && ($user_id = c_ws_plugin__s2member_utils_users::user_login_email_exists ($user_login, $user_email)) && !is_user_member_of_blog ($user_id, $blog_id)) return $user_id; return /* Else return false. */ false; } /** * Determines whether or not a Username/Email is already in the database for this Blog. * * This is an alias for: `c_ws_plugin__s2member_utils_users::ms_user_login_email_exists_but_not_on_blog()`. * * Returns the WordPress® User ID if they exist. * * @package s2Member\Utilities * @since 3.5 * * @param str $user_login A User's Username. * @param str $user_email A User's Email Address. * @param int|str $blog_id A numeric WordPress® Blog ID. * @return int|bool If exists *(but not on Blog)*, a WordPress® User ID, else false. */ public static function ms_user_login_email_can_join_blog ($user_login = FALSE, $user_email = FALSE, $blog_id = FALSE) { return c_ws_plugin__s2member_utils_users::ms_user_login_email_exists_but_not_on_blog ($user_login, $user_email, $blog_id); } /** * Retrieves a field value. Also supports Custom Fields. * * @package s2Member\Utilities * @since 3.5 * * @param str $field_id Required. A unique Custom Registration/Profile Field ID, that you configured with s2Member. * Or, this could be set to any property that exists on the WP_User object for a particular User; * ( i.e. `id`, `ID`, `user_login`, `user_email`, `first_name`, `last_name`, `display_name`, `ip`, `IP`, * `s2member_registration_ip`, `s2member_custom`, `s2member_subscr_id`, `s2member_subscr_or_wp_id`, * `s2member_subscr_gateway`, `s2member_custom_fields`, `s2member_file_download_access_[log|arc]`, * `s2member_auto_eot_time`, `s2member_last_payment_time`, `s2member_paid_registration_times`, * `s2member_access_role`, `s2member_access_level`, `s2member_access_label`, * `s2member_access_ccaps`, etc, etc. ). * @param int|str $user_id Optional. Defaults to the current User's ID. * @return mixed The value of the requested field, or false if the field does not exist. */ public static function get_user_field ($field_id = FALSE, $user_id = FALSE) // Very powerful function here. { global /* Global database object reference. */ $wpdb; $current_user = /* Current User's object (used when/if `$user_id` is empty). */ wp_get_current_user (); if (is_object ($user = ($user_id) ? new WP_User ($user_id) : $current_user) && !empty ($user->ID) && ($user_id = $user->ID)) { if /* Immediate User object property? (most likely) */(isset ($user->$field_id)) return $user->$field_id; else if /* Also try the data object property. */ (isset ($user->data->$field_id)) return $user->data->$field_id; else if /* Immediate prefixed? */ (isset ($user->{$wpdb->prefix . $field_id})) return $user->{$wpdb->prefix . $field_id}; else if /* Data prefixed? */ (isset ($user->data->{$wpdb->prefix . $field_id})) return $user->data->{$wpdb->prefix . $field_id}; else if /* First/last full name? */ (strcasecmp ($field_id, "full_name") === 0) return trim ($user->first_name . " " . $user->last_name); else if /* Email address? */ (preg_match ("/^(email|user_email)$/i", $field_id)) return $user->user_email; else if /* Username / login? */ (preg_match ("/^(login|user_login)$/i", $field_id)) return $user->user_login; else if /* Role name/ID? */ (strcasecmp ($field_id, "s2member_access_role") === 0) return c_ws_plugin__s2member_user_access::user_access_role ($user); else if /* Access Level? */ (strcasecmp ($field_id, "s2member_access_level") === 0) return c_ws_plugin__s2member_user_access::user_access_level ($user); else if /* Access Label? */ (strcasecmp ($field_id, "s2member_access_label") === 0) return c_ws_plugin__s2member_user_access::user_access_label ($user); else if /* Custom Caps? */ (strcasecmp ($field_id, "s2member_access_ccaps") === 0) return c_ws_plugin__s2member_user_access::user_access_ccaps ($user); else if (strcasecmp ($field_id, "ip") === 0 && is_object ($current_user) && !empty ($current_user->ID) && $current_user->ID === ($user_id = $user->ID)) return /* The current User's IP address, right now. */ $_SERVER["REMOTE_ADDR"]; else if (strcasecmp ($field_id, "s2member_registration_ip") === 0 || strcasecmp ($field_id, "reg_ip") === 0 || strcasecmp ($field_id, "ip") === 0) return get_user_option ("s2member_registration_ip", $user_id); else if (strcasecmp ($field_id, "s2member_subscr_or_wp_id") === 0) return ($subscr_id = get_user_option ("s2member_subscr_id", $user_id)) ? $subscr_id : $user_id; else if (is_array ($fields = get_user_option ("s2member_custom_fields", $user_id))) if (isset ($fields[preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field_id))])) return $fields[preg_replace ("/[^a-z0-9]/i", "_", strtolower ($field_id))]; } return /* Default, return false. */ false; } } } ?>
rjlchris/network-buckets
wp-content/plugins/s2member/includes/classes/utils-users.inc.php
PHP
gpl-2.0
18,297
<?xml version="1.0" encoding="iso-8859-1"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>QDPlugin Class Reference</title> <link href="classic.css" rel="stylesheet" type="text/css" /> </head> <body> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr> <td align="left" valign="top" width="32"><img src="images/qtlogo.png" align="left" border="0" /></td> <td width="1">&nbsp;&nbsp;</td><td class="postheader" valign="center"><a href="../index.html"><font color="#004faf">Qt Extended Home</font></a>&nbsp;&middot; <a href="index.html"><font color="#004faf">Index</font></a>&nbsp;&middot; <a href="classes.html"><font color="#004faf">Classes</font></a>&nbsp;&middot; <a href="headers.html"><font color="#004faf">Headers</font></a>&nbsp;&middot; <a href="overviews.html"><font color="#004faf">Overviews</font></a> </td> <td align="right" valign="center"><img src="images/codeless.png" border="0" alt="codeless banner"></td></tr></table><h1 class="title">QDPlugin Class Reference</h1> <p>The QDPlugin class represents a Qt Extended Sync Agent plugin. <a href="#details">More...</a></p> <pre> #include &lt;QDPlugin&gt;</pre><p>Inherits <a href="foo/../../qobject.html">QObject</a>.</p> <p>Inherited by <a href="qdappplugin.html">QDAppPlugin</a>, <a href="qdclientsyncpluginfactory.html">QDClientSyncPluginFactory</a>, <a href="qdconplugin.html">QDConPlugin</a>, <a href="qddevplugin.html">QDDevPlugin</a>, <a href="qdlinkplugin.html">QDLinkPlugin</a>, and <a href="qdsyncplugin.html">QDSyncPlugin</a>.</p> <ul> <li><a href="qdplugin-members.html">List of all members, including inherited members</a></li> </ul> <a name="public-functions"></a> <h3>Public Functions</h3> <ul> <li><div class="fn"/><b><a href="qdplugin.html#QDPlugin">QDPlugin</a></b> ( QObject * <i>parent</i> = 0 )</li> <li><div class="fn"/>virtual <b><a href="qdplugin.html#dtor.QDPlugin">~QDPlugin</a></b> ()</li> <li><div class="fn"/>CenterInterface * <b><a href="qdplugin.html#centerInterface">centerInterface</a></b> ()</li> <li><div class="fn"/>virtual QString <b><a href="qdplugin.html#displayName">displayName</a></b> () = 0</li> <li><div class="fn"/>virtual QString <b><a href="qdplugin.html#id">id</a></b> () = 0</li> <li><div class="fn"/>virtual void <b><a href="qdplugin.html#init">init</a></b> ()</li> <li><div class="fn"/>void <b><a href="qdplugin.html#lock">lock</a></b> ( QDPlugin * <i>plugin</i> )</li> <li><div class="fn"/>bool <b><a href="qdplugin.html#locked">locked</a></b> () const</li> <li><div class="fn"/>void <b><a href="qdplugin.html#unlock">unlock</a></b> ( QDPlugin * <i>plugin</i> )</li> </ul> <ul> <li><div class="fn"/>29 public functions inherited from <a href="foo/../../qobject.html#public-functions">QObject</a></li> </ul> <h3>Additional Inherited Members</h3> <ul> <li><div class="fn"/>1 property inherited from <a href="foo/../../qobject.html#properties">QObject</a></li> <li><div class="fn"/>1 public slot inherited from <a href="foo/../../qobject.html#public-slots">QObject</a></li> <li><div class="fn"/>1 signal inherited from <a href="foo/../../qobject.html#signals">QObject</a></li> <li><div class="fn"/>1 public type inherited from <a href="foo/../../qobject.html#public-variables">QObject</a></li> <li><div class="fn"/>4 static public members inherited from <a href="foo/../../qobject.html#static-public-members">QObject</a></li> <li><div class="fn"/>7 protected functions inherited from <a href="foo/../../qobject.html#protected-functions">QObject</a></li> <li><div class="fn"/>2 protected variables inherited from <a href="foo/../../qobject.html#protected-variables">QObject</a></li> </ul> <a name="details"></a> <hr /> <h2>Detailed Description</h2> <p>The QDPlugin class represents a Qt Extended Sync Agent plugin.</p> <p>All Qt Extended Sync Agent plugins inherit from QDPlugin but the class itself is abstract.</p> <p>When creating a plugin you can use the QD_CONSTRUCT_PLUGIN macro to simplify the construction boilerplate that must be created.</p> <p>See also <a href="qdplugindefs-h.html">&lt;qdplugindefs.h&gt;</a>.</p> <hr /> <h2>Member Function Documentation</h2> <h3 class="fn"><a name="QDPlugin"></a>QDPlugin::QDPlugin ( <a href="foo/../../qobject.html">QObject</a> * <i>parent</i> = 0 )</h3> <p>Construct a <a href="qdplugin.html">QDPlugin</a> with <i>parent</i> as the owning <a href="foo/../../qobject.html">QObject</a>.</p> <h3 class="fn"><a name="dtor.QDPlugin"></a>QDPlugin::~QDPlugin ()&nbsp;&nbsp;<tt> [virtual]</tt></h3> <p>Destructor.</p> <h3 class="fn"><a name="centerInterface"></a><a href="centerinterface.html">CenterInterface</a> * QDPlugin::centerInterface ()</h3> <p>Return the <a href="centerinterface.html">CenterInterface</a> associated with this plugin.</p> <h3 class="fn"><a name="displayName"></a><a href="foo/../../qstring.html">QString</a> QDPlugin::displayName ()&nbsp;&nbsp;<tt> [pure virtual]</tt></h3> <p>Returns the name the user will see when referring to this plugin.</p> <h3 class="fn"><a name="id"></a><a href="foo/../../qstring.html">QString</a> QDPlugin::id ()&nbsp;&nbsp;<tt> [pure virtual]</tt></h3> <p>Returns a unique value so that every plugin can be identified. It is recommended to use a reverse-DNS style name here. For example, com.trolltech.plugin.app.test</p> <h3 class="fn"><a name="init"></a>void QDPlugin::init ()&nbsp;&nbsp;<tt> [virtual]</tt></h3> <p>This function can be used by plugins to do initialization. It is called after all plugins have been loaded so it is safe to request another plugin by it's id.</p> <p>Note that this function will not be called if your plugin is not enabled. You should ensure that your destructor will not fail as a result of skipping this method.</p> <h3 class="fn"><a name="lock"></a>void QDPlugin::lock ( QDPlugin * <i>plugin</i> )</h3> <p>Lock the plugin using <i>plugin</i> as the key. A plugin can use <a href="qdplugin.html#locked">locked</a>() to see if it has been locked.</p> <p>This function is designed so that one plugin can inform another plugin that it is being used.</p> <p>For example, a device plugin is locked when a data transfer is occurring so that it does not disconnect.</p> <h3 class="fn"><a name="locked"></a>bool QDPlugin::locked () const</h3> <p>Return true if anyone has locked this plugin.</p> <h3 class="fn"><a name="unlock"></a>void QDPlugin::unlock ( QDPlugin * <i>plugin</i> )</h3> <p>Remove the lock set by <i>plugin</i>.</p> <p /><address><hr /><div align="center"> <table width="100%" cellspacing="0" border="0"><tr class="address"> <td align="left">Copyright &copy; 2009 Trolltech</td> <td align="right"><div align="right">Qt Extended Sync Agent Documentation</div></td> </tr></table></div></address></body> </html>
librelab/qtmoko-test
doc/html/qtopiadesktop/qdplugin.html
HTML
gpl-2.0
6,800
<?php /* @author dhtmlx.com @license GPL, see license.txt */ require_once("base_connector.php"); class CommonDataProcessor extends DataProcessor{ protected function get_post_values($ids){ if (isset($_GET['action'])){ $data = array(); if (isset($_POST["id"])){ $dataset = array(); foreach($_POST as $key=>$value) $dataset[$key] = ConnectorSecurity::filter($value); $data[$_POST["id"]] = $dataset; } else $data["dummy_id"] = $_POST; return $data; } return parent::get_post_values($ids); } protected function get_ids(){ if (isset($_GET['action'])){ if (isset($_POST["id"])) return array($_POST['id']); else return array("dummy_id"); } return parent::get_ids(); } protected function get_operation($rid){ if (isset($_GET['action'])) return $_GET['action']; return parent::get_operation($rid); } public function output_as_xml($results){ if (isset($_GET['action'])){ LogMaster::log("Edit operation finished",$results); ob_clean(); $type = $results[0]->get_status(); if ($type == "error" || $type == "invalid"){ echo "false"; } else if ($type=="insert"){ echo "true\n".$results[0]->get_new_id(); } else echo "true"; } else return parent::output_as_xml($results); } }; /*! DataItem class for DataView component **/ class CommonDataItem extends DataItem{ /*! return self as XML string */ function to_xml(){ if ($this->skip) return ""; return $this->to_xml_start().$this->to_xml_end(); } function to_xml_start(){ $str="<item id='".$this->get_id()."' "; for ($i=0; $i < sizeof($this->config->text); $i++){ $name=$this->config->text[$i]["name"]; $str.=" ".$name."='".$this->xmlentities($this->data[$name])."'"; } if ($this->userdata !== false) foreach ($this->userdata as $key => $value) $str.=" ".$key."='".$this->xmlentities($value)."'"; return $str.">"; } } /*! Connector class for DataView **/ class DataConnector extends Connector{ /*! constructor Here initilization of all Masters occurs, execution timer initialized @param res db connection resource @param type string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided @param item_type name of class, which will be used for item rendering, optional, DataItem will be used by default @param data_type name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. */ public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){ if (!$item_type) $item_type="CommonDataItem"; if (!$data_type) $data_type="CommonDataProcessor"; $this->sections = array(); if (!$render_type) $render_type="RenderStrategy"; parent::__construct($res,$type,$item_type,$data_type,$render_type); } protected $sections; public function add_section($name, $string){ $this->sections[$name] = $string; } protected function parse_request_mode(){ if (isset($_GET['action']) && $_GET["action"] != "get") $this->editing = true; else parent::parse_request_mode(); } //parse GET scoope, all operations with incoming request must be done here protected function parse_request(){ if (isset($_GET['action'])){ $action = $_GET['action']; //simple request mode if ($action == "get"){ //data request if (isset($_GET['id'])){ //single entity data request $this->request->set_filter($this->config->id["name"],$_GET['id'],"="); } else { //loading collection of items } } else { //data saving $this->editing = true; } parent::check_csrf(); } else { if (isset($_GET['editing']) && isset($_POST['ids'])) $this->editing = true; parent::parse_request(); } if (isset($_GET["start"]) && isset($_GET["count"])) $this->request->set_limit($_GET["start"],$_GET["count"]); } /*! renders self as xml, starting part */ protected function xml_start(){ $start = "<data"; foreach($this->attributes as $k=>$v) $start .= " ".$k."='".$v."'"; $start.= ">"; foreach($this->sections as $k=>$v) $start .= "<".$k.">".$v."</".$k.">\n"; return $start; } }; class JSONDataConnector extends DataConnector{ public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){ if (!$item_type) $item_type="JSONCommonDataItem"; if (!$data_type) $data_type="CommonDataProcessor"; if (!$render_type) $render_type="JSONRenderStrategy"; $this->data_separator = ",\n"; parent::__construct($res,$type,$item_type,$data_type,$render_type); } /*! assign options collection to the column @param name name of the column @param options array or connector object */ public function set_options($name,$options){ if (is_array($options)){ $str=array(); foreach($options as $k => $v) $str[]='{"id":"'.$this->xmlentities($k).'", "value":"'.$this->xmlentities($v).'"}'; $options=implode(",",$str); } $this->options[$name]=$options; } /*! generates xml description for options collections @param list comma separated list of column names, for which options need to be generated */ protected function fill_collections($list=""){ $options = array(); foreach ($this->options as $k=>$v) { $name = $k; $option="\"{$name}\":["; if (!is_string($this->options[$name])) $option.=substr(json_encode($this->options[$name]->render()),1,-1); else $option.=$this->options[$name]; $option.="]"; $options[] = $option; } $this->extra_output .= implode($this->data_separator, $options); } protected function resolve_parameter($name){ if (intval($name).""==$name) return $this->config->text[intval($name)]["db_name"]; return $name; } protected function output_as_xml($res){ $json = $this->render_set($res); if ($this->simple) return $json; $result = json_encode($json); $this->fill_collections(); $is_sections = sizeof($this->sections) && $this->is_first_call(); if ($this->dload || $is_sections || sizeof($this->attributes) || !empty($this->extra_data)){ $attributes = ""; foreach($this->attributes as $k=>$v) $attributes .= ", \"".$k."\":\"".$v."\""; $extra = ""; if (!empty($this->extra_output)) $extra .= ', "collections": {'.$this->extra_output.'}'; $sections = ""; if ($is_sections){ //extra sections foreach($this->sections as $k=>$v) $sections .= ", \"".$k."\":".$v; } $dyn = ""; if ($this->dload){ //info for dyn. loadin if ($pos=$this->request->get_start()) $dyn .= ", \"pos\":".$pos; else $dyn .= ", \"pos\":0, \"total_count\":".$this->sql->get_size($this->request); } if ($attributes || $sections || $this->extra_output || $dyn) { $result = "{ \"data\":".$result.$attributes.$extra.$sections.$dyn."}"; } } // return as string if ($this->as_string) return $result; // output direct to response $out = new OutputWriter($result, ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); return null; } } class JSONCommonDataItem extends DataItem{ /*! return self as XML string */ function to_xml(){ if ($this->skip) return false; $data = array( 'id' => $this->get_id() ); for ($i=0; $i<sizeof($this->config->text); $i++){ $extra = $this->config->text[$i]["name"]; $data[$extra]=$this->data[$extra]; } if ($this->userdata !== false) foreach ($this->userdata as $key => $value){ if ($value === null) $data[$key]=""; $data[$key]=$value; } return $data; } } /*! wrapper around options collection, used for comboboxes and filters **/ class JSONOptionsConnector extends JSONDataConnector{ protected $init_flag=false;//!< used to prevent rendering while initialization public function __construct($res,$type=false,$item_type=false,$data_type=false){ if (!$item_type) $item_type="JSONCommonDataItem"; if (!$data_type) $data_type=""; //has not sense, options not editable parent::__construct($res,$type,$item_type,$data_type); } /*! render self process commands, return data as XML, not output data to stdout, ignore parameters in incoming request @return data as XML string */ public function render(){ if (!$this->init_flag){ $this->init_flag=true; return ""; } $res = $this->sql->select($this->request); return $this->render_set($res); } } class JSONDistinctOptionsConnector extends JSONOptionsConnector{ /*! render self process commands, return data as XML, not output data to stdout, ignore parameters in incoming request @return data as XML string */ public function render(){ if (!$this->init_flag){ $this->init_flag=true; return ""; } $res = $this->sql->get_variants($this->config->text[0]["db_name"],$this->request); return $this->render_set($res); } } class TreeCommonDataItem extends CommonDataItem{ protected $kids=-1; function to_xml_start(){ $str="<item id='".$this->get_id()."' "; for ($i=0; $i < sizeof($this->config->text); $i++){ $name=$this->config->text[$i]["name"]; $str.=" ".$name."='".$this->xmlentities($this->data[$name])."'"; } if ($this->userdata !== false) foreach ($this->userdata as $key => $value) $str.=" ".$key."='".$this->xmlentities($value)."'"; if ($this->kids === true) $str .=" ".Connector::$kids_var."='1'"; return $str.">"; } function has_kids(){ return $this->kids; } function set_kids($value){ $this->kids=$value; } } class TreeDataConnector extends DataConnector{ protected $parent_name = 'parent'; public $rootId = "0"; /*! constructor Here initilization of all Masters occurs, execution timer initialized @param res db connection resource @param type string , which hold type of database ( MySQL or Postgre ), optional, instead of short DB name, full name of DataWrapper-based class can be provided @param item_type name of class, which will be used for item rendering, optional, DataItem will be used by default @param data_type name of class which will be used for dataprocessor calls handling, optional, DataProcessor class will be used by default. * @param render_type * name of class which will provides data rendering */ public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){ if (!$item_type) $item_type="TreeCommonDataItem"; if (!$data_type) $data_type="CommonDataProcessor"; if (!$render_type) $render_type="TreeRenderStrategy"; parent::__construct($res,$type,$item_type,$data_type,$render_type); } //parse GET scoope, all operations with incoming request must be done here protected function parse_request(){ parent::parse_request(); if (isset($_GET[$this->parent_name])) $this->request->set_relation($_GET[$this->parent_name]); else $this->request->set_relation("0"); $this->request->set_limit(0,0); //netralize default reaction on dyn. loading mode } /*! renders self as xml, starting part */ protected function xml_start(){ $attributes = " "; if (!$this->rootId || $this->rootId != $this->request->get_relation()) $attributes = " parent='".$this->request->get_relation()."' "; foreach($this->attributes as $k=>$v) $attributes .= " ".$k."='".$v."'"; return "<data".$attributes.">"; } } class JSONTreeDataConnector extends TreeDataConnector{ public function __construct($res,$type=false,$item_type=false,$data_type=false,$render_type=false){ if (!$item_type) $item_type="JSONTreeCommonDataItem"; if (!$data_type) $data_type="CommonDataProcessor"; if (!$render_type) $render_type="JSONTreeRenderStrategy"; parent::__construct($res,$type,$item_type,$data_type,$render_type); } protected function output_as_xml($res){ $result = $this->render_set($res); if ($this->simple) return $result; $data = array(); if (!$this->rootId || $this->rootId != $this->request->get_relation()) $data["parent"] = $this->request->get_relation(); $data["data"] = $result; $this->fill_collections(); if (!empty($this->options)) $data["collections"] = $this->options; foreach($this->attributes as $k=>$v) $data[$k] = $v; $data = json_encode($data); // return as string if ($this->as_string) return $data; // output direct to response $out = new OutputWriter($data, ""); $out->set_type("json"); $this->event->trigger("beforeOutput", $this, $out); $out->output("", true, $this->encoding); } /*! assign options collection to the column @param name name of the column @param options array or connector object */ public function set_options($name,$options){ if (is_array($options)){ $str=array(); foreach($options as $k => $v) $str[]=Array("id"=>$this->xmlentities($k), "value"=>$this->xmlentities($v));//'{"id":"'.$this->xmlentities($k).'", "value":"'.$this->xmlentities($v).'"}'; $options=$str; } $this->options[$name]=$options; } /*! generates xml description for options collections @param list comma separated list of column names, for which options need to be generated */ protected function fill_collections($list=""){ $options = array(); foreach ($this->options as $k=>$v) { $name = $k; if (!is_array($this->options[$name])) $option=$this->options[$name]->render(); else $option=$this->options[$name]; $options[$name] = $option; } $this->options = $options; $this->extra_output .= "'collections':".json_encode($options); } } class JSONTreeCommonDataItem extends TreeCommonDataItem{ /*! return self as XML string */ function to_xml_start(){ if ($this->skip) return false; $data = array( "id" => $this->get_id() ); for ($i=0; $i<sizeof($this->config->text); $i++){ $extra = $this->config->text[$i]["name"]; if (isset($this->data[$extra])) $data[$extra]=$this->data[$extra]; } if ($this->userdata !== false) foreach ($this->userdata as $key => $value) $data[$key]=$value; if ($this->kids === true) $data[Connector::$kids_var] = 1; return $data; } function to_xml_end(){ return ""; } } ?>
casser/dhx
samples/dhtmlxList/common/connector/data_connector.php
PHP
gpl-2.0
14,410
@import url(http://fonts.googleapis.com/css?family=Nothing+You+Could+Do); @import url(http://fonts.googleapis.com/css?family=Pacifico); @import url(http://fonts.googleapis.com/css?family=Raleway:400,300,200,500,100,600,700,800,900); @import url(http://fonts.googleapis.com/css?family=Droid+Serif:400,400italic,700,700italic); body { color: #D3D3D3; } a:not(.btn) { color: #21C2F8; } a:not(.btn):hover { color: #21C2F8; } h1, h2, h3, h4, h5, h6 { color: #FFFFFF; } h1, h2, h3, h4, h5, h6 { color: #FFFFFF; font-family: 'Helvetica Neue', Helvetica, sans-serif; font-weight: 600; margin-bottom: 15px; text-rendering: optimizelegibility; } p { line-height: 25px; } *, *:after, *:before { box-sizing: border-box; margin: 0; padding: 0; } ol, ol.no-bullet, ul, ul.no-bullet { margin-left: 0; } a:hover { text-decoration: none; } .form-text:focus, .form-textarea:focus { border: solid 1px #21C2F8 !important; } .pagination > li > a, .pagination > li > span { background-color: #272727; color: #FFFFFF; float: left; line-height: 1.82857; margin-left: 5px; padding: 6px 15px; position: relative; text-decoration: none; border: 0 none; } .pagination > li > a:hover { background-color: #21C2F8; color: #FFF; } .pagination > li:first-child > a, .pagination > li:last-child > a, .pagination > li:first-child > span, .pagination > li:last-child > span { border-radius: 0px; } .pagination .pager-current a { background-color: #21C2F8; } img { height: auto; max-width: 100%; } .popular_items img, .comment img, .shopping-cart-widget img, div.thumbnails a img, .authorbox_wrapper img, .flickr-gallery li img, .recent_posts img, .recent_posts_widget img, .testimonial_wrap img, .popular-post img { -webkit-transition: opacity 0.2s ease-in-out; -moz-transition: opacity 0.2s ease-in-out; -ms-transition: opacity 0.2s ease-in-out; -o-transition: opacity 0.2s ease-in-out; transition: opacity 0.2s ease-in-out; } .popular_items img:hover, .shopping-cart-widget img:hover, div.thumbnails a img:hover, .comment img:hover, .authorbox_wrapper img:hover, .flickr-gallery li img:hover, .recent_posts img:hover, .recent_posts_widget img:hover, .testimonial_wrap img:hover, .popular-post img:hover { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; filter: alpha(opacity=60); -moz-opacity: 0.6; -khtml-opacity: 0.6; opacity: 0.6; } .greybg { background-color: #F6F6F6; } .bordertop { border-top: 1px solid #E6E9EA; } .paddingtop { padding: 60px 0 0; } .margintop { margin: 60px 0 0; } .padding-copyright { padding: 25px 0 20px 0; } @font-face { font-family: 'NovecentowideLightBold'; src: url('../fonts/Novecentowide-DemiBold-webfont.eot'); src: url('../fonts/Novecentowide-DemiBold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Novecentowide-DemiBold-webfont.woff') format('woff'), url('../fonts/Novecentowide-DemiBold-webfont.ttf') format('truetype'), url('../fonts/Novecentowide-DemiBold-webfont.svg#NovecentowideLightBold') format('svg'); font-weight: normal; font-style: normal; } @font-face { font-family: 'NovecentowideBookBold'; src: url('../fonts/Novecentowide-Bold-webfont.eot'); src: url('../fonts/Novecentowide-Bold-webfont.eot?#iefix') format('embedded-opentype'), url('../fonts/Novecentowide-Bold-webfont.woff') format('woff'), url('../fonts/Novecentowide-Bold-webfont.ttf') format('truetype'), url('../fonts/Novecentowide-Bold-webfont.svg#NovecentowideBookBold') format('svg'); font-weight: normal; font-style: normal; } body { font-family: Raleway, Arial, Helvetica, sans-serif; font-size: 14px; font-weight: 400; line-height: 1.8; color: #83939C; } body.boxed { background: url("../images/boxed_bg.png"); } body.boxed .dexp-body-inner { max-width: 1170px; margin: 0 auto; box-shadow: 0 0 10px rgba(0,0,0,0.25); } body.header-color #section-top { background-color: #21C2F8; color: #fff; } body.header-color #section-top span, body.header-color #section-top a, body.header-color #section-top i { color: #fff; } body.header-dark #section-top { background-color: #292723; color: #fff; } body.header-dark #section-top span, body.header-dark #section-top a, body.header-dark #section-top i { color: #fff; } #section-main-content { padding-top: 50px; } #section-page-title { background: url("../images/topbg.png") repeat scroll 0 0 rgba(0,0,0,0); border-bottom: 3px solid #FFFFFF; } #section-page-title h1.page_title { color: #FFFFFF; display: inline-block; font-size: 24px; margin-bottom: -3px; } #section-page-title .breadcrumb { background: none; margin: 0; padding: 0; } .footer1 { color: #83939C; border-top: 3px solid #353A3E; box-shadow: 0 0 5px 5px #353A3E inset; padding: 60px 0 45px; } .footer1 p { line-height: 25px; } .footer1 h2.block-title { color: #FFFFFF; margin: 0 0 25px 0; font-size: 20px; text-transform: uppercase; } .footer1 .contact-widget { background-image: url("../images/footermap.png"); background-position: center top; background-repeat: no-repeat; background-size: 100% auto; } .footer1 .contact-widget ul li { list-style: none outside none; margin-bottom: 10px; padding-bottom: 10px; } .footer1 .contact-widget ul li i { font-size: 15px; padding-right: 5px; color: #FFF; } .footer1 .contact-widget ul.social { border-top: 1px solid #3A3A3A !important; padding-top: 10px; } .footer1 .contact-widget ul.social li { display: inline-block; border-left: 0px solid #f2F2F2 !important; float: left; height: 35px; line-height: 35px; width: 35px; position: relative; text-align: center; } .footer1 .contact-widget ul.social li:last-child { border-right: 0px solid #F2F2F2 !important; } .footer1 .contact-widget ul.social li a { margin: 0; padding: 0; text-decoration: none; transition: background-color 0.2s linear 0s, color 0.2s linear 0s; font-size: 14px; color: #9CA5AB; } .footer1 .contact-widget ul.social li a:hover { color: #21C2F8 !important; } .jt-shadow { box-shadow: 0 1px 3px rgba(0,0,0,0.1) inset; } mark { background-color: #21C2F8; color: #FFF; padding: 0 10px; } .copyright { color: #292723; } .messagebox1 h1 { border-style: none; border-width: 0; color: #FFFFFF; font-family: 'Pacifico', cursive; font-size: 38px; font-weight: 400; line-height: 1.6; padding: 0; text-decoration: none; } #section-top { border-bottom: 1px solid #f2f2f2; } .social li { float: left; width: 40px; height: 40px; line-height: 40px; text-align: center; list-style: none; border-left: 1px solid #f2f2f2; display: inline-block; margin: 0; position: relative; padding: 0; } .social li:last-child { border-right: 1px solid #f2f2f2; } .social li a { color: #9ca5ab; } .callus { line-height: 40px; } .callus ul { margin: 0; padding: 0; float: right; } .callus li { list-style: none; border-left: 1px solid #f2f2f2; float: left; text-align: center; padding: 0 10px; height: 40px; line-height: 40px; display: inline-block; margin: 0; position: relative; } .callus li:last-child { border-right: 1px solid #f2f2f2; } .callus li p { margin: 0; padding: 0; line-height: 40px; font-size: 12px; } .callus li p span { color: #21C2F8; } .callus li p a { color: #83939C; } .footer-social li { border: 1px solid #21C2F8; border-radius: 500px; color: #292723; display: inline-block; font-size: 15px; height: 40px; line-height: 40px; margin: 30px 5px 5px; position: relative; text-align: center; width: 40px; z-index: 5; } .footer-social li:hover { background-color: #21C2F8; } .footer-social li:hover a, .footer-social li:hover i { color: #FFFFFF; } ul.list-unstyled { margin: 0; padding: 0; } ul.list-unstyled >li { list-style: none; margin: 0; } div.hr { height: 1px; border-bottom: 1px solid #2F2F2F; margin: 15px 0; } .milestone-counter { text-align: center; } .jtbtn-big { border: 1px solid #21C2F8; } .jtbtn-big.anim { display: inline-block; font-size: 14px; padding: 5px 20px 5px 30px !important; text-align: center; text-transform: uppercase; -webkit-transition: all 200ms linear; -moz-transition: all 200ms linear; -o-transition: all 200ms linear; -ms-transition: all 200ms linear; transition: all 200ms linear; } .boxed .dexp-body-inner { margin-top: 40px !important; background-color: #FFF; } .boxed .social li { border-left: none; } .boxed .social li:last-child { border-right: none; } #section-copyright { padding: 25px 0 20px 0; color: #292723; } #block-menu-menu-footer-menu { float: right; } #block-menu-menu-footer-menu ul { list-style: none; } #block-menu-menu-footer-menu ul li { list-style-type: none; display: inline-block; } #block-menu-menu-footer-menu ul li a { color: #292723; } #block-menu-menu-footer-menu ul li a.active-trail, #block-menu-menu-footer-menu ul li a:hover { color: #21C2F8; } @media screen and (max-width: 991px) { .region-social-top { text-align: center; } .region-social-top ul { display: inline-block; } } #go-to-top { background: #21C2F8; height: 40px; width: 40px; position: fixed; text-align: center; line-height: 40px; font-size: 23px; color: #fff; right: 25px; bottom: 25px; cursor: pointer; z-index: 999; -webkit-transition: all 0.3s linear; -moz-transition: all 0.3s linear; -o-transition: all 0.3s linear; -ms-transition: all 0.3s linear; transition: all 0.3s linear; } .dexp-grid-items .dexp-grid-item { margin-bottom: 30px; } @media (max-width: 767px) { .grid-xs-2 .dexp-grid-item:nth-child(2n+1) { clear: left; } .grid-xs-3 .dexp-grid-item:nth-child(3n+1) { clear: left; } .grid-xs-4 .dexp-grid-item:nth-child(4n+1) { clear: left; } .grid-xs-6 .dexp-grid-item:nth-child(6n+1) { clear: left; } .grid-xs-12 .dexp-grid-item:nth-child(12n+1) { clear: left; } } @media (min-width: 768px) and (max-width: 991px) { .grid-sm-2 .dexp-grid-item:nth-child(2n+1) { clear: left; } .grid-sm-3 .dexp-grid-item:nth-child(3n+1) { clear: left; } .grid-sm-4 .dexp-grid-item:nth-child(4n+1) { clear: left; } .grid-sm-6 .dexp-grid-item:nth-child(6n+1) { clear: left; } .grid-sm-12 .dexp-grid-item:nth-child(12n+1) { clear: left; } } @media (min-width: 992px) and (max-width: 1199px) { .grid-md-2 .dexp-grid-item:nth-child(2n+1) { clear: left; } .grid-md-3 .dexp-grid-item:nth-child(3n+1) { clear: left; } .grid-md-4 .dexp-grid-item:nth-child(4n+1) { clear: left; } .grid-md-6 .dexp-grid-item:nth-child(6n+1) { clear: left; } .grid-md-12 .dexp-grid-item:nth-child(12n+1) { clear: left; } } @media (min-width: 1200px) { .grid-lg-2 .row .dexp-grid-item:nth-child(2n+1) { clear: left; } .grid-lg-3 .row .dexp-grid-item:nth-child(3n+1) { clear: left; } .grid-lg-4 .row .dexp-grid-item:nth-child(4n+1) { clear: left; } .grid-lg-6 .row .dexp-grid-item:nth-child(6n+1) { clear: left; } .grid-lg-12 .row .dexp-grid-item:nth-child(12n+1) { clear: left; } } .region-left-sidebar .block, .region-right-sidebar .block { margin-bottom: 20px; padding-bottom: 20px; } .block .blog_wrap { margin-top: 0; } .title h1.block-title { font-size: 30px; } .title > hr { border-top: 1px solid #D4D4D4; margin: 0 auto; max-width: 235px; position: relative; } .title > hr:after { border-top: 1px solid #21C2F8; content: ""; left: 30%; position: absolute; right: 30%; top: -1px; } .title .block-subtitle, .title .lead { font-family: 'Droid Serif', Georgia, "Times New Roman", serif !important; font-size: 15px; font-style: italic; font-weight: 300; line-height: 1; padding: 15px 0; } .title .block-subtitle { padding-bottom: 50px; } .title1 > hr { border-top: 1px solid #D4D4D4; margin: 0; max-width: 280px; position: relative; } .title1 > hr:after { border-top: 1px solid #21C2F8; content: ""; left: 0; position: absolute; right: 80%; top: -1px; } .title1 .lead { font-family: 'Droid Serif', Georgia, "Times New Roman", serif !important; font-size: 15px; font-style: italic; font-weight: 300; line-height: 1; padding: 15px 0; } .bigtitle { padding: 20px 0; } .bigtitle > .content { padding-top: 20px; } .bigtitle h1.block-title { border-bottom: 1px solid #D4D4D4; font-family: 'NovecentowideBookBold', 'Helvetica Neue', Helvetica, sans-serif; font-size: 51px; font-weight: normal; padding-bottom: 30px; position: relative; } .bigtitle h1.block-title:after { border-bottom: 1px solid #21C2F8; bottom: -1px; content: ""; height: 0; left: 0; position: absolute; width: 25%; } .bigtitle .block-subtitle { color: #292723; font-size: 21px; font-weight: 300; line-height: 1.6; padding: 0 0 0 50px; margin-top: 20px; } .bigtitle .block-subtitle span { color: #21C2F8; } .block h3 { font-size: 18px; } .block.white h1, .block.white .title h3 { color: #FFF; } .block.white .block-subtitle { color: #FFF; } .block.overlay { position: relative; } .block.overlay .inner { background: url("../images/gridtile.png") rgba(0,0,0,0.4); content: ""; width: 100%; height: 100%; position: absolute; left: 0; top: 0; z-index: 0; } .block.overlay .content { z-index: 1; position: relative; } .dexp-parallax h1, .dexp-parallax h2, .dexp-parallax h3, .dexp-parallax h4, .dexp-parallax h5, .dexp-parallax h6 { color: #FFFFFF !important; } .dexp-parallax .rating-block { background: none; } .dexp-parallax.overlay h1.block-title { padding-top: 60px; color: #FFFFFF !important; } .greybg .rating-block { background: #F6F6F6 !important; } .quote-post { background: #f2f2f2; position: relative; padding: 20px 10px; } .quote-post:after { font-family: 'FontAwesome'; content: "\f10e"; padding-right: 20px; right: 0; position: absolute; top: 50px; color: #000000; font-size: 600%; opacity: 0.2; -moz-opacity: 0.2; filter: alpha(opacity=20); } .quote-post blockquote { border-left: 0px solid #fff; padding-bottom: 0; } .view-blog .pagination { margin-top: 40px; } .blog-content { padding: 20px; } .blog_button { background: none repeat scroll 0 0 #292723; border: 1px solid #EFEFEF; color: #FFFFFF !important; cursor: pointer; display: inline-block; font-size: 13px; font-weight: 400; line-height: 1.42857; margin-bottom: 30px; padding: 10px 23px; text-align: center; vertical-align: middle; white-space: nowrap; } #timeline { list-style-type: none; background: url("../images/timeline.png") repeat-y scroll center top rgba(0,0,0,0); margin: 0; overflow: hidden; padding: 0; position: relative; } #timeline .timeline-item { clear: both; float: left; margin: 0 10px; padding: 0; background: url("../images/timeline1.png") no-repeat scroll right center rgba(0,0,0,0); } #timeline .timeline-item:nth-child(2n) { background: url("../images/timeline2.png") no-repeat scroll left center rgba(0,0,0,0); float: right; } #timeline .timeline-item:nth-child(2n) .blog-columns { margin-left: 60px; margin-right: 0; } @media (max-width: 767px) { #timeline .timeline-item { margin: 0 10px 20px 10px; background: none; } #timeline .timeline-item:nth-child(2n) { background: none; } } .blog-columns { margin: 0 60px 0 0; padding: 0; position: relative; background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #EFEFEF; } .blog-columns img { width: 100%; } .blog-columns .title h3 { border-bottom: 1px solid #DADADA; font-size: 16px; margin-top: 0; padding-bottom: 15px; } .blog-columns .title h3 a { color: #292723; font-weight: 400; } .blog-columns .post_meta { padding: 0 0 15px; } .blog-columns .post_meta span { padding-right: 5px; color: #9CA5AB; } .blog-columns .post_meta span i { color: #292723; font-weight: 400; } .blog-columns .post_meta span a { color: #9CA5AB; } .blog-mansory .blog-columns { margin: 0 0 30px 0; } .blog_wrap { margin: 50px 0 0; } .blog_wrap .media_element img { width: 100%; } .blog_wrap .title { margin-bottom: 30px; } .blog_wrap .title h3 { border-bottom: 1px solid #DADADA; display: flex; font-size: 18px; padding-bottom: 15px; } .blog_wrap .title h3 a { color: #292723; font-weight: 400; } .blog_wrap .post_date { border: 1px solid #888888; border-radius: 500px; color: #292723; float: left; font-size: 15px; height: 54px; line-height: 54px; margin-right: 10px; position: relative; text-align: center; width: 54px; z-index: 5; } .blog_wrap .post_meta span { padding-right: 10px; color: #9CA5AB; } .blog_wrap .post_meta span i { padding-right: 4px; color: #292723; font-weight: 400; } .blog_wrap .post_meta span a { color: #9CA5AB; } .blog_wrap .post_desc { padding: 20px 0; text-align: justify; } .view-display-id-block_latest_news .blog_wrap a.readmore, .view-display-id-block_latest_news_2 .blog_wrap a.readmore { display: none; } .view-display-id-blog_two_columns .dexp-grid-item:nth-child(2n+1) { clear: left; } .view-display-id-blog_three_column .dexp-grid-item:nth-child(3n+1) { clear: left; } .authorbox_wrapper { border-bottom: 1px solid #EFEFEF; margin-bottom: 50px; padding: 20px; } .authorbox_wrapper img { margin: 0 20px 20px 0; width: 100px !important; border-radius: 50%; float: left; } .authorbox_wrapper h4 { margin-bottom: 0; padding-bottom: 0; font-size: 18px; } .authorbox_wrapper p { margin-top: 5px; padding-top: 5px; } #comments_wrapper .comment-avatar { margin: 0 20px 0 0; float: left; height: 70px; width: 70px; } #comments_wrapper .comment-content { background: none repeat scroll 0 0 #F2F2F2; border: 1px solid #EFEFEF; margin-bottom: 20px; overflow: hidden; padding: 20px; } #comments_wrapper .comment-reply { color: #FFFFFF; float: right; font-size: 12px; margin: -25px -5px 0 0; color: #FFF; } #comments_wrapper .comment-author { margin-bottom: 10px; } #comments_wrapper .comment-author .comment-meta { color: #AAAAAA; font-size: 12px; padding-left: 10px; } #comments_wrapper #comment-form .form-text { background-color: #FFFFFF; border: 1px solid #D9D9D9; box-shadow: 0 1px 1px rgba(0,0,0,0.075) inset; color: #656565; display: block; font-size: 12px; height: 34px; line-height: 1.42857; margin-bottom: 10px; padding: 6px 12px; -webkit-transition: border-color 0.15s ease-in-out; -moz-transition: border-color 0.15s ease-in-out; -o-transition: border-color 0.15s ease-in-out; -ms-transition: border-color 0.15s ease-in-out; transition: border-color 0.15s ease-in-out; -webkit-transition: box-shadow 0.15s ease-in-out; -moz-transition: box-shadow 0.15s ease-in-out; -o-transition: box-shadow 0.15s ease-in-out; -ms-transition: box-shadow 0.15s ease-in-out; transition: box-shadow 0.15s ease-in-out; vertical-align: middle; width: 100%; } #comments_wrapper #comment-form textarea { background-color: #FFFFFF; border: 1px solid #D9D9D9; box-shadow: 0 1px 1px rgba(0,0,0,0.075) inset; color: #656565; display: block; font-size: 12px; line-height: 1.42857; margin-bottom: 10px; padding: 6px 12px; -webkit-transition: border-color 0.15s ease-in-out; -moz-transition: border-color 0.15s ease-in-out; -o-transition: border-color 0.15s ease-in-out; -ms-transition: border-color 0.15s ease-in-out; transition: border-color 0.15s ease-in-out; -webkit-transition: box-shadow 0.15s ease-in-out 0.5s linear; -moz-transition: box-shadow 0.15s ease-in-out 0.5s linear; -o-transition: box-shadow 0.15s ease-in-out 0.5s linear; -ms-transition: box-shadow 0.15s ease-in-out 0.5s linear; transition: box-shadow 0.15s ease-in-out 0.5s linear; vertical-align: middle; width: 100%; } #comments_wrapper #comment-form label, #comments_wrapper #comment-form .grippie { display: none; } #comments_wrapper #comment-form .form-submit { background: #21C2F8; color: #FFFFFF; border-color: #21C2F8; } .popular-post ul li, .recent-post ul li { list-style: none outside none; height: 70px; margin: 0; clear: both; } .popular-post ul li img, .recent-post ul li img { width: 50px; height: 50px; margin-right: 10px; float: left; } .popular-post ul li .views-field-title .field-content, .recent-post ul li .views-field-title .field-content { display: block; height: 34px; line-height: 18px; overflow: hidden; } .popular-post ul li .views-field-title .field-content a, .recent-post ul li .views-field-title .field-content a { color: #83939C; font-size: 14px !important; font-weight: 600; } .popular-post ul li .views-field-created span, .recent-post ul li .views-field-created span { display: block; font-family: 'Droid Serif', Georgia, "Times New Roman", serif !important; font-size: 11px; font-style: italic; text-transform: none; color: #21C2F8; } .popular-post .file a, .recent-post .file a { display: none; } .view-blog-categories ul { list-style: none; } .view-blog-categories ul li { border-bottom: solid 1px #EFEFEF; margin: 0; } .view-blog-categories ul li:hover { background: #21C2F8; } .view-blog-categories ul li:hover a { color: #FFF; cursor: pointer; } .view-blog-categories ul li a { color: #83939C; line-height: 40px; padding-left: 15px; } #dexp_tab_item_comment h3 { display: none; } #dexp_tab_item_comment ul { list-style: none; } #dexp_tab_item_comment ul li { list-style-type: none; margin: 0; } #dexp_tab_item_comment ul li a { color: #83939C; font-size: 14px !important; font-weight: 600; } #dexp_tab_item_comment ul li span { color: #21C2F8; display: block; font-family: 'Droid Serif', Georgia, "Times New Roman", serif !important; font-size: 11px; font-style: italic; text-transform: none; } .media-vimeo-video, .media-youtube-video { position: relative; padding-bottom: 56.25%; padding-top: 30px; height: 0; overflow: hidden; } .media-vimeo-video iframe, .media-vimeo-video object, .media-vimeo-video embed, .media-youtube-video iframe, .media-youtube-video object, .media-youtube-video embed { height: 100%; left: 0; position: absolute; top: 0; width: 100%; } .media_element video { position: relative; overflow: hidden; width: 100%; background: #000; height: auto; } a { -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; -ms-transition: all 0.2s linear; transition: all 0.2s linear; outline: none !important; } .img-thumbnail { width: 100%; } .title1 h1 { font-size: 20px; } .fa-2x { font-size: 25px; } .region-right-sidebar h2, .region-left-sidebar h2 { font-size: 18px; } .title h1 { margin-top: 0 !important; font-size: 30px; } .spec-title h1 { border-style: none; border-width: 0; color: #FFFFFF; font-family: 'Pacifico', cursive; font-size: 36px; font-weight: 400; line-height: 36px; padding: 10px; text-decoration: none; } .spec-title h1 span { color: #21C2F8; } .region-parallax h1, .region-parallax h2, .region-parallax h3 { color: #fff; } .servicelistbox { margin-top: 40px; } .panel-default { background: none repeat scroll 0 0 rgba(0,0,0,0); border: 0 solid #FFFFFF !important; box-shadow: 0 0 #FFFFFF; } .panel-default .panel-heading { background-color: #FFFFFF; border: 1px solid #A9A9A9; border-radius: 3px; padding: 16px; } .panel-default .panel-heading:hover { border-color: #21C2F8; } .panel-default .panel-heading:hover .panel-title:after { color: #21C2F8; } .panel-default .panel-heading .panel-title:after { color: #292723; content: ""; display: block; float: right; font-family: 'FontAwesome'; font-size: 13px; line-height: 20px; margin-top: -20px; pointer-events: none; position: relative; text-transform: none; } .panel-default .panel-heading i { padding-right: 5px; } .panel-default .panel-heading a { color: #292723; font-size: 18px; display: block; position: relative; width: 100%; text-decoration: none; outline: none; } .panel-default .panel-heading a:hover { color: #21C2F8; } .btn { padding: 6px 20px; border-radius: 0; } .btn-primary, .btn-link, .form-submit { background-color: #21C2F8; border-color: #21C2F8; color: #fff; } .btn-primary:hover, .btn-primary:focus, .btn-primary:active, .btn-link:hover, .btn-link:focus, .btn-link:active, .form-submit:hover, .form-submit:focus, .form-submit:active { background-color: #3ac9f9; color: #fff !important; text-decoration: none; border-color: #21C2F8 !important; } .btn-default { background: linear-gradient(to bottom,#FFFFFF 0%,#E6E6E6 100%) repeat-x scroll 0 0 #FFFFFF; border: 1px solid #CCCCCC; color: #656565; text-shadow: 0 1px 1px rgba(255,255,255,0.75); } .btn-default:hover, .btn-default:focus, .btn-default:active, .btn-default.active, .btn-default.disabled, .btn-default[disabled] { background-color: #e6e6e6; background-position: 0 -15px; } .btn-darkblue { background: linear-gradient(to bottom,#34495E 0%,#2C3E50 100%) repeat-x scroll 0 0 #34495E; border-color: #2C3E50; color: #FFFFFF; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); } .btn-darkblue:hover, .btn-darkblue:focus, .btn-darkblue:active, .btn-darkblue.active, .btn-darkblue.disabled, .btn-darkblue[disabled] { background-color: #2C3E50; color: #FFFFFF; background-position: 0 -15px; } .btn-purple { background: linear-gradient(to bottom,#9B59B6 0%,#772599 100%) repeat-x scroll 0 0 #9B59B6; border-color: #772599; color: #FFFFFF; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); } .btn-purple:hover, .btn-purple:focus, .btn-purple:active, .btn-purple.active, .btn-purple.disabled, .btn-purple[disabled] { background-color: #772599; color: #FFFFFF; background-position: 0 -15px; } .btn-pink { background: linear-gradient(to bottom,#FA66C4 0%,#E81C9D 100%) repeat-x scroll 0 0 #FA66C4; border-color: #E81C9D; color: #FFFFFF; text-shadow: 0 -1px 0 rgba(0,0,0,0.25); } .btn-pink:hover, .btn-pink:focus, .btn-pink:active, .btn-pink.active, .btn-pink.disabled, .btn-pink[disabled] { background-color: #E81C9D; color: #FFFFFF; background-position: 0 -15px; } .btn-lg { border-radius: 0; font-size: 16px; line-height: 1.33; padding: 10px 30px; } .btn-sm, .btn-xs { border-radius: 0; font-size: 11px; line-height: 1.5; padding: 3px 10px; } .btn-xs { padding: 1px 5px; } .btn-pill { border-radius: 50%; } .btn-rounded { border-radius: 100px; } .btn-round { border-radius: 4px; } .node-type-forum .af-button-large, .node-type-forum #sort-topic-submit, .node-type-forum #edit-preview, .node-type-forum #edit-submit, .node-type-forum .af-button-small, #comment-form .af-button-large, #comment-form #sort-topic-submit, #comment-form #edit-preview, #comment-form #edit-submit, #comment-form .af-button-small, .page-forum .af-button-large, .page-forum #sort-topic-submit, .page-forum #edit-preview, .page-forum #edit-submit, .page-forum .af-button-small, #forum-node-form .af-button-large, #forum-node-form #sort-topic-submit, #forum-node-form #edit-preview, #forum-node-form #edit-submit, #forum-node-form .af-button-small { -moz-user-select: none; background-image: none; border: 1px solid rgba(0,0,0,0); border-radius: 0px; cursor: pointer; display: inline-block; font-size: 14px; font-weight: normal; line-height: 1.42857; margin-bottom: 0; padding: 6px 12px; text-align: center; vertical-align: middle; background: linear-gradient(to bottom,#FFFFFF 0%,#E6E6E6 100%) repeat-x scroll 0 0 #FFFFFF; border: 1px solid #CCCCCC; color: #656565; text-shadow: 0 1px 1px rgba(255,255,255,0.75); white-space: nowrap; box-shadow: 0; box-shadow: none; } .node-type-forum .af-button-large:hover, .node-type-forum .af-button-large:focus, .node-type-forum .af-button-large:active, .node-type-forum #sort-topic-submit:hover, .node-type-forum #sort-topic-submit:focus, .node-type-forum #sort-topic-submit:active, .node-type-forum #edit-preview:hover, .node-type-forum #edit-preview:focus, .node-type-forum #edit-preview:active, .node-type-forum #edit-submit:hover, .node-type-forum #edit-submit:focus, .node-type-forum #edit-submit:active, .node-type-forum .af-button-small:hover, .node-type-forum .af-button-small:focus, .node-type-forum .af-button-small:active, #comment-form .af-button-large:hover, #comment-form .af-button-large:focus, #comment-form .af-button-large:active, #comment-form #sort-topic-submit:hover, #comment-form #sort-topic-submit:focus, #comment-form #sort-topic-submit:active, #comment-form #edit-preview:hover, #comment-form #edit-preview:focus, #comment-form #edit-preview:active, #comment-form #edit-submit:hover, #comment-form #edit-submit:focus, #comment-form #edit-submit:active, #comment-form .af-button-small:hover, #comment-form .af-button-small:focus, #comment-form .af-button-small:active, .page-forum .af-button-large:hover, .page-forum .af-button-large:focus, .page-forum .af-button-large:active, .page-forum #sort-topic-submit:hover, .page-forum #sort-topic-submit:focus, .page-forum #sort-topic-submit:active, .page-forum #edit-preview:hover, .page-forum #edit-preview:focus, .page-forum #edit-preview:active, .page-forum #edit-submit:hover, .page-forum #edit-submit:focus, .page-forum #edit-submit:active, .page-forum .af-button-small:hover, .page-forum .af-button-small:focus, .page-forum .af-button-small:active, #forum-node-form .af-button-large:hover, #forum-node-form .af-button-large:focus, #forum-node-form .af-button-large:active, #forum-node-form #sort-topic-submit:hover, #forum-node-form #sort-topic-submit:focus, #forum-node-form #sort-topic-submit:active, #forum-node-form #edit-preview:hover, #forum-node-form #edit-preview:focus, #forum-node-form #edit-preview:active, #forum-node-form #edit-submit:hover, #forum-node-form #edit-submit:focus, #forum-node-form #edit-submit:active, #forum-node-form .af-button-small:hover, #forum-node-form .af-button-small:focus, #forum-node-form .af-button-small:active { background: #e6e6e6 !important; background-position: 0 -15px !important; border: 1px solid #CCCCCC !important; color: #656565 !important; text-shadow: 0 1px 1px rgba(255,255,255,0.75); } .node-type-forum #sort-topic-submit, #comment-form #sort-topic-submit, .page-forum #sort-topic-submit, #forum-node-form #sort-topic-submit { font-size: 12px; height: 30px !important; margin-top: -3px !important; } .node-type-forum .form-text, .node-type-forum .form-select, #comment-form .form-text, #comment-form .form-select, .page-forum .form-text, .page-forum .form-select, #forum-node-form .form-text, #forum-node-form .form-select { padding: 5px; } div.button { display: inline-block; } .dexp_tab_wrapper .nav-tabs > li > a:hover, .product-details-wrap .nav-tabs > li > a:hover, .tabs .nav-tabs > li > a:hover { background-color: #21C2F8; border-color: #FFF; color: #FFF !important; } .dexp_tab_wrapper .tab-content, .product-details-wrap .tab-content, .tabs .tab-content { border-bottom: 1px solid #EFEFEF; border-left: 1px solid #EFEFEF; border-right: 1px solid #EFEFEF; padding: 20px; } .dexp_tab_wrapper .nav-tabs li a, .product-details-wrap .nav-tabs li a, .tabs .nav-tabs li a { border-top: 1px solid #EFEFEF; border-right: 1px solid #EFEFEF; border-left: none; border-radius: 0; margin: 0; color: #83939C; } .dexp_tab_wrapper .nav-tabs li.first, .product-details-wrap .nav-tabs li.first, .tabs .nav-tabs li.first { border-left: 1px solid #EFEFEF; } .dexp_tab_wrapper .nav-tabs li.active a, .product-details-wrap .nav-tabs li.active a, .tabs .nav-tabs li.active a { color: #656565; } .dexp_tab_wrapper .nav-tabs li:first-child, .product-details-wrap .nav-tabs li:first-child, .tabs .nav-tabs li:first-child { border-left: solid 1px #EEE; } .dexp_tab_wrapper.vertical, .product-details-wrap.vertical, .tabs.vertical { border: 1px solid #DDDDDD; padding-bottom: 1px; background: url("../images/fc.png") repeat-y scroll 0 0 rgba(0,0,0,0); } .dexp_tab_wrapper.vertical .nav-tabs, .product-details-wrap.vertical .nav-tabs, .tabs.vertical .nav-tabs { border-bottom: none; float: left; font-size: 1em; line-height: 1; margin: 0 -100% -1px 0; padding: 0; width: 240px; } .dexp_tab_wrapper.vertical .nav-tabs li, .product-details-wrap.vertical .nav-tabs li, .tabs.vertical .nav-tabs li { float: none; } .dexp_tab_wrapper.vertical .nav-tabs li a, .product-details-wrap.vertical .nav-tabs li a, .tabs.vertical .nav-tabs li a { border: solid 1px #DDD; border-left: none; border-radius: 0; color: #83939C; } .dexp_tab_wrapper.vertical .nav-tabs li.first a, .product-details-wrap.vertical .nav-tabs li.first a, .tabs.vertical .nav-tabs li.first a { border-top: none; } .dexp_tab_wrapper.vertical .nav-tabs li.active a, .product-details-wrap.vertical .nav-tabs li.active a, .tabs.vertical .nav-tabs li.active a { color: #656565; } .dexp_tab_wrapper.vertical .nav-tabs li.active a, .product-details-wrap.vertical .nav-tabs li.active a, .tabs.vertical .nav-tabs li.active a { border-left: none !important; border-right: none !important; border-bottom: none !important; border-top: solid 1px #DDD; } .dexp_tab_wrapper.vertical .nav-tabs li.first.active a, .product-details-wrap.vertical .nav-tabs li.first.active a, .tabs.vertical .nav-tabs li.first.active a { border-top: none !important; } .dexp_tab_wrapper.vertical .nav-tabs li.last.active a, .product-details-wrap.vertical .nav-tabs li.last.active a, .tabs.vertical .nav-tabs li.last.active a { border-bottom: solid 1px #DDD !important; } .dexp_tab_wrapper.vertical .tab-content, .product-details-wrap.vertical .tab-content, .tabs.vertical .tab-content { background-color: #FFFFFF; border: medium none; margin: 0 0 0 240px; padding: 10px 15px 10px 20px; } .skill-bar span.background { background-color: #21C2F8 !important; border-radius: 0; display: block; height: 5px; position: relative; transition: width 1.8s linear 0s; width: 0; } .skill-bar .progress { background-color: #DFE5E9; height: 5px !important; } .dexp-shortcodes-box .box-icon { text-align: center; -webkit-transform: rotate(0deg) scale(1) skew(0) translate(0); -moz-transform: rotate(0deg) scale(1) skew(0) translate(0); -o-transform: rotate(0deg) scale(1) skew(0) translate(0); -ms-transform: rotate(0deg) scale(1) skew(0) translate(0); transform: rotate(0deg) scale(1) skew(0) translate(0); -webkit-transition: all .3s ease-out; -moz-transition: all .3s ease-out; -o-transition: all .3s ease-out; -ms-transition: all .3s ease-out; transition: all .3s ease-out; } .dexp-shortcodes-box .box-title { font-size: 20px !important; margin: 15px 0; } .dexp-shortcodes-box.box-background .box-icon { background-color: #21C2F8; color: #fff; border: 1px #21C2F8 solid !important; } .dexp-shortcodes-box.box-background .box-icon i { color: #FFF; } .dexp-shortcodes-box.box-background:hover i { color: #21C2F8; } .dexp-shortcodes-box:not(.box-background) .box-icon { color: #21C2F8; } .dexp-shortcodes-box.box-left .box-icon, .dexp-shortcodes-box.box-right .box-icon, .dexp-shortcodes-box.box-top .box-icon { width: 65px; height: 65px; line-height: 65px; font-size: 18px; position: relative; margin: 3px 15px 15px 0; } .dexp-shortcodes-box.box-left .box-icon span, .dexp-shortcodes-box.box-right .box-icon span, .dexp-shortcodes-box.box-top .box-icon span { position: absolute; left: 0; width: 100%; text-align: center; top: -49px; -webkit-transition: top 0.3s linear; -moz-transition: top 0.3s linear; -o-transition: top 0.3s linear; -ms-transition: top 0.3s linear; transition: top 0.3s linear; } .dexp-shortcodes-box.box-left.box-none .box-icon, .dexp-shortcodes-box.box-right.box-none .box-icon, .dexp-shortcodes-box.box-top.box-none .box-icon { font-size: 30px; } .dexp-shortcodes-box.box-left.box-none .box-icon span, .dexp-shortcodes-box.box-right.box-none .box-icon span, .dexp-shortcodes-box.box-top.box-none .box-icon span { top: -53px; } .dexp-shortcodes-box.box-left h3.box-title, .dexp-shortcodes-box.box-right h3.box-title, .dexp-shortcodes-box.box-top h3.box-title { font-size: 18px !important; font-weight: 300; } .dexp-shortcodes-box.box-left .box-content, .dexp-shortcodes-box.box-right .box-content, .dexp-shortcodes-box.box-top .box-content { font-size: 14px; } .dexp-shortcodes-box.box-left:not(.box-none):hover .box-icon span, .dexp-shortcodes-box.box-right:not(.box-none):hover .box-icon span, .dexp-shortcodes-box.box-top:not(.box-none):hover .box-icon span { top: 0px; } .dexp-shortcodes-box.box-left.box-background:hover .box-icon, .dexp-shortcodes-box.box-right.box-background:hover .box-icon, .dexp-shortcodes-box.box-top.box-background:hover .box-icon { background: #FFF; color: #21C2F8; } .dexp-shortcodes-box.box-left.box-background:hover .box-icon span, .dexp-shortcodes-box.box-right.box-background:hover .box-icon span, .dexp-shortcodes-box.box-top.box-background:hover .box-icon span { top: 0px; } .dexp-shortcodes-box.box-top .box-icon { width: 54px; height: 54px; font-size: 15px; line-height: 54px; margin: 3px 15px 10px 0; float: left; background-color: transparent !important; } .dexp-shortcodes-box.box-top .box-icon:hover { background-color: #21C2F8 !important; color: #fff; border-color: #21C2F8; } .dexp-shortcodes-box.box-top h3 { padding-top: 20px; padding-bottom: 15px; text-align: left; } .dexp-shortcodes-box.box-left .box-icon { float: left; margin: 3px 15px 15px 0px; } .dexp-shortcodes-box.box-left .box-title, .dexp-shortcodes-box.box-left .box-content { margin-left: 80px; text-align: left; } .dexp-shortcodes-box.box-right .box-icon { float: right; margin: 3px 0px 15px 15px; } .dexp-shortcodes-box.box-right .box-title, .dexp-shortcodes-box.box-right .box-content { margin-right: 80px; text-align: right; } .dexp-shortcodes-box.box-circle:not(.parallax) .box-icon { -webkit-border-radius: 50% 50% 50% 50%; -moz-border-radius: 50% 50% 50% 50%; border-radius: 50% 50% 50% 50%; border: 1px #21C2F8 solid; background-color: #F6F6F6; } .dexp-shortcodes-box.box-circle:not(.parallax) .box-icon:hover { background-color: #21C2F8; color: #fff; } .dexp-shortcodes-box.parallax .box-icon { -webkit-border-radius: 50% 50% 50% 50%; -moz-border-radius: 50% 50% 50% 50%; border-radius: 50% 50% 50% 50%; border: 1px #FFF solid; } .dexp-shortcodes-box.parallax h3.box-title { color: #fff !important; } .dexp-shortcodes-box.parallax .box-icon:hover { background-color: #21C2F8; color: #fff; } .dexp-shortcodes-box.box-square .box-icon { border-radius: 5%; border: 1px #A9A9A9 solid; } .dexp-shortcodes-box.box-center:not(.hovericon):not(.box-none) .box-icon { width: 85px; height: 85px; font-size: 20px; line-height: 85px; margin: 0 auto; border: 1px #A9A9A9 solid; background-color: #FFF; } .dexp-shortcodes-box.box-center:not(.hovericon):not(.box-none):hover .box-icon { background: #21C2F8 !important; color: #fff; border: 1px #21C2F8 solid; } .dexp-shortcodes-box.box-center:not(.hovericon):not(.box-none) h3.box-title { font-size: 24px; font-weight: 300; letter-spacing: -0.5px; } .dexp-shortcodes-box.box-center:not(.hovericon) .box-title { text-align: center; margin: 30px 30px 0; } .dexp-shortcodes-box.box-center:not(.hovericon) .box-content { text-align: center; margin: 10px 0px; } .dexp-shortcodes-box.box-center:not(.hovericon).box-none .box-icon { font-size: 95px; height: 102px; } .dexp-shortcodes-box.box-center:not(.hovericon).box-none h3.box-title { font-size: 20px; font-weight: 600; letter-spacing: -0.5px; } .dexp-shortcodes-box.box-custom { border: 1px solid #A9A9A9; margin: 57px 0 30px; padding: 50px 20px 10px; text-align: center; -webkit-transition: border-color 0.4s linear; -moz-transition: border-color 0.4s linear; -o-transition: border-color 0.4s linear; -ms-transition: border-color 0.4s linear; transition: border-color 0.4s linear; } .dexp-shortcodes-box.box-custom .icn-main-container { left: 0; position: absolute; right: 0; top: 25px; } .dexp-shortcodes-box.box-custom .effect-slide-bottom { opacity: 0; -webkit-transform: rotate(0px) scale(30%) skew(0px) translate(10px); -moz-transform: rotate(0px) scale(30%) skew(0px) translate(10px); -o-transform: rotate(0px) scale(30%) skew(0px) translate(10px); -ms-transform: rotate(0px) scale(30%) skew(0px) translate(10px); transform: rotate(0px) scale(30%) skew(0px) translate(10px); } .dexp-shortcodes-box.box-custom .effect-slide-bottom.in { opacity: 1; -webkit-transform: rotate(0px) scale(0px) skew(0px) translate(10px); -moz-transform: rotate(0px) scale(0px) skew(0px) translate(10px); -o-transform: rotate(0px) scale(0px) skew(0px) translate(10px); -ms-transform: rotate(0px) scale(0px) skew(0px) translate(10px); transform: rotate(0px) scale(0px) skew(0px) translate(10px); } .dexp-shortcodes-box.box-custom .title h3 { font-size: 15px !important; text-transform: uppercase; font-weight: normal; margin-top: 0; } .dexp-shortcodes-box.box-custom .serviceicon { background: none repeat scroll 0 0 #FFFFFF; -webkit-transition: 0.3s linear linear; -moz-transition: 0.3s linear linear; -o-transition: 0.3s linear linear; -ms-transition: 0.3s linear linear; transition: 0.3s linear linear; border: 1px solid #A9A9A9; color: #292723; font-size: 21px; height: 65px; line-height: 65px; margin: 0 auto; position: relative; text-align: center; width: 65px; z-index: 5; } .dexp-shortcodes-box.box-custom .serviceicon i { color: #21C2F8; } .dexp-shortcodes-box.box-custom:hover { border-color: #21C2F8; } .dexp-shortcodes-box.box-custom:hover .serviceicon { border-color: #21C2F8; background-color: #21C2F8 !important; -webkit-transition: 0.3s linear linear; -moz-transition: 0.3s linear linear; -o-transition: 0.3s linear linear; -ms-transition: 0.3s linear linear; transition: 0.3s linear linear; } .dexp-shortcodes-box.box-custom:hover .serviceicon i { color: #FFF; } .dexp-shortcodes-box.box-custom.text-center { text-align: center; } .dexp-shortcodes-box.box-custom.box-diamond .serviceicon { transform: rotate(-45deg); } .dexp-shortcodes-box.box-custom.box-diamond .serviceicon i { transform: rotate(45deg); } .dexp-shortcodes-box.box-custom.box-circle .serviceicon { border-radius: 50%; } .dexp-shortcodes-box.box-custom.box-square .serviceicon { border-radius: 5px; } .hovericon h3.box-title { font-size: 24px; font-weight: 300; letter-spacing: -0.5px; } .hovericon .box-title { text-align: center; margin: 10px 10px 0; } .hovericon .box-icon { border: none !important; background-color: transparent !important; } .hovericon i { border-radius: 50%; color: #FFFFFF; cursor: pointer; display: inline-block; height: 75px; line-height: 75px; margin: 15px 0; position: relative; text-align: center; text-decoration: none; width: 75px; z-index: 1; } .hovericon i:after { border-radius: 50%; box-sizing: content-box; content: ""; height: 100%; pointer-events: none; position: absolute; width: 100%; } .hovericon i:before { display: block; font-style: normal; font-variant: normal; font-weight: normal; line-height: 80px; text-transform: none; } .hovericon i.effect-1 { -webkit-transition: background v0 .2s ease; -moz-transition: background v0 .2s ease; -o-transition: background v0 .2s ease; -ms-transition: background v0 .2s ease; transition: background v0 .2s ease; } .hovericon i.effect-1:after { box-shadow: 0 0 0 4px #21C2F8; left: -7px; opacity: 0; padding: 7px; top: -7px; transform: scale(0.8); transition: transform 0.2s ease 0s, opacity 0.2s ease 0s; } .hovericon i.effect-1.sub-a:hover:after { opacity: 1; transform: scale(1); } .hovericon i.effect-1.sub-a:hover, .hovericon i.effect-1.sub-a:hover i, .hovericon i.effect-1, .hovericon i.effect-1.sub-a:hover { background-color: #21C2F8; } .hovericon h3.box-title { font-size: 15px !important; } .box-hexagon:hover i { color: #fff !important; } .box-hexagon strong { font-weight: normal; color: #000; } .box-hexagon .box-icon { color: #FFFFFF !important; height: 50px !important; line-height: 55px !important; margin: 35px auto !important; position: relative !important; width: 90px !important; background-color: #21C2F8 !important; } .box-hexagon .box-icon i:hover { color: #fff; } .box-hexagon .box-icon:before { border-bottom-color: #21C2F8 !important; border-bottom: 24px solid #21C2F8; border-left: 45px solid rgba(0,0,0,0); border-right: 45px solid rgba(0,0,0,0); content: ""; height: 0; left: 0; position: absolute; top: -25px; width: 0; } .box-hexagon .box-icon:after { border-left: 45px solid rgba(0,0,0,0); border-right: 45px solid rgba(0,0,0,0); border-top: 24px solid #21C2F8; bottom: -25px; content: ""; height: 0; left: 0; position: absolute; width: 0; } .pricing_details .pricing-box { border: 1px solid #A9A9A9; margin: 40px 0; padding: 20px; text-align: center; -webkit-transition: background-color 0.4s linear; -moz-transition: background-color 0.4s linear; -o-transition: background-color 0.4s linear; -ms-transition: background-color 0.4s linear; transition: background-color 0.4s linear; } .pricing_details .pricing-box h3 { font-size: 20px; } .pricing_details .pricing-box hr { border-color: #DEE5E8; border-style: dotted; margin: 20px -20px; } .pricing_details .pricing-box .price { border-radius: 500px; color: #FFFFFF; font-size: 24px; font-weight: 400; height: 130px !important; line-height: 130px !important; margin: 0 auto !important; text-align: center; width: 130px !important; background-color: #21C2F8; } .pricing_details .pricing-box .pricing { list-style: none outside none; margin: 0 !important; padding: 0; } .pricing_details .pricing-box .pricing li { font-size: 13px; line-height: 31px; margin: 0 auto; padding: 0; text-align: center; } .pricing_details .pricing-box .jtbtn { -moz-user-select: none; background: none repeat scroll 0 0 rgba(0,0,0,0); border: 1px solid #292723; color: #292723 !important; cursor: pointer; display: inline-block; font-size: 13px; font-weight: normal; line-height: 1.42857; margin-bottom: 0; padding: 6px 23px; text-align: center; vertical-align: middle; white-space: nowrap; } .pricing_details .pricing-box:hover { background-color: #21C2F8; -webkit-transition: 0.4s linear linear; -moz-transition: 0.4s linear linear; -o-transition: 0.4s linear linear; -ms-transition: 0.4s linear linear; transition: 0.4s linear linear; } .pricing_details .pricing-box:hover h3 { color: #FFF; } .pricing_details .pricing-box:hover .price { background-color: #FFF; color: #21C2F8; } .pricing_details .pricing-box:hover li { color: #FFF; } .pricing_details .pricing-box:hover .jtbtn { background-color: #FFF; border-color: #FFF; } .rating-block { border: 1px solid #D3D3D3; padding: 20px 20px 0; background-color: #FFF; -webkit-transition: background-color 0.4s linear; -moz-transition: background-color 0.4s linear; -o-transition: background-color 0.4s linear; -ms-transition: background-color 0.4s linear; transition: background-color 0.4s linear; } .rating-block .client-image { margin: 3px 20px 20px 0; width: 80px; border-radius: 50%; float: left; margin: 0 15px 15px 0; -webkit-transition: opacity 0.2s ease-in-out; -moz-transition: opacity 0.2s ease-in-out; -o-transition: opacity 0.2s ease-in-out; -ms-transition: opacity 0.2s ease-in-out; transition: opacity 0.2s ease-in-out; } .rating-block .client-image:hover { opacity: 0.7; } .rating-block .rating br { display: none; } .rating-block .pull-left span, .rating-block .pull-right i { color: #21C2F8; } .rating-block:hover { background-color: #21C2F8 !important; -webkit-transition: background-color 0.4s linear; -moz-transition: background-color 0.4s linear; -o-transition: background-color 0.4s linear; -ms-transition: background-color 0.4s linear; transition: background-color 0.4s linear; } .rating-block:hover span, .rating-block:hover p, .rating-block:hover i { color: #fff; } ol li ul, ol li ol { margin-bottom: 0; margin-left: 1.25em; } ul li ul, ul li ol { margin-bottom: 0; margin-left: 1.25em; } .featureslist li:before, .product_details li:before, .check li:before { content: ""; font-family: "FontAwesome"; font-size: 16px; left: 0; padding-right: 5px; position: relative; top: 2px; color: #21C2F8; } .featureslist li:before { content: "" !important; padding-right: 8px !important; } .featureslist li { list-style: none; list-style-image: none; } .the-icons li, .bs-glyphicons li { list-style-image: none; list-style: none; } .nav-stacked li { border-color: #EFEFEF !important; border-style: solid !important; border-width: 0 0 1px !important; } .nav-stacked > li > a { border: 0 solid #EFEFEF !important; color: #83939C; } .bs-glyphicons li { border: 1px solid #DDDDDD; float: left; font-size: 12px; height: 115px; line-height: 1.4; margin: 0 -1px -1px 0; padding: 10px; text-align: center; width: 20%; } .bs-glyphicons li:hover { background: #21C2F8; color: #FFF; } .bs-glyphicons .glyphicon { display: block; font-size: 24px; margin: 5px auto 10px; } .skills_boxes { margin: 40px 0; } .skills_boxes .chart { margin-bottom: 20px; display: block; position: relative; text-align: center; margin: 0 auto; } .skills_boxes .chart .percent { display: block; font-size: 30px; font-weight: 300; letter-spacing: -3px; line-height: 7; position: absolute; text-align: center; top: -3px; width: 100%; z-index: 10; } .skills_boxes p { text-align: center; } .skills_boxes .title { text-align: center; } .skills_boxes .title h3 { font-size: 18px; font-weight: bold; text-transform: uppercase; } .dexp-carousel img { width: 100%; } .milestone-counter .highlight { color: #21C2F8; font-family: 'NovecentowideBookBold', cursive; font-size: 72px; font-weight: bold; line-height: 1.6; } .milestone-counter .milestone-details { color: #FFFFFF; font-family: 'Nothing You Could Do', cursive; font-size: 21px; font-weight: normal; padding: 0 0 20px; } .testimonial { text-align: center; padding-top: 50px; } .testimonial .testimonials-content { color: #FFFFFF; font-size: 24px; font-style: normal; font-weight: 100; font-family: 'Droid Serif', Georgia, "Times New Roman", serif !important; line-height: 25px; } .testimonial .testimonials-content:before { content: ""; font-family: "FontAwesome"; font-size: 13px; padding: 5px 10px; color: #21C2F8; } .testimonial .testimonials-content:after { content: ""; font-family: "FontAwesome"; font-size: 13px; padding: 5px; color: #21C2F8; } .testimonial .person-says { padding: 30px 0 50px 0; } .testimonial .person-says strong { border-style: none; border-width: 0; color: #FFFFFF; font-family: 'Pacifico', cursive; font-size: 38px; font-weight: 400; line-height: 1.6; padding: 0; text-decoration: none; } .testimonial .person-says .text-small { font-size: 18px; padding: 15px 0; color: #21C2F8; padding-left: 10px; } .testimonial .carousel-indicators li { background: none repeat scroll 0 0 #FFFFFF; border: 1px solid #212121; border-radius: 0; display: block; height: 4px; margin: 5px 6px; width: 25px; display: inline-block; } .bx-pager { margin-top: 40px !important; text-align: center !important; } .bx-pager .bx-pager-item { display: inline-block !important; } .bx-pager .bx-pager-item a { background: none repeat scroll 0 0 #FFFFFF !important; border: 1px solid #212121 !important; border-radius: 0 !important; display: block !important; height: 4px !important; margin: 5px 6px !important; width: 25px !important; display: inline-block !important; outline: 0 none !important; text-indent: -9999px !important; } .bx-pager .bx-pager-item a.active { background-color: #21C2F8 !important; border-color: #21C2F8 !important; } .bx-wrapper .bx-pager { bottom: -50px !important; } .region-search { position: relative; -webkit-transition: height 0.3s linear; -moz-transition: height 0.3s linear; -o-transition: height 0.3s linear; -ms-transition: height 0.3s linear; transition: height 0.3s linear; } .region-search #block-search-form { position: absolute; top: 50%; margin-top: -13px; right: 15px; z-index: 99; } .region-search #block-search-form input[name=search_block_form] { padding: 0 10px; position: relative; -webkit-transition: width 0.3s linear; -moz-transition: width 0.3s linear; -o-transition: width 0.3s linear; -ms-transition: width 0.3s linear; transition: width 0.3s linear; opacity: 0; width: 40px; border: none; height: 27px; line-height: 27px; } .region-search #block-search-form input[name=search_block_form]:focus { width: 200px; border: 1px solid #F2F2F2; opacity: 1; } .region-search #block-search-form:after { font-family: 'FontAwesome'; content: "\f002"; position: absolute; top: 0; right: 10px; line-height: 27px; } @media screen and (min-width: 992px) { #section-header { border-bottom: 1px solid #F2F2F2; background: #fff; } #section-header .menu-toggler { display: none; } #section-header a.site-logo { line-height: 108px; -webkit-transition: line-height 0.3s linear; -moz-transition: line-height 0.3s linear; -o-transition: line-height 0.3s linear; -ms-transition: line-height 0.3s linear; transition: line-height 0.3s linear; } #section-header .dexp-menu { float: right; } #section-header .dexp-menu ul li { padding: 0; margin: 0; } #section-header .dexp-menu ul li a, #section-header .dexp-menu ul li span.nolink { color: #292723; padding: 0 15px; font-size: 13px; } #section-header .dexp-menu ul li a:hover, #section-header .dexp-menu ul li a.active, #section-header .dexp-menu ul li span.nolink:hover, #section-header .dexp-menu ul li span.nolink.active { color: #21C2F8; } #section-header .dexp-menu ul ul { background: #fff; border: 1px solid #F2F2F2; } #section-header .dexp-menu ul ul li { width: 200px; border-bottom: 1px solid #F2F2F2; } #section-header .dexp-menu ul ul li a, #section-header .dexp-menu ul ul li span.nolink { line-height: 36px; display: block; } #section-header .dexp-menu ul ul li.last { border-bottom: none; } #section-header .dexp-menu ul ul li.expanded:after { border-color: rgba(0,0,0,0) rgba(0,0,0,0) rgba(0,0,0,0) #656565; border-style: solid; border-width: 5px 0 5px 5px; content: " "; display: block; float: right; height: 0; margin-right: -10px; margin-top: 5px; width: 0; position: absolute; right: 15px; top: 8px; } #section-header .dexp-menu ul ul.w2 { width: 406px; } #section-header .dexp-menu ul ul.w3 { width: 610px; } #section-header .dexp-menu ul ul ul { top: -1px; } #section-header .dexp-menu >ul>li>a, #section-header .dexp-menu >ul>li>span.nolink { line-height: 108px; font-size: 13px; font-weight: 400; -webkit-transition: line-height 0.3s linear; -moz-transition: line-height 0.3s linear; -o-transition: line-height 0.3s linear; -ms-transition: line-height 0.3s linear; transition: line-height 0.3s linear; padding: 8px 15px; position: relative; } #section-header .dexp-menu >ul>li>a:before, #section-header .dexp-menu >ul>li>span.nolink:before { -webkit-transition: width 0.3s linear; -moz-transition: width 0.3s linear; -o-transition: width 0.3s linear; -ms-transition: width 0.3s linear; transition: width 0.3s linear; height: 2px; width: 0; background-color: #21C2F8; position: absolute; top: -2px; left: 0; content: ""; } #section-header .dexp-menu >ul>li>a:hover, #section-header .dexp-menu >ul>li>a.active, #section-header .dexp-menu >ul>li>span.nolink:hover, #section-header .dexp-menu >ul>li>span.nolink.active { border-top: 2px solid #E6E6E6; } #section-header .dexp-menu >ul>li>a:hover:before, #section-header .dexp-menu >ul>li>a.active:before, #section-header .dexp-menu >ul>li>span.nolink:hover:before, #section-header .dexp-menu >ul>li>span.nolink.active:before { width: 100%; } #section-header.fixed-transition a.site-logo { line-height: 80px; } #section-header.fixed-transition .dexp-menu >ul>li>a, #section-header.fixed-transition .dexp-menu >ul>li>span.nolink { line-height: 80px; } #section-header.fixed-transition .region-search { height: 80px; } #section-header .region-search { height: 108px; } } @media screen and (max-width: 991px) { #section-header { box-shadow: 0 2px 4px -3px gray; } #section-header a.site-logo { line-height: 60px; } #section-header .region-search { height: 60px; } #section-header .dexp-dropdown { top: 4px; box-shadow: 0 2px 4px -3px gray; z-index: 999; } #section-header .dexp-dropdown ul li { list-style: none; padding: 0; } .dexp-menu-toggler { line-height: 60px; position: absolute; right: 60px; padding: 0; top: -60px; } .dexp-menu-toggler i.fa { border: 1px solid #F5F5F5; color: #999999; font-size: 21px; line-height: 35px; width: 40px; } body[class*=preset-dark] .dexp-dropdown { background: #292929; } } .dexp-portfolio-filter, .dexp-masonry-filter { margin: 0; padding: 0; text-align: center; } .dexp-portfolio-filter li, .dexp-masonry-filter li { display: inline-block; } .dexp-portfolio-filter li a span, .dexp-masonry-filter li a span { color: #D3D3D3; } .dexp-portfolio-filter li a span:before, .dexp-masonry-filter li a span:before { content: ""; width: 10px; height: 10px; border-radius: 5px; background-color: #21C2F8; display: inline-block; margin: 0 10px; } .dexp-portfolio-filter li a.active span, .dexp-masonry-filter li a.active span { color: #21C2F8; } .portfolio-filters { margin-bottom: 40px; } div[id^=portfolio-page] .node-dexp-portfolio { margin-bottom: 30px; } .view-portfolio-masonry .portfolio-item-inner { background-size: cover; background-repeat: no-repeat; background-position: center center; width: 100%; height: 100%; } .view-portfolio-masonry .portfolio-item-inner .portfolio-item-overlay { -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; -ms-transition: all 0.2s linear; transition: all 0.2s linear; opacity: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); } .portfolio-item-inner .portfolio-item-tools { position: absolute; left: 50%; top: 50%; -webkit-transform: translateX(-50%) translateY(-50%); -moz-transform: translateX(-50%) translateY(-50%); -o-transform: translateX(-50%) translateY(-50%); -ms-transform: translateX(-50%) translateY(-50%); transform: translateX(-50%) translateY(-50%); } .portfolio-item-inner .portfolio-item-tools span { display: inline-block; border: 1px solid #FFF; border-radius: 50%; width: 40px; height: 40px; text-align: center; line-height: 40px; } .portfolio-item-inner .portfolio-item-tools .view-details { color: #FFF; -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; -ms-transition: all 0.2s linear; transition: all 0.2s linear; position: absolute; top: -20px; left: -200px; opacity: 0; } .portfolio-item-inner .portfolio-item-tools .zoom { color: #FFF; -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; -ms-transition: all 0.2s linear; transition: all 0.2s linear; position: absolute; right: -200px; top: -20px; opacity: 0; } .portfolio-item-inner .title { color: #FFF; -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; -ms-transition: all 0.2s linear; transition: all 0.2s linear; position: absolute; opacity: 0; top: 150%; width: 100%; left: 0; text-align: center; transform: translateY(30px); -webkit-transform: translateY(30px); -moz-transform: translateY(30px); -o-transform: translateY(30px); -ms-transform: translateY(30px); } .portfolio-item-inner:hover .portfolio-item-overlay { opacity: 1; } .portfolio-item-inner:hover .view-details { left: -45px; opacity: 1; } .portfolio-item-inner:hover .zoom { right: -45px; opacity: 1; } .portfolio-item-inner:hover .title { top: 50%; opacity: 1; } .portfolio-item-inner { position: relative; } .portfolio-item-inner .portfolio-item-overlay { position: absolute; top: 0; left: 0; -webkit-transition: all 0.2s linear; -moz-transition: all 0.2s linear; -o-transition: all 0.2s linear; -ms-transition: all 0.2s linear; transition: all 0.2s linear; opacity: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.7); } body.node-type-dexp-portfolio .node-dexp-portfolio .field-name-body { border-bottom: 1px solid #2F2F2F; padding-bottom: 20px; margin-bottom: 20px; } body.node-type-dexp-portfolio .node-dexp-portfolio .field-name-field-portfolio-url { border-top: 1px solid #2F2F2F; padding-top: 20px; margin-top: 20px; } body.node-type-dexp-portfolio h3.portfolio-detail { border-bottom: 1px solid #AAA; position: relative; line-height: 35px; margin: 0 0 15px; } body.node-type-dexp-portfolio h3.portfolio-detail:after { width: 20%; height: 1px; position: absolute; bottom: -1px; background: #21C2F8; content: ""; left: 0; } h3.portfolio-title { margin: 0 0 10px; border-bottom: 1px solid #F2F2F2; font-weight: 400; line-height: 35px; position: relative; } h3.portfolio-title a { color: #292723; } h3.portfolio-title:after { position: absolute; left: 0; bottom: -1px; width: 25%; height: 1px; background: #21C2F8; content: ""; } .field-name-field-portfolio-categories a { color: #D3D3D3; } .float-left { float: left; margin-right: 10px; } .ImageWrapper { display: block; overflow: hidden; position: relative; } .WhiteRounded { border: medium none; display: inline-block !important; loat: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 250px 250px 250px; border-radius: 250px 250px 250px; -webkit-box-shadow: 0 0 1px #ffffff, inset 0 0 2px rgba(255,255,255,0.1); box-shadow: 0 0 1px #ffffff, inset 0 0 2px rgba(255,255,255,0.1); border: 1px solid #ffffff; } .ImageWrapper .ImageOverlayH.orange { background: rgba(255,108,19,0.8); } .ImageWrapper .ImageOverlayH.blue { background: rgba(33,194,248,0.8); } .ImageWrapper .ImageOverlayH.purple { background: rgba(87,77,229,0.8); } .ImageWrapper .ImageOverlayH.yellow { background: rgba(226,228,31,0.8); } .ImageWrapper .StyleBe { color: #ffffff; visibility: hidden; opacity: 0; position: absolute; text-align: center; right: 0; width: 100%; bottom: 25%; margin-top: 20px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleBe { margin: 0 auto; opacity: 1; visibility: visible; } .ImageWrapper .StyleBe1 { color: #ffffff; visibility: hidden; opacity: 0; position: absolute; text-align: center; right: 0; width: 100%; bottom: 43%; margin-top: 20px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleBe1 { margin: 0 auto; opacity: 1; visibility: visible; } .WhiteRounded > a { color: #ffffff; display: block; font-weight: normal; } .WhiteRounded > a:hover { color: #ffffff; } .RedRounded { background-color: #D8322B; border: medium none; display: inline-block !important; float: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 250px 250px 250px; border-radius: 250px 250px 250px; -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); } .RedRounded > a { color: #FFFFFF; display: block; font-weight: normal; } .BlackRounded { background-color: #222222; border: medium none; display: inline-block !important; float: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 250px 250px 250px; border-radius: 250px 250px 250px; -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); } .BlackRounded > a { color: #ffffff; display: block; font-weight: normal; } .WhiteHollowRounded { border: 1px solid #ffffff; display: inline-block !important; float: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 50%; border-radius: 50%; } .WhiteHollowRounded > a { color: #ffffff; display: block; font-weight: normal; } .BlackHollowRounded { border: 1px solid #222222; display: inline-block !important; float: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 50%; border-radius: 50%; } .BlackHollowRounded > a { color: #222222; display: block; font-weight: normal; } .WhiteSquare { background: #ffffff; border: medium none; display: inline-block !important; float: none !important; font-size: 13px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 0; border-radius: 0; -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); } .WhiteSquare > a { color: #222222; display: block; font-weight: normal; } .BlackSquare { background-color: #222222; border: medium none; display: inline-block !important; float: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 4px 4px 4px; border-radius: 4px 4px 4px; -webkit-box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); box-shadow: 0 0 1px rgba(0,0,0,0.5), inset 0 0 2px rgba(0,0,0,0.1); } .BlackSquare > a { color: #ffffff; display: block; font-weight: normal; } .WhiteHollowSquare { border: 1px solid #ffffff; display: inline-block !important; float: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 4px 4px 4px; border-radius: 4px 4px 4px; } .WhiteHollowSquare > a { color: #ffffff; display: block; font-weight: normal; } .BlackHollowSquare { border: 1px solid #222222; display: inline-block !important; float: none !important; font-size: 14px; font-weight: normal; height: 40px; line-height: 40px; margin: 0 2px; text-align: center; width: 40px; -webkit-border-radius: 4px 4px 4px; border-radius: 4px 4px 4px; } .BlackHollowSquare > a { color: #222222; display: block; font-weight: normal; } .VisibleButtons { margin: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; } .VisibleImageOverlay { position: absolute; background: none repeat scroll 0 0 rgba(0,0,0,0.5); width: 100%; height: 100%; top: 0; left: 0; opacity: .6; visibility: visible; } .ImageWrapper .ImageOverlayH { background: none repeat scroll 0 0 rgba(0,0,0,0.5); bottom: 0; display: block; height: 100%; left: 0; opacity: 0; position: absolute; right: 0; top: 0; -webkit-transition: all 0.2s ease 0s; -moz-transition: all 0.2s ease 0s; -o-transition: all 0.2s ease 0s; transition: all 0.2s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayH { opacity: 1; } .ImageWrapper .ImageOverlayHe { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 0; display: block; left: 0; opacity: 0; position: absolute; top: 50%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayHe { height: 100%; top: 0; opacity: 1; } .ImageWrapper .ImageOverlayLi:after { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; content: ""; display: block; left: 0; opacity: 0; position: absolute; top: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayLi:after { top: -50%; opacity: 1; } .ImageWrapper .ImageOverlayLi:before { background: none repeat scroll 0 0 rgba(0,0,0,0.5); bottom: -100%; height: 100%; content: ""; display: block; left: 0; opacity: 0; position: absolute; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayLi:before { bottom: -50%; opacity: 1; } .ImageWrapper .ImageOverlayBe:after { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; content: ""; display: block; left: 0; opacity: 0; position: absolute; top: -100%; -webkit-transition: all 0.6s ease 0s; -moz-transition: all 0.6s ease 0s; -o-transition: all 0.6s ease 0s; transition: all 0.6s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayBe:after { top: 50%; opacity: 1; } .ImageWrapper .ImageOverlayBe:before { background: none repeat scroll 0 0 rgba(0,0,0,0.5); bottom: -100%; height: 100%; content: ""; display: block; left: 0; opacity: 0; position: absolute; -webkit-transition: all 0.6s ease 0s; -moz-transition: all 0.6s ease 0s; -o-transition: all 0.6s ease 0s; transition: all 0.6s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayBe:before { bottom: 50%; opacity: 1; } .ImageWrapper .ImageOverlayB { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; left: 50%; opacity: 0; position: absolute; top: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 0; } .ImageWrapper:hover .ImageOverlayB { left: 0; width: 100%; opacity: 1; } .ImageWrapper .ImageOverlayC:after { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; content: ""; display: block; right: -100%; opacity: 0; position: absolute; top: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayC:after { right: -50%; opacity: 1; } .ImageWrapper .ImageOverlayC:before { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; content: ""; display: block; left: -100%; opacity: 0; position: absolute; top: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayC:before { left: -50%; opacity: 1; } .ImageWrapper .ImageOverlayN:after { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; content: ""; display: block; right: -100%; opacity: 0; position: absolute; top: 0; -webkit-transition: all 0.6s ease 0s; -moz-transition: all 0.6s ease 0s; -o-transition: all 0.6s ease 0s; transition: all 0.6s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayN:after { right: 50%; opacity: 1; } .ImageWrapper .ImageOverlayN:before { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; content: ""; display: block; left: -100%; opacity: 0; position: absolute; top: 0; -webkit-transition: all 0.6s ease 0s; -moz-transition: all 0.6s ease 0s; -o-transition: all 0.6s ease 0s; transition: all 0.6s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayN:before { left: 50%; opacity: 1; } .ImageWrapper .ImageOverlayO { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; left: -100%; opacity: 0; position: absolute; top: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayO { left: 0; top: 0; opacity: 1; } .ImageWrapper .ImageOverlayF { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; right: -100%; opacity: 0; position: absolute; top: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayF { right: 0; top: 0; opacity: 1; } .ImageWrapper .ImageOverlayNe { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; left: -100%; opacity: 0; position: absolute; bottom: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayNe { bottom: 0; left: 0; opacity: 1; } .ImageWrapper .ImageOverlayNa { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; right: -100%; opacity: 0; position: absolute; bottom: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayNa { bottom: 0; right: 0; opacity: 1; } .ImageWrapper .ImageOverlayMg { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; left: 0; opacity: 0; position: absolute; top: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayMg { top: 0; opacity: 1; } .ImageWrapper .ImageOverlayAl { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; left: 0; opacity: 0; position: absolute; bottom: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayAl { bottom: 0; opacity: 1; } .ImageWrapper .ImageOverlaySi { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; top: 0; opacity: 0; position: absolute; right: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlaySi { right: 0; opacity: 1; } .ImageWrapper .ImageOverlayP { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; top: 0; opacity: 0; position: absolute; left: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; } .ImageWrapper:hover .ImageOverlayP { left: 0; opacity: 1; } .ImageWrapper .ImageOverlayS { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; top: 0; opacity: 0; position: absolute; left: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; -webkit-transform: rotate(180deg) scale(0); -moz-transform: rotate(180deg) scale(0); -ms-transform: rotate(180deg) scale(0); -o-transform: rotate(180deg) scale(0); transform: rotate(180deg) scale(0); } .ImageWrapper:hover .ImageOverlayS { -webkit-transform: rotate(0deg) scale(1); -moz-transform: rotate(0deg) scale(1); -ms-transform: rotate(0deg) scale(1); -o-transform: rotate(0deg) scale(1); transform: rotate(0deg) scale(1); opacity: 1; } .ImageWrapper .ImageOverlayCl { background: none repeat scroll 0 0 rgba(0,0,0,0.5); height: 100%; display: block; top: 0; opacity: 0; position: absolute; left: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; -webkit-transform: rotate(-180deg) scale(0); -moz-transform: rotate(-180deg) scale(0); -ms-transform: rotate(-180deg) scale(0); -o-transform: rotate(-180deg) scale(0); transform: rotate(-180deg) scale(0); } .ImageWrapper:hover .ImageOverlayCl { -webkit-transform: rotate(0deg) scale(1); -moz-transform: rotate(0deg) scale(1); -ms-transform: rotate(0deg) scale(1); -o-transform: rotate(0deg) scale(1); transform: rotate(0deg) scale(1); opacity: 1; } .ImageWrapper .ImageOverlayArLeft:before { background: none repeat scroll 0 0 rgba(0,0,0,0.5); opacity: 0; content: ""; display: block; position: absolute; top: -50%; -webkit-transition: all 0.2s ease 0s; -moz-transition: all 0.2s ease 0s; -o-transition: all 0.2s ease 0s; transition: all 0.2s ease 0s; width: 100%; height: 100%; left: -100%; overflow: hidden; } .ImageWrapper .ImageOverlayArLeft:after { background: none repeat scroll 0 0 rgba(0,0,0,0.5); opacity: 0; content: ""; display: block; position: absolute; top: 50%; -webkit-transition: all 0.2s ease .2s; -moz-transition: all 0.2s ease .2s; -o-transition: all 0.2s ease .2s; transition: all 0.2s ease .2s; width: 100%; height: 100%; left: -100%; overflow: hidden; } .ImageWrapper .ImageOverlayArRight:before { background: none repeat scroll 0 0 rgba(0,0,0,0.5); opacity: 0; content: ""; display: block; position: absolute; top: -50%; -webkit-transition: all 0.2s ease .3s; -moz-transition: all 0.2s ease .3s; -o-transition: all 0.2s ease .3s; transition: all 0.2s ease .3s; width: 100%; height: 100%; right: -100%; overflow: hidden; } .ImageWrapper .ImageOverlayArRight:after { background: none repeat scroll 0 0 rgba(0,0,0,0.5); opacity: 0; content: ""; display: block; position: absolute; top: 50%; -webkit-transition: all 0.2s ease .5s; -moz-transition: all 0.2s ease .5s; -o-transition: all 0.2s ease .5s; transition: all 0.2s ease .5s; width: 100%; height: 100%; right: -100%; overflow: hidden; } .ImageWrapper:hover .ImageOverlayArLeft:before, .ImageWrapper:hover .ImageOverlayArLeft:after { opacity: 1; left: 50%; } .ImageWrapper:hover .ImageOverlayArRight:before, .ImageWrapper:hover .ImageOverlayArRight:after { opacity: 1; right: 50%; } .GrayScale { -webkit-filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0.3333 0.3333 0.3333 0 0 0 0 0 1 0\'/></filter></svg>#grayscale"); filter: gray; -webkit-filter: grayscale(100%); -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=60); opacity: .6; -webkit-transition: all .4s ease-in-out; -moz-transition: all .4s ease-in-out; -o-transition: all .4s ease-in-out; transition: all .4s ease-in-out; } .GrayScale:hover { -webkit-filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); filter: url("data:image/svg+xml;utf8,<svg xmlns=\'http://www.w3.org/2000/svg\'><filter id=\'grayscale\'><feColorMatrix type=\'matrix\' values=\'1 0 0 0 0, 0 1 0 0 0, 0 0 1 0 0, 0 0 0 1 0\'/></filter></svg>#grayscale"); -webkit-filter: grayscale(0%); -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=100)"; filter: progid:DXImageTransform.Microsoft.Alpha(Opacity=100); opacity: 1; } .BackgroundS:hover img { -webkit-transform: scale(1.2); -moz-transform: scale(1.2); -ms-transform: scale(1.2); -o-transform: scale(1.2); transform: scale(1.2); } .BackgroundRR:hover img { -webkit-transform: rotate(-10deg) scale(1.4); -moz-transform: rotate(-10deg) scale(1.4); -ms-transform: rotate(-10deg) scale(1.4); -o-transform: rotate(-10deg) scale(1.4); transform: rotate(-10deg) scale(1.4); } .BackgroundR:hover img { -webkit-transform: rotate(10deg) scale(1.4); -moz-transform: rotate(10deg) scale(1.4); -ms-transform: rotate(10deg) scale(1.4); -o-transform: rotate(10deg) scale(1.4); transform: rotate(10deg) scale(1.4); } .BackgroundRS img { -webkit-transform: scale(1.2); -moz-transform: scale(1.2); -ms-transform: scale(1.2); -o-transform: scale(1.2); transform: scale(1.2); } .BackgroundRS:hover img { -webkit-transform: scale(1.0); -moz-transform: scale(1.0); -ms-transform: scale(1.0); -o-transform: scale(1.0); transform: scale(1.0); } .BackgroundF:hover img { opacity: 0; } .BackgroundFS:hover img { -webkit-transform: scale(10); -moz-transform: scale(10); -ms-transform: scale(10); -o-transform: scale(10); transform: scale(10); opacity: 0; } .BackgroundFRS:hover img { -webkit-transform: scale(0); -moz-transform: scale(0); -o-transform: scale(0); -ms-transform: scale(0); transform: scale(0); opacity: 0; } .ImageWrapper .CStyleH { margin: 0; opacity: 0; position: absolute; text-align: center; top: 0; visibility: hidden; width: 100%; -webkit-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -moz-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -o-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); } .ImageWrapper:hover .CStyleH { margin-top: -20px; opacity: 1; top: 50%; visibility: visible; } .ImageWrapper .CStyleHe { visibility: hidden; margin: 0; opacity: 0; position: absolute; text-align: center; bottom: 0; width: 100%; -webkit-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -moz-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -o-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); } .ImageWrapper:hover .CStyleHe { margin-bottom: -20px; opacity: 1; bottom: 50%; visibility: visible; } .ImageWrapper .CStyleLi { visibility: hidden; margin: 0; opacity: 0; position: absolute; text-align: right; right: 0; width: 100%; top: 50%; margin-top: -20px; -webkit-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -moz-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -o-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); } .ImageWrapper:hover .CStyleLi { margin-right: -42px; opacity: 1; right: 50%; visibility: visible; } .ImageWrapper .CStyleBe { visibility: hidden; margin: 0; opacity: 0; position: absolute; text-align: left; left: 0; width: 100%; top: 50%; margin-top: -20px; -webkit-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -moz-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -o-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); } .ImageWrapper:hover .CStyleBe { margin-left: -42px; opacity: 1; left: 50%; visibility: visible; } .ImageWrapper .CStyleB { visibility: hidden; margin: 0; opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; -webkit-transform: scale(0.2); -moz-transform: scale(0.2); -ms-transform: scale(0.2); -o-transform: scale(0.2); transform: scale(0.2); -webkit-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -moz-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); -o-transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); transition: all 400ms cubic-bezier(1.000,-0.6,0.570,-0.15); } .ImageWrapper:hover .CStyleB { opacity: 1; visibility: visible; -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); } .ImageWrapper .CStyleC span { position: absolute; } .ImageWrapper .CStyleC span:nth-of-type(1) { bottom: 30%; top: 70%; left: 0; margin: -10px 0 0 -68px; visibility: hidden; opacity: 1; -webkit-transition: all 400ms cubic-bezier(1.000,0,0.570,0) !important; -webkit-transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; -moz-transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; -o-transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; } .ImageWrapper .CStyleC span:nth-of-type(2) { bottom: 30%; top: 70%; left: 50%; right: 50%; margin: -20px 0 0 -20px; visibility: hidden; opacity: 0; -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); } .ImageWrapper .CStyleC span:nth-of-type(3) { bottom: 30%; top: 70%; right: 0; margin: -20px -68px 0 0; visibility: hidden; opacity: 0; -webkit-transition: all 400ms cubic-bezier(1.000,0,0.570,0) !important; -webkit-transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; -moz-transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; -o-transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; transition: all 400ms cubic-bezier(1.000,-0.36,0.570,-0.15) !important; } .ImageWrapper:hover .CStyleC span:nth-of-type(1) { left: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .CStyleC span:nth-of-type(2) { visibility: visible; opacity: 1; -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); } .ImageWrapper:hover .CStyleC span:nth-of-type(3) { right: 50%; visibility: visible; opacity: 1; } .ImageWrapper .StyleH { visibility: hidden; margin: 0; opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleH { opacity: 1; visibility: visible; } .ImageWrapper .StyleHe { margin: 0; opacity: 0; position: absolute; text-align: center; top: 0; visibility: hidden; width: 100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleHe { margin-top: -20px; opacity: 1; top: 50%; visibility: visible; } .ImageWrapper .StyleLi { visibility: hidden; margin: 0; opacity: 0; position: absolute; text-align: center; bottom: 0; width: 100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleLi { margin-bottom: -20px; opacity: 1; bottom: 35%; visibility: visible; } .ImageWrapper .StyleB { visibility: hidden; opacity: 0; position: absolute; text-align: left; left: 0; width: 100%; top: 50%; margin-top: -20px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleB { margin-left: -42px; opacity: 1; left: 50%; visibility: visible; } .ImageWrapper .StyleC { visibility: hidden; opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; -webkit-transform: scale(0.2); -moz-transform: scale(0.2); -ms-transform: scale(0.2); -o-transform: scale(0.2); transform: scale(0.2); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleC { opacity: 1; visibility: visible; -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); } .ImageWrapper .StyleN { visibility: hidden; opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; visibility: visible; -webkit-transform: rotate(0deg); -moz-transform: rotate(0deg); -ms-transform: rotate(0deg); -o-transform: rotate(0deg); transform: rotate(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleN { opacity: 1; visibility: visible; -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); -ms-transform: rotate(360deg); -o-transform: rotate(360deg); transform: rotate(360deg); } .ImageWrapper .StyleO span { position: absolute; } .ImageWrapper .StyleO span:nth-of-type(1) { bottom: 50%; top: 50%; left: 50%; margin: -20px 0 0 -42px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleO span:nth-of-type(2) { bottom: 50%; top: 50%; right: 50%; margin: -20px -42px 0 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleO span:nth-of-type(1) { opacity: 1; visibility: visible; -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); -ms-transform: rotate(360deg); -o-transform: rotate(360deg); transform: rotate(360deg); } .ImageWrapper:hover .StyleO span:nth-of-type(2) { opacity: 1; visibility: visible; -webkit-transform: rotate(360deg); -moz-transform: rotate(360deg); -ms-transform: rotate(360deg); -o-transform: rotate(360deg); transform: rotate(360deg); } .ImageWrapper .StyleF { visibility: hidden; -webkit-transform: scale(0.5) rotateX(360deg); -moz-transform: scale(0.5) rotateX(360deg); -ms-transform: scale(0.5) rotateX(360deg); -o-transform: scale(0.5) rotateX(360deg); transform: scale(0.5) rotateX(360deg); margin: 0; opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleF { opacity: 1; -webkit-transform: scale(1) rotateX(0deg); -moz-transform: scale(1) rotateX(0deg); -ms-transform: scale(1) rotateX(0deg); -o-transform: scale(1) rotateX(0deg); transform: scale(1) rotateX(0deg); visibility: visible; } .ImageWrapper .StyleNe { visibility: hidden; margin: 0; -webkit-transform: rotateY(0deg); -moz-transform: rotateY(0deg); -ms-transform: rotateY(0deg); -o-transform: rotateY(0deg); transform: rotateY(0deg); opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleNe { opacity: 1; -webkit-transform: rotateY(360deg); -moz-transform: rotateY(360deg); -ms-transform: rotateY(360deg); -o-transform: rotateY(360deg); transform: rotateY(360deg); visibility: visible; } .ImageWrapper .StyleNa { visibility: hidden; -webkit-transform: scale(0.2) rotateY(360deg); -moz-transform: scale(0.2) rotateY(360deg); -ms-transform: scale(0.2) rotateY(360deg); -o-transform: scale(0.2) rotateY(360deg); transform: scale(0.2) rotateY(360deg); margin: 0; opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleNa { opacity: 1; -webkit-transform: scale(1) rotateY(0deg); -moz-transform: scale(1) rotateY(0deg); -ms-transform: scale(1) rotateY(0deg); -o-transform: scale(1) rotateY(0deg); transform: scale(1) rotateY(0deg); visibility: visible; } .ImageWrapper .StyleMg span { position: absolute; } .ImageWrapper .StyleMg span:nth-of-type(1) { bottom: 50%; top: 50%; left: 50%; margin: -20px 0 0 -82px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleMg span:nth-of-type(2) { bottom: 50%; top: 50%; right: 50%; margin: -20px -82px 0 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleMg span:nth-of-type(1) { margin: -20px 0 0 -20px; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleMg span:nth-of-type(2) { margin: -20px -42px 0 0; visibility: visible; opacity: 1; } .ImageWrapper .StyleAl span { position: absolute; } .ImageWrapper .StyleAl span:nth-of-type(1) { top: 0; left: 50%; margin: -20px 0 0 -42px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleAl span:nth-of-type(2) { bottom: 0; right: 50%; margin: 0 -42px -20px 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleAl span:nth-of-type(1) { top: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleAl span:nth-of-type(2) { bottom: 50%; visibility: visible; opacity: 1; } .ImageWrapper .StyleSi span { position: absolute; } .ImageWrapper .StyleSi span:nth-of-type(1) { bottom: 0; left: 50%; margin: 0 0 -20px -42px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleSi span:nth-of-type(2) { top: 0; right: 50%; margin: -20px -42px 0 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleSi span:nth-of-type(1) { bottom: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleSi span:nth-of-type(2) { top: 50%; visibility: visible; opacity: 1; } .ImageWrapper .StyleP span { position: absolute; } .ImageWrapper .StyleP span:nth-of-type(1) { top: 0; left: 0; margin: -40px 0 0 -40px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleP span:nth-of-type(2) { bottom: 0; right: 0; margin: 0 -40px -40px 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleP span:nth-of-type(1) { top: 50%; left: 50%; margin: -20px 0 0 -42px; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleP span:nth-of-type(2) { bottom: 50%; right: 50%; margin: 0 -42px -20px 0; visibility: visible; opacity: 1; } .ImageWrapper .StyleS span { position: absolute; } .ImageWrapper .StyleS span:nth-of-type(1) { bottom: 0; left: 0; margin: -40px 0 0 -40px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleS span:nth-of-type(2) { top: 0; right: 0; margin: 0 -40px -40px 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleS span:nth-of-type(1) { bottom: 50%; left: 50%; margin: 0 0 -20px -42px; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleS span:nth-of-type(2) { top: 50%; right: 50%; margin: -20px -42px 0 0; visibility: visible; opacity: 1; } .ImageWrapper .StyleCl { visibility: hidden; margin: 0; opacity: 0; position: absolute; text-align: center; width: 100%; top: 50%; margin-top: -20px; visibility: visible; -webkit-transform: rotateX(0deg); -moz-transform: rotateX(0deg); -ms-transform: rotateX(0deg); -o-transform: rotateX(0deg); transform: rotateX(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleCl { opacity: 1; visibility: visible; -webkit-transform: rotateX(360deg); -moz-transform: rotateX(360deg); -ms-transform: rotateX(360deg); -o-transform: rotateX(360deg); transform: rotateX(360deg); } .ImageWrapper .StyleAr span { position: absolute; } .ImageWrapper .StyleAr span:nth-of-type(1) { top: 50%; bottom: 50%; left: 50%; margin: -20px 0 0 -42px; visibility: hidden; opacity: 0; -webkit-transform: scale(0.2) rotate(0deg); -moz-transform: scale(0.2) rotate(0deg); -ms-transform: scale(0.2) rotate(0deg); -o-transform: scale(0.2) rotate(0deg); transform: scale(0.2) rotate(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleAr span:nth-of-type(2) { top: 50%; bottom: 50%; right: 50%; margin: -20px -42px 0 0; visibility: hidden; opacity: 0; -webkit-transform: scale(0.2) rotate(0deg); -moz-transform: scale(0.2) rotate(0deg); -ms-transform: scale(0.2) rotate(0deg); -o-transform: scale(0.2) rotate(0deg); transform: scale(0.2) rotate(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleAr span:nth-of-type(1) { visibility: visible; opacity: 1; -webkit-transform: scale(1) rotate(360deg); -moz-transform: scale(1) rotate(360deg); -ms-transform: scale(1) rotate(360deg); -o-transform: scale(1) rotate(360deg); transform: scale(1) rotate(360deg); } .ImageWrapper:hover .StyleAr span:nth-of-type(2) { visibility: visible; opacity: 1; -webkit-transform: scale(1) rotate(360deg); -moz-transform: scale(1) rotate(360deg); -ms-transform: scale(1) rotate(360deg); -o-transform: scale(1) rotate(360deg); transform: scale(1) rotate(360deg); } .ImageWrapper .StyleK span { position: absolute; } .ImageWrapper .StyleK span:nth-of-type(1) { top: 50%; bottom: 50%; left: 50%; margin: -20px 0 0 -42px; visibility: hidden; opacity: 0; -webkit-transform: rotateY(0deg); -moz-transform: rotateY(0deg); -ms-transform: rotateY(0deg); -o-transform: rotateY(0deg); transform: rotateY(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleK span:nth-of-type(2) { top: 50%; bottom: 50%; right: 50%; margin: -20px -42px 0 0; visibility: hidden; opacity: 0; -webkit-transform: rotateY(0deg); -moz-transform: rotateY(0deg); -ms-transform: rotateY(0deg); -o-transform: rotateY(0deg); transform: rotateY(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleK span:nth-of-type(1) { visibility: visible; opacity: 1; -webkit-transform: rotateY(360deg); -moz-transform: rotateY(360deg); -ms-transform: rotateY(360deg); -o-transform: rotateY(360deg); transform: rotateY(360deg); } .ImageWrapper:hover .StyleK span:nth-of-type(2) { visibility: visible; opacity: 1; -webkit-transform: rotateY(360deg); -moz-transform: rotateY(360deg); -ms-transform: rotateY(360deg); -o-transform: rotateY(360deg); transform: rotateY(360deg); } .ImageWrapper .StyleCa span { position: absolute; } .ImageWrapper .StyleCa span:nth-of-type(1) { top: 50%; bottom: 50%; left: 50%; margin: -20px 0 0 -42px; visibility: hidden; opacity: 0; -webkit-transform: scale(0.2) rotateY(0deg); -moz-transform: scale(0.2) rotateY(0deg); -ms-transform: scale(0.2) rotateY(0deg); -o-transform: scale(0.2) rotateY(0deg); transform: scale(0.2) rotateY(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleCa span:nth-of-type(2) { top: 50%; bottom: 50%; right: 50%; margin: -20px -42px 0 0; visibility: hidden; opacity: 0; -webkit-transform: scale(0.2) rotateY(0deg); -moz-transform: scale(0.2) rotateY(0deg); -ms-transform: scale(0.2) rotateY(0deg); -o-transform: scale(0.2) rotateY(0deg); transform: scale(0.2) rotateY(0deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleCa span:nth-of-type(1) { visibility: visible; opacity: 1; -webkit-transform: scale(1) rotateY(360deg); -moz-transform: scale(1) rotateY(360deg); -ms-transform: scale(1) rotateY(360deg); -o-transform: scale(1) rotateY(360deg); transform: scale(1) rotateY(360deg); } .ImageWrapper:hover .StyleCa span:nth-of-type(2) { visibility: visible; opacity: 1; -webkit-transform: scale(1) rotateY(360deg); -moz-transform: scale(1) rotateY(360deg); -ms-transform: scale(1) rotateY(360deg); -o-transform: scale(1) rotateY(360deg); transform: scale(1) rotateY(360deg); } .ImageWrapper .StyleSc span { position: absolute; } .ImageWrapper .StyleSc span:nth-of-type(1) { bottom: 50%; top: 50%; left: 0; margin: -20px 0 0 -68px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleSc span:nth-of-type(2) { top: 0; right: 50%; left: 50%; margin: -20px 0 0 -20px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleSc span:nth-of-type(3) { bottom: 50%; top: 50%; right: 0; margin: -20px -68px 0 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleSc span:nth-of-type(1) { left: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleSc span:nth-of-type(2) { top: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleSc span:nth-of-type(3) { right: 50%; visibility: visible; opacity: 1; } .ImageWrapper .StyleTi span { position: absolute; } .ImageWrapper .StyleTi span:nth-of-type(1) { bottom: 50%; top: 50%; left: 0; margin: -20px 0 0 -68px; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleTi span:nth-of-type(2) { bottom: 50%; top: 50%; left: 50%; right: 50%; margin: -20px 0 0 -20px; visibility: hidden; opacity: 0; -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper .StyleTi span:nth-of-type(3) { bottom: 50%; top: 50%; right: 0; margin: -20px -68px 0 0; visibility: hidden; opacity: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .StyleTi span:nth-of-type(1) { left: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleTi span:nth-of-type(2) { visibility: visible; opacity: 1; -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); } .ImageWrapper:hover .StyleTi span:nth-of-type(3) { right: 50%; visibility: visible; opacity: 1; } .ImageWrapper .StyleV span { position: absolute; } .ImageWrapper .StyleV span:nth-of-type(1) { top: 0; left: 50%; margin: -20px 0 0 -68px; visibility: hidden; opacity: 0; transition: all 200ms cubic-bezier(0.000,1.135,0.730,1.405) .2s; } .ImageWrapper .StyleV span:nth-of-type(2) { top: 0; left: 50%; margin: -20px 0 0 -20px; visibility: hidden; opacity: 0; transition: all 200ms cubic-bezier(0.000,1.135,0.730,1.405) .3s; } .ImageWrapper .StyleV span:nth-of-type(3) { top: 0; right: 50%; margin: -20px -68px 0 0; visibility: hidden; opacity: 0; transition: all 200ms cubic-bezier(0.000,1.135,0.730,1.405) .4s; } .ImageWrapper:hover .StyleV span:nth-of-type(1) { top: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleV span:nth-of-type(2) { top: 50%; visibility: visible; opacity: 1; } .ImageWrapper:hover .StyleV span:nth-of-type(3) { top: 50%; visibility: visible; opacity: 1; } .ImageWrapper .PStyleH { background: url(../images/plus.png) no-repeat scroll center center / 60px 60px #222222; height: 100%; left: 0; opacity: 0; overflow: hidden; position: absolute; top: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; z-index: 9999; } .ImageWrapper:hover .PStyleH { opacity: .6; visibility: visible; } .ImageWrapper .PStyleHe { position: absolute; background: url(../images/plus.png) no-repeat scroll center center / 100% 100% #222222; width: 100%; height: 100%; z-index: 1; -o-background-origin: padding-box, padding-box; background-origin: padding-box, padding-box; background-position: center center; background-repeat: no-repeat; -o-background-size: 10px 10px, 100% 100%; background-size: 10px 10px, 100% 100%; opacity: 0; top: 0; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; } .ImageWrapper:hover .PStyleHe { opacity: .6; -o-background-size: 60px 60px, 100% 100%; background-size: 60px 60px, 100% 100%; visibility: visible; } .ImageWrapper .PStyleLi { -webkit-transform: scale(0.5) rotateY(180deg); -moz-transform: scale(0.5) rotateY(180deg); -ms-transform: scale(0.5) rotateY(180deg); -o-transform: scale(0.5) rotateY(180deg); transform: scale(0.5) rotateY(180deg); background: url(../images/plus.png) no-repeat scroll center center / 60px 60px #222222; height: 100%; left: 0; opacity: 0; overflow: hidden; position: absolute; top: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; z-index: 9999; } .ImageWrapper:hover .PStyleLi { opacity: .6; -webkit-transform: scale(1) rotateY(0deg); -moz-transform: scale(1) rotateY(0deg); -ms-transform: scale(1) rotateY(0deg); -o-transform: scale(1) rotateY(0deg); transform: scale(1) rotateY(0deg); visibility: visible; } .ImageWrapper .PStyleBe { -webkit-transform: scale(0.5) rotateX(180deg); -moz-transform: scale(0.5) rotateX(180deg); -ms-transform: scale(0.5) rotateX(180deg); -o-transform: scale(0.5) rotateX(180deg); transform: scale(0.5) rotateX(180deg); background: url(../images/plus.png) no-repeat scroll center center / 60px 60px #222222; height: 100%; left: 0; opacity: 0; overflow: hidden; position: absolute; top: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; width: 100%; z-index: 9999; } .ImageWrapper:hover .PStyleBe { opacity: .6; -webkit-transform: scale(1) rotateX(0deg); -moz-transform: scale(1) rotateX(0deg); -ms-transform: scale(1) rotateX(0deg); -o-transform: scale(1) rotateX(0deg); transform: scale(1) rotateX(0deg); visibility: visible; } .ImageWrapper .PStyleB { position: absolute; background: url(../images/plus.png) no-repeat scroll top left / 100% 100% #222222; width: 100%; height: 100%; z-index: 1; -o-background-origin: padding-box, padding-box; background-origin: padding-box, padding-box; background-position: top left; background-repeat: no-repeat; -o-background-size: 10px 10px, 100% 100%; background-size: 10px 10px, 100% 100%; opacity: 0; top: 0; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; } .ImageWrapper:hover .PStyleB { opacity: .6; -o-background-size: 60px 60px, 100% 100%; background-size: 60px 60px, 100% 100%; visibility: visible; background-position: center center; } .ImageWrapper .PStyleC { position: absolute; background: url(../images/plus.png) no-repeat scroll top left / 100% 100% #222222; width: 100%; height: 100%; z-index: 1; -o-background-origin: padding-box, padding-box; background-origin: padding-box, padding-box; background-position: top right; background-repeat: no-repeat; -o-background-size: 10px 10px, 100% 100%; background-size: 10px 10px, 100% 100%; opacity: 0; top: 0; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; } .ImageWrapper:hover .PStyleC { opacity: .6; -o-background-size: 60px 60px, 100% 100%; background-size: 60px 60px, 100% 100%; visibility: visible; background-position: center center; } .ImageWrapper .PStyleN { position: absolute; background: url(../images/plus.png) no-repeat scroll top left / 100% 100% #222222; width: 100%; height: 100%; z-index: 1; -o-background-origin: padding-box, padding-box; background-origin: padding-box, padding-box; background-position: bottom right; background-repeat: no-repeat; -o-background-size: 10px 10px, 100% 100%; background-size: 10px 10px, 100% 100%; opacity: 0; top: 0; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; } .ImageWrapper:hover .PStyleN { opacity: .6; -o-background-size: 60px 60px, 100% 100%; background-size: 60px 60px, 100% 100%; visibility: visible; background-position: center center; } .ImageWrapper .PStyleO { position: absolute; background: url(../images/plus.png) no-repeat scroll top left / 100% 100% #222222; width: 100%; height: 100%; z-index: 1; -o-background-origin: padding-box, padding-box; background-origin: padding-box, padding-box; background-position: bottom left; background-repeat: no-repeat; -o-background-size: 10px 10px, 100% 100%; background-size: 10px 10px, 100% 100%; opacity: 0; top: 0; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; } .ImageWrapper:hover .PStyleO { opacity: .6; -o-background-size: 60px 60px, 100% 100%; background-size: 60px 60px, 100% 100%; visibility: visible; background-position: center center; } .ImageWrapper .PStyleF { position: absolute; background: url(../images/plus.png) no-repeat scroll top left / 100% 100% #222222; width: 100%; height: 100%; z-index: 1; -o-background-origin: padding-box, padding-box; background-origin: padding-box, padding-box; background-position: top center; background-repeat: no-repeat; -o-background-size: 10px 10px, 100% 100%; background-size: 10px 10px, 100% 100%; opacity: 0; top: 0; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; } .ImageWrapper:hover .PStyleF { opacity: .6; -o-background-size: 60px 60px, 100% 100%; background-size: 60px 60px, 100% 100%; visibility: visible; background-position: center center; } .ImageWrapper .PStyleNe { position: absolute; background: url(../images/plus.png) no-repeat scroll top left / 100% 100% #222222; width: 100%; height: 100%; z-index: 1; -o-background-origin: padding-box, padding-box; background-origin: padding-box, padding-box; background-position: bottom center; background-repeat: no-repeat; -o-background-size: 10px 10px, 100% 100%; background-size: 10px 10px, 100% 100%; opacity: 0; top: 0; -webkit-transition: all 0.3s ease-in 0s; -moz-transition: all 0.3s ease-in 0s; -o-transition: all 0.3s ease-in 0s; transition: all 0.3s ease-in 0s; } .ImageWrapper:hover .PStyleNe { opacity: .6; -o-background-size: 60px 60px, 100% 100%; background-size: 60px 60px, 100% 100%; visibility: visible; background-position: center center; } .ContentWrapperH .ContentH { position: absolute; background: rgba(0,0,0,0.4); opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; right: 10px; bottom: 10px; top: 10px; left: 10px; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperH:hover .ContentH { opacity: 1; visibility: visible; } .ContentWrapperH .ContentH .Content { position: relative; top: 10%; padding: 0 10px; } .ContentWrapperH .ContentH .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperH .ContentH .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperH .ContentH .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperH .ContentH .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperHe .ContentHe { position: absolute; background: #000000; background: rgba(0,0,0,0.4); opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; left: 0; -webkit-transform: scale(0.0); -moz-transform: scale(0.0); -ms-transform: scale(0.0); -o-transform: scale(0.0); transform: scale(0.0); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperHe:hover .ContentHe { opacity: 1; visibility: visible; -webkit-transform: scale(1.0); -moz-transform: scale(1.0); -ms-transform: scale(1.0); -o-transform: scale(1.0); transform: scale(1.0); right: 10px; } .ContentWrapperHe .ContentHe .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperHe .ContentHe .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperHe .ContentHe .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperHe .ContentHe .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperHe .ContentHe .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperLi:hover img { -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); } .ContentWrapperLi .ContentLi { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; left: 0; -webkit-transform: scale(0); -moz-transform: scale(0); -ms-transform: scale(0); -o-transform: scale(0); transform: scale(0); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperLi:hover .ContentLi { opacity: 1; visibility: visible; -webkit-transform: scale(1); -moz-transform: scale(1); -ms-transform: scale(1); -o-transform: scale(1); transform: scale(1); } .ContentWrapperLi .ContentLi .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperLi .ContentLi .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperLi .ContentLi .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperLi .ContentLi .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperLi .ContentLi .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperBe:hover img { -webkit-transform: scale(10); -moz-transform: scale(10); -ms-transform: scale(10); -o-transform: scale(10); transform: scale(10); opacity: 0; } .ContentWrapperBe .ContentBe { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; left: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperBe:hover .ContentBe { opacity: 1; visibility: visible; } .ContentWrapperBe .ContentBe .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperBe .ContentBe .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperBe .ContentBe .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperBe .ContentBe .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperBe .ContentBe .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperB:hover img { -webkit-transform: translateY(100%); -moz-transform: translateY(100%); -ms-transform: translateY(100%); -o-transform: translateY(100%); transform: translateY(100%); } .ContentWrapperB .ContentB { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: -100%; left: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperB:hover .ContentB { opacity: 1; visibility: visible; top: 0; } .ContentWrapperB .ContentB .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperB .ContentB .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperB .ContentB .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperB .ContentB .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperB .ContentB .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperC:hover img { -webkit-transform: translateY(-100%); -moz-transform: translateY(-100%); -ms-transform: translateY(-100%); -o-transform: translateY(-100%); transform: translateY(-100%); } .ContentWrapperC .ContentC { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; bottom: -100%; left: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperC:hover .ContentC { opacity: 1; visibility: visible; bottom: 0; } .ContentWrapperC .ContentC .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperC .ContentC .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperC .ContentC .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperC .ContentC .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperC .ContentC .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperN:hover img { -webkit-transform: translateX(-100%); -moz-transform: translateX(-100%); -ms-transform: translateX(-100%); -o-transform: translateX(-100%); transform: translateX(-100%); } .ContentWrapperN .ContentN { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; right: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperN:hover .ContentN { opacity: 1; visibility: visible; right: 0; } .ContentWrapperN .ContentN .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperN .ContentN .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperN .ContentN .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperN .ContentN .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperN .ContentN .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperO:hover img { -webkit-transform: translateX(100%); -moz-transform: translateX(100%); -ms-transform: translateX(100%); -o-transform: translateX(100%); transform: translateX(100%); } .ContentWrapperO .ContentO { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; left: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperO:hover .ContentO { opacity: 1; visibility: visible; left: 0; } .ContentWrapperO .ContentO .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperO .ContentO .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperO .ContentO .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperO .ContentO .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperO .ContentO .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperF:hover img { -webkit-transform: translateX(20%); -moz-transform: translateX(20%); -ms-transform: translateX(20%); -o-transform: translateX(20%); transform: translateX(20%); } .ContentWrapperF .ContentF { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 50%; height: 100%; display: block; top: 0; left: 0; -webkit-transform: perspective(600px) rotateY(90deg); -moz-transform: perspective(600px) rotateY(90deg); -ms-transform: perspective(600px) rotateY(90deg); -o-transform: perspective(600px) rotateY(90deg); transform: perspective(600px) rotateY(90deg); -webkit-transform-origin: left center 0; -moz-transform-origin: left center 0; -ms-transform-origin: left center 0; -o-transform-origin: left center 0; transform-origin: left center 0; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperF:hover .ContentF { opacity: 1; visibility: visible; -webkit-transform: perspective(600px) rotateY(0deg); -moz-transform: perspective(600px) rotateY(0deg); -ms-transform: perspective(600px) rotateY(0deg); -o-transform: perspective(600px) rotateY(0deg); transform: perspective(600px) rotateY(0deg); } .ContentWrapperF .ContentF .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperF .ContentF .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperF .ContentF .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperNe:hover img { -webkit-transform: translateY(20%); -moz-transform: translateY(20%); -ms-transform: translateY(20%); -o-transform: translateY(20%); transform: translateY(20%); } .ContentWrapperNe .ContentNe { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 50%; display: block; top: 0; left: 0; -webkit-transform: perspective(600px) rotateX(-90deg); -moz-transform: perspective(600px) rotateX(-90deg); -ms-transform: perspective(600px) rotateX(-90deg); -o-transform: perspective(600px) rotateX(-90deg); transform: perspective(600px) rotateX(-90deg); -webkit-transform-origin: center top 0; -moz-transform-origin: center top 0; -ms-transform-origin: center top 0; -o-transform-origin: center top 0; transform-origin: center top 0; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperNe:hover .ContentNe { opacity: 1; visibility: visible; -webkit-transform: perspective(600px) rotateY(0deg); -moz-transform: perspective(600px) rotateX(0deg); -ms-transform: perspective(600px) rotateX(0deg); -o-transform: perspective(600px) rotateX(0deg); transform: perspective(600px) rotateX(0deg); } .ContentWrapperNe .ContentNe .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperNe .ContentNe .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperNe .ContentNe .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperNa:hover img { -webkit-transform: translateX(-20%); -moz-transform: translateX(-20%); -ms-transform: translateX(-20%); -o-transform: translateX(-20%); transform: translateX(-20%); } .ContentWrapperNa .ContentNa { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 50%; height: 100%; display: block; top: 0; right: 0; -webkit-transform: perspective(600px) rotateY(-90deg); -moz-transform: perspective(600px) rotateY(-90deg); -ms-transform: perspective(600px) rotateY(-90deg); -o-transform: perspective(600px) rotateY(-90deg); transform: perspective(600px) rotateY(-90deg); -webkit-transform-origin: right center 0; -moz-transform-origin: right center 0; -ms-transform-origin: right center 0; -o-transform-origin: right center 0; transform-origin: right center 0; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperNa:hover .ContentNa { opacity: 1; visibility: visible; -webkit-transform: perspective(600px) rotateY(0deg); -moz-transform: perspective(600px) rotateY(0deg); -ms-transform: perspective(600px) rotateY(0deg); -o-transform: perspective(600px) rotateY(0deg); transform: perspective(600px) rotateY(0deg); } .ContentWrapperNa .ContentNa .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperNa .ContentNa .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperNa .ContentNa .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperMg:hover img { -webkit-transform: translateY(-20%); -moz-transform: translateY(-20%); -ms-transform: translateY(-20%); -o-transform: translateY(-20%); transform: translateY(-20%); } .ContentWrapperMg .ContentMg { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 50%; display: block; bottom: 0; left: 0; -webkit-transform: perspective(600px) rotateX(90deg); -moz-transform: perspective(600px) rotateX(90deg); -ms-transform: perspective(600px) rotateX(90deg); -o-transform: perspective(600px) rotateX(90deg); transform: perspective(600px) rotateX(90deg); -webkit-transform-origin: center bottom 0; -moz-transform-origin: center bottom 0; -ms-transform-origin: center bottom 0; -o-transform-origin: center bottom 0; transform-origin: center bottom 0; -webkit-transform-style: preserve-3d; -moz-transform-style: preserve-3d; -ms-transform-style: preserve-3d; -o-transform-style: preserve-3d; transform-style: preserve-3d; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperMg:hover .ContentMg { opacity: 1; visibility: visible; -webkit-transform: perspective(600px) rotateY(0deg); -moz-transform: perspective(600px) rotateY(0deg); -ms-transform: perspective(600px) rotateY(0deg); -o-transform: perspective(600px) rotateY(0deg); transform: perspective(600px) rotateY(0deg); } .ContentWrapperMg .ContentMg .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperMg .ContentMg .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperMg .ContentMg .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperSi .ContentSi { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; left: 0; -webkit-transform: rotateX(0deg) scale(0.0); -moz-transform: rotateX(0deg) scale(0.0); -ms-transform: rotateX(0deg) scale(0.0); -o-transform: rotateX(0deg) scale(0.0); transform: rotateX(0deg) scale(0.0); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperSi:hover .ContentSi { opacity: 1; visibility: visible; -webkit-transform: rotateX(360deg) scale(.9); -moz-transform: rotateX(360deg) scale(.9); -ms-transform: rotateX(360deg) scale(.9); -o-transform: rotateX(360deg) scale(.9); transform: rotateX(360deg) scale(.9); } .ContentWrapperSi .ContentSi .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperSi .ContentSi .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperSi .ContentSi .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperSi .ContentSi .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperSi .ContentSi .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperP .ContentP { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; left: 0; -webkit-transform-origin: top left; -webkit-transform-style: preserve-3D; -webkit-transform: rotate(180deg); transform-origin: top left; transform-style: preserve-3D; transform: rotate(180deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperP:hover .ContentP { opacity: 1; visibility: visible; -webkit-transform: rotate(0deg); transform: rotate(0deg); } .ContentWrapperP .ContentP .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperP .ContentP .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperP .ContentP .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperP .ContentP .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperP .ContentP .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperS .ContentS { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; right: 0; -webkit-transform-origin: top right; -webkit-transform-style: preserve-3D; -webkit-transform: rotate(180deg); transform-origin: top right; transform-style: preserve-3D; transform: rotate(180deg); -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperS:hover .ContentS { opacity: 1; visibility: visible; -webkit-transform: rotate(0deg); transform: rotate(0deg); } .ContentWrapperS .ContentS .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperS .ContentS .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperS .ContentS .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperS .ContentS .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperS .ContentS .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperCl { overflow: visible !important; } .ContentWrapperCl img { position: relative; z-index: 455; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperCl:hover img { -webkit-transform: translateY(-20%); -moz-transform: translateY(-20%); -ms-transform: translateY(-20%); -o-transform: translateY(-20%); transform: translateY(-20%); } .ContentWrapperCl .ContentCl { position: absolute; background: #ffffff; opacity: 1; visibility: hidden; width: 100%; height: 20%; display: block; bottom: 0; left: 0; z-index: 200; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperCl:hover .ContentCl { visibility: visible; } .ContentWrapperCl .ContentCl .Content { position: absolute; top: 80%; display: block; width: 100%; } .ContentWrapperCl .ContentCl .Content h2 { font: bold 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 2px; text-align: center; } .ContentWrapperCl .ContentCl .Content .ReadMore { margin: 8px auto; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); display: block; width: 80px; } .ContentWrapperCl .ContentCl .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperAr { overflow: visible !important; } .ContentWrapperAr img { position: relative; z-index: 455; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperAr:hover img { -webkit-transform: translateY(40%); -moz-transform: translateY(40%); -ms-transform: translateY(40%); -o-transform: translateY(40%); transform: translateY(40%); } .ContentWrapperAr .ContentAr { position: absolute; background: #ffffff; opacity: 1; visibility: hidden; width: 100%; height: 100%; display: block; bottom: 0; left: 0; z-index: 200; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperAr:hover .ContentAr { visibility: visible; } .ContentWrapperAr .ContentAr .Content { position: absolute; top: 5%; display: block; width: 100%; } .ContentWrapperAr .ContentAr .Content h2 { font: bold 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 2px; text-align: center; } .ContentWrapperAr .ContentAr .Content .ReadMore { margin: 8px auto; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); display: block; width: 80px; } .ContentWrapperAr .ContentAr .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperK { overflow: visible !important; } .ContentWrapperK img { position: relative; z-index: 455; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperK:hover img { -webkit-transform: translateX(-20%); -moz-transform: translateX(-20%); -ms-transform: translateX(-20%); -o-transform: translateX(-20%); transform: translateX(-20%); } .ContentWrapperK .ContentK { position: absolute; background: #ffffff; opacity: 1; visibility: hidden; width: 100%; height: 100%; display: block; bottom: 0; left: 0; z-index: 200; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperK:hover .ContentK { visibility: visible; } .ContentWrapperK .ContentK .Content { display: block; width: 100%; position: relative; } .ContentWrapperK .ContentK .Content ul { position: absolute; top: 0; right: 0; } .ContentWrapperK .ContentK .Content ul li { margin: 14px 16px; } .ContentWrapperK .ContentK .Content ul li a { font-size: 21px; color: #a9a9a9; } .ContentWrapperCa { overflow: visible !important; } .ContentWrapperCa img { position: relative; z-index: 455; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperCa:hover img { -webkit-transform: translateX(20%); -moz-transform: translateX(20%); -ms-transform: translateX(20%); -o-transform: translateX(20%); transform: translateX(20%); } .ContentWrapperCa .ContentCa { position: absolute; background: #ffffff; opacity: 1; visibility: hidden; width: 100%; height: 100%; display: block; bottom: 0; left: 0; z-index: 200; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperCa:hover .ContentCa { visibility: visible; } .ContentWrapperCa .ContentCa .Content { display: block; width: 100%; position: relative; } .ContentWrapperCa .ContentCa .Content ul { position: absolute; top: 0; left: 0; } .ContentWrapperCa .ContentCa .Content ul li { margin: 14px 16px; } .ContentWrapperCa .ContentCa .Content ul li a { font-size: 21px; color: #a9a9a9; } .ContentWrapperSc .ContentSc { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: -100%; left: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperSc:hover .ContentSc { opacity: 1; visibility: visible; top: 0; } .ContentWrapperSc .ContentSc .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperSc .ContentSc .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperSc .ContentSc .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperSc .ContentSc .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperSc .ContentSc .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperTi .ContentTi { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; left: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperTi:hover .ContentTi { opacity: 1; visibility: visible; left: 0; } .ContentWrapperTi .ContentTi .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperTi .ContentTi .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperTi .ContentTi .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperTi .ContentTi .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperTi .ContentTi .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperV .ContentV { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 100%; display: block; top: 0; right: -100%; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperV:hover .ContentV { opacity: 1; visibility: visible; right: 0; } .ContentWrapperV .ContentV .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperV .ContentV .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperV .ContentV .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperV .ContentV .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperV .ContentV .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ContentWrapperCr .ContentCr { position: absolute; background: #ffffff; opacity: 0; visibility: hidden; width: 100%; height: 0; display: block; bottom: -100%; left: 0; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ContentWrapperCr:hover .ContentCr { opacity: 1; visibility: visible; height: 100%; bottom: 0; } .ContentWrapperCr .ContentCr .Content { position: absolute; top: 10%; padding: 0 10px; } .ContentWrapperCr .ContentCr .Content h2 { font: 16px 'Source Sans Pro', Arial, sans-serif; color: #8CA757; padding: 0 0 6px; } .ContentWrapperCr .ContentCr .Content p { font: normal 12px 'Source Sans Pro'; color: #666666; } .ContentWrapperCr .ContentCr .Content .ReadMore { float: right; margin: 16px 0 0; background: #D1CDC3; background: -moz-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -webkit-gradient(linear,left top,left bottom,color-stop(0%,#D1CDC3),color-stop(100%,#C9C5BA)); background: -webkit-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -o-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: -ms-linear-gradient(top,#D1CDC3 0%,#C9C5BA 100%); background: linear-gradient(to bottom,#D1CDC3 0%,#C9C5BA 100%); filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#D1CDC3',endColorstr='#C9C5BA',GradientType=0); -webkit-border-radius: 2px 2px 2px 2px; border-radius: 2px 2px 2px 2px; -webkit-box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); box-shadow: 0 -1px 0 rgba(0,0,0,0.08) inset, 0 1px 1px 0 rgba(0,0,0,0.11), 0 0 0 rgba(0,0,0,0); } .ContentWrapperCr .ContentCr .Content .ReadMore a { color: #757167; padding: 6px 16px; display: block; font: normal 12px 'Source Sans Pro'; } .ImageWrapper .RibbonCTL .Triangle:after { border-right: 35px solid rgba(0,0,0,0); border-top: 35px solid #FFFFFF; content: " "; display: block; height: 0; position: absolute; width: 0; top: 0; left: 0; z-index: 99; } .ImageWrapper .RibbonCTL .Sign { top: 2px; left: 2px; position: absolute; z-index: 999; } .ImageWrapper .RibbonCTL .Sign a { color: #666666; } .ImageWrapper .RibbonCTL { opacity: 0; visibility: hidden; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .RibbonCTL { opacity: 1; visibility: visible; } .ImageWrapper .RibbonCTR .Triangle:after { border-left: 35px solid rgba(0,0,0,0); border-top: 35px solid #FFFFFF; content: " "; display: block; height: 0; position: absolute; width: 0; top: 0; right: 0; z-index: 99; } .ImageWrapper .RibbonCTR .Sign { top: 2px; right: 2px; position: absolute; z-index: 999; } .ImageWrapper .RibbonCTR .Sign a { color: #666666; } .ImageWrapper .RibbonCTR { opacity: 0; visibility: hidden; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .RibbonCTR { opacity: 1; visibility: visible; } .ImageWrapper .RibbonCBL .Triangle:after { border-right: 35px solid rgba(0,0,0,0); border-bottom: 35px solid #FFFFFF; content: " "; display: block; height: 0; position: absolute; width: 0; bottom: 0; left: 0; z-index: 99; } .ImageWrapper .RibbonCBL .Sign { bottom: 1px; left: 1px; position: absolute; z-index: 999; } .ImageWrapper .RibbonCBL .Sign a { color: #666666; } .ImageWrapper .RibbonCBL { opacity: 0; visibility: hidden; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .RibbonCBL { opacity: 1; visibility: visible; } .ImageWrapper .RibbonCBR .Triangle:after { border-left: 35px solid rgba(0,0,0,0); border-bottom: 35px solid #FFFFFF; content: " "; display: block; height: 0; position: absolute; width: 0; bottom: 0; right: 0; z-index: 99; } .ImageWrapper .RibbonCBR .Sign { bottom: 1px; right: 1px; position: absolute; z-index: 999; } .ImageWrapper .RibbonCBR .Sign a { color: #666666; } .ImageWrapper .RibbonCBR { opacity: 0; visibility: hidden; -webkit-transition: all 0.3s ease 0s; -moz-transition: all 0.3s ease 0s; -o-transition: all 0.3s ease 0s; transition: all 0.3s ease 0s; } .ImageWrapper:hover .RibbonCBR { opacity: 1; visibility: visible; } .tp-caption.pacifico3 { border-style: none; border-width: 0; color: #FFFFFF; font-family: Pacifico, cursive; font-size: 62px; font-weight: 400; line-height: 72px; padding: 10px; text-align: center; text-decoration: none; } .tp-caption.pacifico3 span { color: #21C2F8; } .tp-caption span { color: #21C2F8; } .tp-caption.small_thin_grey1 { background-color: rgba(0,0,0,0); border-color: #FFD658; border-style: none; border-width: 0; color: #FFFFFF; font-family: Lato; font-size: 14px; font-weight: 400; line-height: 26px; margin: 0; padding: 1px 4px 0; text-decoration: none; text-shadow: none; } .tp-caption.pacifico1 { border-style: none; border-width: 0; color: #FFFFFF; font-family: Pacifico, cursive; font-size: 30px; font-weight: 400; line-height: 30px; padding: 10px; text-decoration: none; } .tp-caption.pacifico4 { font-size: 38px; line-height: 38px; font-weight: normal; font-family: 'Pacifico', cursive; color: #292723; text-decoration: none; padding: 10px; border-width: 0px; border-style: none; } .tp-caption.nothing1 { border-style: none; border-width: 0; color: #FFFFFF; font-family: 'Nothing You Could Do', cursive; font-size: 30px; font-weight: 400; line-height: 30px; padding: 10px; text-decoration: none; } .tp-caption.new_title { border-style: none; border-width: 0; color: #292723; font-family: "Lato", sans-serif; font-size: 30px; font-weight: 400; line-height: 30px; padding: 10px; text-decoration: none; } .tp-caption.big_title { border-style: none; border-width: 0; font-family: "Lato", sans-serif; font-size: 24px; font-weight: 400; line-height: 24px; padding: 10px; text-decoration: none; color: #21C2F8; } .tp-caption.minidesc { border-style: none; border-width: 0; color: #9CA5AB; font-family: "Lato", sans-serif; font-size: 13px; font-weight: 400; padding: 10px; text-decoration: none; } .tp-caption.minidesc3 { font-size: 16px; line-height: 1.6; font-weight: 300; font-family: "Lato", sans-serif; color: #fff; text-decoration: none; padding: 10px; border-width: 0; border-style: none; } .tp-caption a.jtbtn-big { border: 1px solid #21C2F8; color: #FFF; display: inline-block; padding: 9px 27px; margin-bottom: 0; font-size: 13px; font-weight: normal; line-height: 1.428571429; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; background: none; } .tp-caption.new_title { border-style: none; border-width: 0; color: #292723; font-family: "Lato", sans-serif; font-size: 30px; font-weight: 400; line-height: 30px; padding: 10px; text-decoration: none; } .tp-dottedoverlay.twoxtwo { background: url("../images/gridtile.png"); } .jtbtn-big1 { display: inline-block; border: 1px solid #111111; padding: 9px 35px; margin-bottom: 0; font-size: 13px; font-weight: normal; line-height: 1.428571429; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; background: none; color: #ffffff !important; } .jtbtn-big2 { display: inline-block; border: 1px solid #ffffff; padding: 9px 35px; margin-bottom: 0; font-size: 13px; font-weight: normal; line-height: 1.428571429; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; background: #ffffff; } .jtbtn { display: inline-block; padding: 6px 23px; margin-bottom: 0; font-size: 13px; font-weight: normal; line-height: 1.428571429; text-align: center; vertical-align: middle; cursor: pointer; white-space: nowrap; -webkit-user-select: none; -moz-user-select: none; -ms-user-select: none; -o-user-select: none; user-select: none; background: none; color: #292723 !important; border-color: #292723 #292723 #292723; border-color: rgba(0,0,0,0.1) rgba(0,0,0,0.1) rgba(0,0,0,0.25); border: 1px solid #292723; } .carousel-indicators { bottom: -20px; } .carousel-indicators li { border-color: #21C2F8; background-color: #FFF; width: 12px; height: 12px; } .carousel-indicators li.active { background-color: #21C2F8; } div.dexp_carousel .carousel-control { text-shadow: white; z-index: 99; font-size: 28px; } div.dexp_carousel .carousel-control span { top: 50%; position: absolute; width: 40px; height: 60px; line-height: 60px; margin-top: -30px; text-align: center; background-color: #21C2F8; color: #fff; opacity: 0; -webkit-transition: all 0.1s linear; -moz-transition: all 0.1s linear; -o-transition: all 0.1s linear; -ms-transition: all 0.1s linear; transition: all 0.1s linear; } div.dexp_carousel .carousel-control.right { background: none; } div.dexp_carousel .carousel-control.right span { right: 0; } div.dexp_carousel .carousel-control.right:hover span { opacity: 1; right: 20px; } div.dexp_carousel .carousel-control.left { background: none; } div.dexp_carousel .carousel-control.left span { left: 0; } div.dexp_carousel .carousel-control.left:hover span { opacity: 1; left: 20px; } div.dexp_carousel:hover .right span { opacity: 1; right: 20px; } div.dexp_carousel:hover .left span { opacity: 1; left: 20px; } div[id^=dexp-layerslider] .tparrows, div[id^=dexp-layerslider] .tp-bullets { opacity: 0; } div[id^=dexp-layerslider]:hover .tparrows, div[id^=dexp-layerslider]:hover .tp-bullets { opacity: 1; } .tp-bullets.simplebullets.navbar { height: 35px; padding: 0px 0px; } .tp-bullets.simplebullets .bullet { cursor: pointer; position: relative !important; background: rgba(255,255,255,0.5) !important; -webkit-border-radius: 10px; border-radius: 10px; -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; width: 6px !important; height: 6px !important; border: 5px solid rgba(0,0,0,0); display: inline-block; margin-right: 2px !important; margin-bottom: 14px !important; -webkit-transition: background-color 0.2s, border-color 0.2s; -moz-transition: background-color 0.2s, border-color 0.2s; -o-transition: background-color 0.2s, border-color 0.2s; -ms-transition: background-color 0.2s, border-color 0.2s; transition: background-color 0.2s, border-color 0.2s; float: none !important; } .tp-bullets.simplebullets .bullet.last { margin-right: 0px; } .tp-bullets.simplebullets .bullet:hover, .tp-bullets.simplebullets .bullet.selected { -webkit-box-shadow: none; -moz-box-shadow: none; box-shadow: none; background: #21C2F8 !important; width: 6px !important; height: 6px !important; border: 5px solid #21C2F8; } .tparrows:before { font-family: 'revicons'; color: #fff; font-style: normal; font-weight: normal; speak: none; display: inline-block; text-decoration: inherit; margin-right: 0; margin-top: 8px; text-align: center; width: 50px; font-size: 20px; } .tparrows { cursor: pointer; background: rgba(0,0,0,0.3) !important; -webkit-border-radius: 2px; border-radius: 2px; width: 50px !important; height: 50px !important; } .tparrows:hover { color: #fff; } .tp-leftarrow:before { content: '\e824'; } .tp-rightarrow:before { content: '\e825'; } .tparrows.tp-rightarrow:before { margin-left: 1px; } .tparrows:hover { background: #000000 !important; } .dexp-parallax { z-index: 0; } .dexp-parallax .inner { z-index: -1 !important; } .breadcrumb, .breadcrumb a { font-size: 18px; line-height: 100px; } .img-responsive { float: left; padding-right: 10px; } .lead { font-family: 'Droid Serif', Georgia, "Times New Roman", serif !important; font-size: 15px; font-style: italic; font-weight: 300; line-height: 1; padding: 15px 0; } .team img { width: 100%; height: auto; } .team .team-info { text-align: center; } #map { display: block; height: 450px; position: relative; width: 100%; } #map img { max-width: inherit; } .map { position: relative; } .infobox img { width: 100% !important; } .map .searchmodule { padding: 18px 10px; } .infobox { display: inline-block; padding: 10px 5px 5px; position: relative; width: 270px; } .infobox img { margin-right: 10px; width: 95px !important; float: left; } .infobox .title { font-family: 'Helvetica Neue', Arial, Helvetica, sans-serif; font-size: 13px; font-weight: bold; margin-bottom: 0; margin-top: 0; padding-bottom: 5px; text-transform: uppercase; } .infobox .title a { font-weight: bold; } .gm-style .gm-style-iw { font-size: 13px; font-weight: 300; } .gm-style .gm-iw { color: #2C2C2C; } .gm-style .gm-iw b { font-weight: 400; } .gm-style .gm-iw a:link, .gm-style .gm-iw a:visited { color: #4272DB; text-decoration: none; } .gm-style .gm-iw a:hover { color: #4272DB; text-decoration: underline; } .gm-style .gm-iw .gm-title { font-weight: 400; margin-bottom: 1px; } .gm-style .gm-iw .gm-basicinfo { line-height: 18px; padding-bottom: 12px; } .gm-style .gm-iw .gm-website { padding-top: 6px; } .gm-style .gm-iw .gm-photos { -moz-user-select: none; padding-bottom: 8px; } .gm-style .gm-iw .gm-sv, .gm-style .gm-iw .gm-ph { cursor: pointer; height: 50px; overflow: hidden; position: relative; width: 100px; } .gm-style .gm-iw .gm-sv { padding-right: 4px; } .gm-style .gm-iw .gm-wsv { cursor: pointer; overflow: hidden; position: relative; } .gm-style .gm-iw .gm-sv-label, .gm-style .gm-iw .gm-ph-label { bottom: 6px; color: #FFFFFF; cursor: pointer; font-size: 12px; font-weight: 400; position: absolute; text-shadow: 0 1px 4px rgba(0,0,0,0.7); } .gm-style .gm-iw .gm-stars-b, .gm-style .gm-iw .gm-stars-f { font-size: 0; height: 13px; } .gm-style .gm-iw .gm-stars-b { background-position: 0 0; margin: 0 5px; position: relative; top: 3px; width: 65px; } .gm-style .gm-iw .gm-rev { -moz-user-select: none; line-height: 20px; } .gm-style .gm-iw .gm-numeric-rev { color: #DD4B39; font-size: 16px; font-weight: 400; } .gm-style .gm-iw.gm-transit { margin-left: 15px; } .gm-style .gm-iw.gm-transit td { vertical-align: top; } .gm-style .gm-iw.gm-transit .gm-time { color: #676767; font-weight: bold; white-space: nowrap; } .gm-style .gm-iw.gm-transit img { float: left; height: 15px; margin: 1px 5px 0 -20px; width: 15px; } .gm-iw.gm-sm { margin-right: -20px; } .gm-iw { text-align: left; } .gm-iw .gm-title { padding-right: 20px; } .gm-iw .gm-numeric-rev { float: left; } .gm-iw .gm-photos, .gm-iw .gm-rev { direction: ltr; } .gm-iw .gm-stars-f, .gm-iw .gm-stars-b { background: url("http://maps.gstatic.com/mapfiles/api-3/images/review_stars.png") no-repeat scroll 0 0px 26px rgba(0,0,0,0); float: left; } .gm-iw .gm-stars-f { background-position: left -13px; } .gm-iw .gm-sv-label, .gm-iw .gm-ph-label { left: 4px; } #contact-site-form .form-type-textarea, #contact-site-form--2 .form-type-textarea { clear: both; } #contact-site-form .form-item-name, #contact-site-form--2 .form-item-name { text-align: left; } #contact-site-form .form-type-textfield, #contact-site-form--2 .form-type-textfield { width: 33.3%; float: left; } #contact-site-form .form-item-subject, #contact-site-form--2 .form-item-subject { text-align: right; } #contact-site-form .form-item-subject input, #contact-site-form--2 .form-item-subject input { width: 95%; } #contact-site-form .form-item-subject label, #contact-site-form--2 .form-item-subject label { text-align: left; } #contact-site-form .form-type-textfield input, #contact-site-form--2 .form-type-textfield input { width: 90%; height: 35px; } @media (max-width: 480px) { #contact-site-form .form-type-textfield, #contact-site-form--2 .form-type-textfield { width: 100%; float: left; } #contact-site-form .form-type-textfield input, #contact-site-form--2 .form-type-textfield input { width: 100%; height: 35px; } } #contact-site-form .form-item-copy, #contact-site-form--2 .form-item-copy { margin-bottom: 0; } #contact-site-form .form-actions, #contact-site-form--2 .form-actions { margin-top: 10px !important; } #contact-site-form .grippie, #contact-site-form--2 .grippie { display: none; } #contact-site-form .form-type-textarea textarea, #contact-site-form--2 .form-type-textarea textarea { height: 140px; } #contact-site-form .form-required, #contact-site-form--2 .form-required { display: none; } #contact-site-form .form-item-copy input, #contact-site-form--2 .form-item-copy input { margin-top: 0; } #contact-site-form .form-item.form-type-textfield input, #contact-site-form .form-item.form-type-textarea textarea, #contact-site-form--2 .form-item.form-type-textfield input, #contact-site-form--2 .form-item.form-type-textarea textarea { padding: 10px; font-size: 12px; } #contact-site-form .form-actions, #contact-site-form--2 .form-actions { text-align: center; } #contact-site-form .btn, #contact-site-form--2 .btn { background: #21C2F8 !important; border-color: #21C2F8 !important; color: #fff !important; border-radius: 0 !important; font-size: 16px !important; line-height: 1.33 !important; padding: 10px 30px !important; } #contact-site-form .btn:hover, #contact-site-form--2 .btn:hover { background-color: #3ac9f9 !important; color: #fff !important; text-decoration: none !important; border-color: #21C2F8 !important; } .small-form .form-type-textfield { width: 100% !important; margin-bottom: 10px; margin-top: 0; } .small-form .form-type-textfield input { width: 100% !important; height: 34px; background-color: #363636; border: solid 1px #222222; color: #656565; } .small-form textarea { background-color: #363636; border: solid 1px #222222; color: #656565; height: 80px !important; } .error404 { text-align: center; } .error404 h2 { font-size: 160px; font-weight: 900; line-height: 1.3; text-align: center; text-transform: uppercase; } .error404 h3 { font-size: 26px; margin: 0 0 30px; opacity: 0.2; padding-top: 0; text-align: center; } .forum-table { width: 100%; } .forum-table tr { background: none !important; border: 1px solid #F2F2F2 !important; clear: both; } .forum-table tr td { border: 1px solid #F2F2F2 !important; padding: 10px; } .forum-table tr th { text-transform: uppercase; color: #272727; font-size: 12px; padding: 10px; border: 1px solid #F2F2F2; } .forum-table tr .forum-name a { font-size: 18px; font-weight: normal; text-decoration: none; } .forum-table tr .forum-details, .forum-table tr .forum-last-reply { padding-left: 10px; padding-right: 10px; } .forum-table tr th.forum-name, .forum-table tr th.forum-last-post { padding-left: 10px; } .forum-table-superheader { margin-top: 20px; } .view-advanced-forum-topic-list .view-empty { border: 1px solid #C1C1C1; } .forum-post-wrapper, .forum-post-panel-main { background-color: #fff; } .forum-post-info { background-color: #F4F4F4; padding: 5px; } .forum-post-info span, .forum-post-info a, .forum-post-info .forum-posted-on { color: #83939C !important; } .forum-node-create-links { margin-bottom: 20px; } .page-node-add-forum h1 { display: none; } .page-forum #section-main-content { background-color: #F6F6F6; } .page-forum #section-main-content table { background-color: #FFF; } .page-user .form-text { padding: 5px; } .page-user label { min-width: 150px; } .form-text:focus, .form-textarea:focus { border: solid 1px #21C2F8 !important; border-color: #21C2F8 !important; } .testimonial-twitter { text-align: center; overflow: hidden; } .testimonial-twitter .sp-text { color: #FFFFFF; font-size: 24px; font-style: normal; font-weight: 100; font-family: 'Droid Serif', Georgia, "Times New Roman", serif !important; } .testimonial-twitter .sp-text:before { content: ""; font-family: "FontAwesome"; font-size: 23px; padding: 5px 10px; color: #21C2F8; } .testimonial-twitter .dexp-twitter { height: 100%; display: block; } .testimonial-twitter .dexp-twitter .dexp-tweet { height: 100%; display: block; } .testimonial-twitter .author { font-size: 18px; padding: 15px 0; } .boder-icon .dexp-tweet .sp-text:before { border: 1px solid #21C2F8; border-radius: 500px; color: #FFFFFF; content: ""; float: left; font-family: 'FontAwesome'; font-size: 12px; height: 35px; line-height: 35px; margin: 5px 10px 5px 0; position: absolute; text-align: center; width: 35px; z-index: 5; left: 0; } .boder-icon .dexp-tweet:hover .sp-text:before { -webkit-transition: background-color 0.4s linear; -moz-transition: background-color 0.4s linear; -o-transition: background-color 0.4s linear; -ms-transition: background-color 0.4s linear; transition: background-color 0.4s linear; background-color: #21C2F8; } .boder-icon .sp-text { position: relative; padding-left: 40px; } .boder-icon .author { padding-left: 40px; } .region-pagetitle h1.page_title { border-bottom: 3px solid #21C2F8; color: #FFFFFF; display: inline-block; font-size: 24px; margin-bottom: -3px; padding: 40px 0; position: relative; margin-top: 0; } .imgWrap { position: relative; } .imgWrap:after { content: ""; position: absolute; top: 0; bottom: 0; left: 0; right: 0; border: 10px solid rgba(33,194,248,0.4); pointer-events: none; } .banner { padding: 0; margin-bottom: 20px; position: relative; } .ContentWrapperHe .ContentHe .Content { padding: 0; position: absolute; top: 10%; display: block; margin: 0 auto; text-align: Center; right: 0; left: 0; } .banner .jtbtn { color: #ffffff !important; border-color: #ffffff !important; } .hoverimage h3 { border-radius: 0; color: #ffffff !important; font-size: 28px !important; font-weight: 100 !important; margin: 25px auto 10px; padding: 5px 10px !important; text-align: center; text-decoration: none; text-transform: uppercase; font-family: Helvetica Neue !important; } #block-views-simple-shopping-cart-block p { margin: 0; font-size: 12px; line-height: 40px; } #block-views-simple-shopping-cart-block i { color: #21C2F8; } .grid { margin-bottom: 30px; overflow: hidden; } .grid figure { margin: 0; position: relative; } .grid figure img { max-width: 100%; display: block; position: relative; } .grid figcaption { position: absolute; top: 0; left: 0; background: #21C2F8; color: #EAEAEA; } .grid figcaption h3 { text-align: left; padding: 0; margin: 0; font-size: 14px; color: #fff; } .grid figcaption h3 i { margin-right: 10px; } .grid figcaption a { text-align: center; display: inline-block; cursor: pointer; font-size: 13px; color: #ffffff !important; line-height: 50px; } .grid figcaption a:hover { opacity: 1; text-decoration: none; } .cs-style-3 figure { overflow: hidden; } .cs-style-3 figure img { -webkit-transition: transform 0.4s linear; -moz-transition: transform 0.4s linear; -o-transition: transform 0.4s linear; -ms-transition: transform 0.4s linear; transition: transform 0.4s linear; } .cs-style-3 figure:hover img, .cs-style-3 figure.cs-hover img { -webkit-transform: translateY(-50px); -moz-transform: translateY(-50px); -ms-transform: translateY(-50px); transform: translateY(-50px); } .cs-style-3 figcaption { height: 50px; width: 100%; top: auto; bottom: 0; opacity: 0; -webkit-transform: translateY(100%); -moz-transform: translateY(100%); -ms-transform: translateY(100%); transform: translateY(100%); -webkit-transition: transform 0.4s linear; -moz-transition: transform 0.4s linear; -o-transition: transform 0.4s linear; -ms-transition: transform 0.4s linear; transition: transform 0.4s linear; -webkit-transition: opacity 0.1s linear; -moz-transition: opacity 0.1s linear; -o-transition: opacity 0.1s linear; -ms-transition: opacity 0.1s linear; transition: opacity 0.1s linear; } .cs-style-3 figure:hover figcaption, .cs-style-3 figure.cs-hover figcaption { opacity: 1; -webkit-transform: translateY(0px); -moz-transform: translateY(0px); -ms-transform: translateY(0px); transform: translateY(0px); -webkit-transition: -webkit-transform 0.4s, opacity 0.1s; -moz-transition: -moz-transform 0.4s, opacity 0.1s; transition: transform 0.4s, opacity 0.1s; } .cs-style-3 figcaption a.external { bottom: 0; color: #FFFFFF; display: block; height: 50px; position: absolute; left: 0; border-left: 1px solid #21C2F8; text-align: center; width: 25%; } .cs-style-3 figcaption a.zoom { bottom: 0; color: #FFFFFF; display: block; height: 50px; position: absolute; left: 25%; border-left: 1px solid #21C2F8; text-align: center; width: 25%; } .cs-style-3 figcaption .attribute-widgets { display: none; } .cs-style-3 figcaption .btn-info { bottom: 0; color: #FFFFFF; display: block; height: 50px; position: absolute; right: 0; border-left: 1px solid #21C2F8; text-align: center; text-transform: uppercase; width: 50%; } .cs-style-3 i { font-size: 14px; } .cs-style-3 figcaption .btn-info:hover, .cs-style-3 figcaption a.zoom:hover, .cs-style-3 figcaption a.external:hover { background: #292723 !important; } .onsale { bottom: auto; color: #FFFFFF; height: 50px; left: 20px; margin: 0; padding: 0; position: absolute; right: auto; text-align: left; top: 20px; width: 50px; z-index: 1; -webkit-border-radius: 500px; -moz-border-radius: 500px; border-radius: 500px; line-height: 50px; text-align: center; background-color: #21C2F8; } .price-detail { padding-bottom: 5px; color: #21C2F8; } .product_title h3 { font-size: 18px; padding: 15px 0 0; margin-bottom: 8px; } .product_title a { color: #292723; font-weight: 400; } #calculate input { margin-top: 10px; } .product-details-wrap { padding-bottom: 60px; } .product-content .price1 { overflow: auto; padding: 5px 5px 5px; margin-bottom: 0; font-size: 28px; font-weight: normal; } .product-content .price1 .price1-old { font-size: 17px; text-decoration: line-through; } .product-content .price1 .price1-new { font-weight: 600; font-size: 25px; color: #21C2F8; } .product-content .price1 .price1-tax { font-size: 12px; font-weight: normal; } .product-content .price1 .reward { font-size: 12px; margin: 10px 0; font-weight: normal; display: block; } .product-content .price1 .discount { font-weight: normal; font-size: 12px; } .product-content select { width: 100%; } .product-content .form-submit { margin: 14px 0 14px 10px; } .product-content .commerce-add-to-cart .form-type-select, .product-content .commerce-add-to-cart .form-type-textfield { float: left; } .product-content .general { padding-top: 15px; } div.thumbnails { padding-top: 10px; zoom: 1; } div.thumbnails a { float: left; width: 30%; margin-right: 4.9%; margin-top: 5px; } div.thumbnails a img { width: 100%; height: auto; } div.thumbnails a:nth-child(3n + 3) { margin-right: 0; } div.thumbnails a:nth-child(3n + 1) { clear: both; } .commerce-add-to-cart select, .commerce-add-to-cart input[type="text"] { color: #333333; height: 30px; line-height: 30px; margin: 0; padding: 5px; width: 200px; } .commerce-add-to-cart label { font-weight: normal; line-height: 1; margin: 8px 10px 8px 5px; width: 52px; } .rating { text-align: center; } .rating i { color: #21C2F8; padding-right: 3px; } #comments_wrapper .comment-avatar img { background-color: #FFFFFF; border: 1px solid #EFEFEF; border-radius: 0; display: inline-block; height: auto; line-height: 1.42857; max-width: 100%; padding: 9px; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; -ms-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } .page-cart .view-commerce-cart-form .views-table { width: 100%; border: 1px solid #DDDDDD; } .page-cart .view-commerce-cart-form .views-table tr.odd, .page-cart .view-commerce-cart-form .views-table tr.even { background: none; } .page-cart .view-commerce-cart-form .delete-line-item { background: url("../images/remove.png") repeat scroll 0 0 #AAAAAA; border-radius: 100px; border-style: solid; border-width: 1px; display: block; height: 18px; margin: 10px; padding-left: 0 !important; text-indent: -9999px; width: 18px; } .page-cart .view-commerce-cart-form #edit-submit { margin-right: 10px; } .view-commerce-cart-block .cart_list { list-style: none; margin: 0; padding: 0; } .view-commerce-cart-block .cart_list li { list-style-type: none; margin: 0 0 10px 0; } .view-commerce-cart-block .cart_list li.views-row { clear: both; } .view-commerce-cart-block .cart_list li img { float: right; background-color: #FFFFFF; border: 1px solid #EFEFEF; border-radius: 0; display: inline-block; height: auto; line-height: 1.42857; max-width: 100%; padding: 9px; margin-bottom: 10px; -webkit-transition: all 0.2s ease-in-out; -moz-transition: all 0.2s ease-in-out; -o-transition: all 0.2s ease-in-out; -ms-transition: all 0.2s ease-in-out; transition: all 0.2s ease-in-out; } .view-commerce-cart-block .cart_list li img:hover { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; filter: alpha(opacity=60); -moz-opacity: 0.6; -khtml-opacity: 0.6; opacity: 0.6; } .view-commerce-cart-block .cart_list li a { color: #21C2F8; } .view-commerce-cart-block .cart_list li .sub-total { margin-top: 12px; } .view-commerce-cart-block .view-footer { clear: both; } .view-commerce-cart-block .view-footer .line-item-total { margin-bottom: 20px; } .view-commerce-cart-block .view-footer ul li a { background: #21C2F8; padding: 3px 10px; color: #FFF; font-size: 12px; } .view-top-products-rating ul { list-style: none; } .view-top-products-rating ul li { list-style-type: none; margin: 0 0 20px 0; } .view-top-products-rating .valign > div { display: table-cell; vertical-align: top; } .view-top-products-rating .valign .recent_post_img img { width: 75px; margin: 0 10px 0 0; -webkit-transition: opacity 0.2s ease-in-out; -moz-transition: opacity 0.2s ease-in-out; -o-transition: opacity 0.2s ease-in-out; -ms-transition: opacity 0.2s ease-in-out; transition: opacity 0.2s ease-in-out; } .view-top-products-rating .valign .recent_post_img img:hover { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; filter: alpha(opacity=60); -moz-opacity: 0.6; -khtml-opacity: 0.6; opacity: 0.6; } .view-top-products-rating .valign h4 { font-size: 14px !important; margin-bottom: 0 !important; padding-bottom: 0 !important; } .view-top-products-rating .valign h4 a { color: #83939C; } .view-top-products-rating .valign .rating { text-align: left; } .view-bestsellers ul { list-style: none; } .view-bestsellers ul li { list-style-type: none; margin-left: 0; clear: left; min-height: 120px; } .view-bestsellers ul li img { float: left; width: 75px; margin: 0 10px 0 0; -webkit-transition: opacity 0.2s ease-in-out; -moz-transition: opacity 0.2s ease-in-out; -o-transition: opacity 0.2s ease-in-out; -ms-transition: opacity 0.2s ease-in-out; transition: opacity 0.2s ease-in-out; } .view-bestsellers ul li img:hover { -ms-filter: "progid:DXImageTransform.Microsoft.Alpha(Opacity=60)"; filter: alpha(opacity=60); -moz-opacity: 0.6; -khtml-opacity: 0.6; opacity: 0.6; } .view-bestsellers ul li .views-field-title { font-size: 14px; font-weight: 600; color: #83939C; } .views-table { width: 100%; border: 1px solid #DDDDDD; } .views-table tr, .views-table th { background: none; } .views-table tr td, .views-table th td { padding: 8px; border: 1px solid #DDDDDD; } #commerce-checkout-form-checkout legend, #commerce-shipping-service-ajax-wrapper legend { border: 1px solid #545454; border-radius: 3px; padding: 16px; } #commerce-checkout-form-checkout legend span, #commerce-checkout-form-checkout legend a, #commerce-shipping-service-ajax-wrapper legend span, #commerce-shipping-service-ajax-wrapper legend a { font-size: 18px; font-weight: 600; padding-left: 10px; } #commerce-checkout-form-checkout legend span:hover, #commerce-checkout-form-checkout legend a:hover, #commerce-shipping-service-ajax-wrapper legend span:hover, #commerce-shipping-service-ajax-wrapper legend a:hover { color: #21C2F8; } #commerce-checkout-form-checkout legend:hover, #commerce-shipping-service-ajax-wrapper legend:hover { border-color: #21C2F8; } #commerce-checkout-form-checkout .form-item, #commerce-shipping-service-ajax-wrapper .form-item { width: 100%; } #commerce-checkout-form-checkout .form-text, #commerce-checkout-form-checkout select, #commerce-shipping-service-ajax-wrapper .form-text, #commerce-shipping-service-ajax-wrapper select { -webkit-box-shadow: 0 1px 1px rgba(0,0,0,0.075); -moz-box-shadow: 0 1px 1px rgba(0,0,0,0.075); box-shadow: 0 1px 1px rgba(0,0,0,0.075); color: #656565; display: block; font-size: 12px; height: 34px; line-height: 1.42857; margin-bottom: 10px; padding: 6px 12px; -webkit-transition: border-color 0.15s ease-in-out; -moz-transition: border-color 0.15s ease-in-out; -o-transition: border-color 0.15s ease-in-out; -ms-transition: border-color 0.15s ease-in-out; transition: border-color 0.15s ease-in-out; -webkit-transition: box-shadow 0.15s ease-in-out; -moz-transition: box-shadow 0.15s ease-in-out; -o-transition: box-shadow 0.15s ease-in-out; -ms-transition: box-shadow 0.15s ease-in-out; transition: box-shadow 0.15s ease-in-out; vertical-align: middle; width: 100%; } #commerce-checkout-form-checkout table.commerce-price-formatted-components, #commerce-shipping-service-ajax-wrapper table.commerce-price-formatted-components { margin-bottom: 10px; } #commerce-checkout-form-checkout table.commerce-price-formatted-components tbody, #commerce-shipping-service-ajax-wrapper table.commerce-price-formatted-components tbody { border: none; } #commerce-checkout-form-checkout table.commerce-price-formatted-components tr, #commerce-shipping-service-ajax-wrapper table.commerce-price-formatted-components tr { border: none; background: none; } table.checkout-review { width: 100%; } table.checkout-review tbody { border: none; } table.checkout-review tr { border: none; background: none; } .checkout-buttons { text-align: right; } .checkout-buttons .button-operator { padding: 0 10px 0 10px; } #section-top.style1 { background-color: #3FCAF9; } #section-top.style1 span, #section-top.style1 a, #section-top.style1 p { color: #fff !important; } #section-top.style1 li { border-color: #21C2F8; } #section-top.style2 { background-color: #292723; } #section-top.style2 a, #section-top.style2 p { color: #fff !important; } #section-top.style2 .callus span { color: #21C2F8 !important; } #section-top.style2 li { border-color: #383838; } body[class*=preset-dark] { color: #D3D3D3; background-color: #292929 !important; } body[class*=preset-dark] #comments_wrapper #comment-form .form-text, body[class*=preset-dark] #comments_wrapper #comment-form .form-textarea { background-color: #363636; border-color: #222222; } body[class*=preset-dark] hr { color: #545454; } body[class*=preset-dark] .bordertop { border-top: 1px solid #545454; } body[class*=preset-dark] #section-header .dexp-menu ul li a, body[class*=preset-dark] #section-header .dexp-menu ul li span.nolink { color: #D3D3D3 !important; } body[class*=preset-dark] #section-header .dexp-menu ul li a:hover, body[class*=preset-dark] #section-header .dexp-menu ul li a.active, body[class*=preset-dark] #section-header .dexp-menu ul li span.nolink:hover, body[class*=preset-dark] #section-header .dexp-menu ul li span.nolink.active { color: #21C2F8 !important; } body[class*=preset-dark] #section-header .dexp-menu ul li ul { background-color: #292929; border: solid 1px #292929; } body[class*=preset-dark] #section-header .dexp-menu ul li ul li { border: none; } body[class*=preset-dark] #section-header .dexp-menu ul li ul li a, body[class*=preset-dark] #section-header .dexp-menu ul li ul li span { color: #D3D3D3 !important; } body[class*=preset-dark] #section-header .dexp-menu ul li ul li a:before, body[class*=preset-dark] #section-header .dexp-menu ul li ul li span:before { content: ""; font-family: "FontAwesome"; font-size: 13px; padding-right: 5px; top: 2px; } body[class*=preset-dark] section.dexp-section { background-color: #292929; } body[class*=preset-dark] #section-top { border-bottom: 1px solid #2F2F2F; } body[class*=preset-dark] #section-header { background-color: #323232; border-bottom: 1px solid #2F2F2F; } body[class*=preset-dark].boxed { background: url("../images/boxed_dark_bg.png"); } body[class*=preset-dark].boxed .dexp-body-inner { box-shadow: 0 0 10px rgba(0,0,0,0.25); } body[class*=preset-dark] .bigtitle .block-subtitle { color: #FFFFFF; } body[class*=preset-dark] .dexp-shortcodes-box.box-circle:not(.parallax) .box-icon { background-color: transparent; } body[class*=preset-dark] .pricing_details .pricing-box .jtbtn { border-color: #21C2F8; color: #FFFFFF !important; } body[class*=preset-dark] .pricing_details .pricing-box:hover .jtbtn { background-color: #343434; border-color: #343434; } body[class*=preset-dark] .pricing_details .pricing-box:hover .price { background-color: #343434; } body[class*=preset-dark] .panel-group .panel { border-radius: 0; } body[class*=preset-dark] .panel-group .panel .panel-heading { background-color: #292929; border: 1px solid #545454; border-radius: 3px; } body[class*=preset-dark] .panel-group .panel .panel-heading .panel-title:after { color: #FFF; } body[class*=preset-dark] .panel-group .panel .panel-heading .panel-title a { color: #FFF; } body[class*=preset-dark] .panel-group .panel .panel-heading:hover { border-color: #21C2F8; } body[class*=preset-dark] .panel-group .panel .panel-heading:hover .panel-title:after, body[class*=preset-dark] .panel-group .panel .panel-heading:hover a { color: #21C2F8; } body[class*=preset-dark] .panel-group .panel .panel-body { border: none !important; } body[class*=preset-dark] .skill-bar .skill-bar-title { color: #FFF; } body[class*=preset-dark] .blog_wrap .title .post_date { border-color: #fff; } body[class*=preset-dark] .blog_wrap .title .post_date, body[class*=preset-dark] .blog_wrap .title h3 a, body[class*=preset-dark] .blog_wrap .title i { color: #fff; } body[class*=preset-dark] .contact-form .form-text, body[class*=preset-dark] .contact-form .form-textarea, body[class*=preset-dark] .contact-form .form-checkbox, body[class*=preset-dark] form .form-text, body[class*=preset-dark] form .form-textarea, body[class*=preset-dark] form .form-checkbox { background-color: #363636; border: solid 1px #222222; color: #656565; } body[class*=preset-dark] .form-control { background-color: #363636; border: solid 1px #222222; color: #656565; } body[class*=preset-dark] .box-hexagon strong { color: #fff; } body[class*=preset-dark] .copyright { color: #fff; } body[class*=preset-dark] .nav-tabs { border-bottom: 1px solid #454545; } body[class*=preset-dark] .nav-tabs li a { border: 1px solid #454545; border-right: none; } body[class*=preset-dark] .nav-tabs li a:hover { color: #FFF; border: 1px solid #454545; } body[class*=preset-dark] .nav-tabs li.active a { color: #656565; background-color: transparent; border: 1px solid #454545; border-right: none; } body[class*=preset-dark] .nav-tabs li:first-child { border-left: none; } body[class*=preset-dark] .nav-tabs li:last-child { border-right: 1px solid #454545; } body[class*=preset-dark] .tab-content { background: none !important; border-bottom: none !important; border-left: none !important; border-right: none !important; padding: 0 !important; } body[class*=preset-dark] .tab-content .tab-pane { background: none repeat scroll 0 0 #343434; border-bottom: 1px solid #454545; border-left: 1px solid #454545; border-right: 1px solid #454545; padding: 20px; } body[class*=preset-dark] .dexp_tab_wrapper.vertical { background: url("../images/dark-fc.png") repeat-y scroll 0 0 rgba(0,0,0,0) !important; border: 1px solid #454545 !important; padding-bottom: 0px !important; } body[class*=preset-dark] .dexp_tab_wrapper.vertical li a { border-bottom: 1px solid #454545; border-left: none !important; border-right: none !important; border-top: none !important; } body[class*=preset-dark] .dexp_tab_wrapper.vertical li.active a { border-bottom: 1px solid #454545 !important; } body[class*=preset-dark] .dexp_tab_wrapper.vertical li.last.active a { border-bottom-color: #454545 !important; } body[class*=preset-dark] .dexp_tab_wrapper.vertical .tab-pane { border: none !important; } body[class*=preset-dark] .rating-block, body[class*=preset-dark] .greybg .rating-block { border-color: #2F2F2F !important; background: transparent !important; } body[class*=preset-dark] .rating-block p, body[class*=preset-dark] .greybg .rating-block p { color: #D3D3D3; } body[class*=preset-dark] .rating-block:hover { background-color: #21C2F8 !important; } body[class*=preset-dark] .rating-block:hover p, body[class*=preset-dark] .rating-block:hover a, body[class*=preset-dark] .rating-block:hover span { color: #fff !important; } body[class*=preset-dark] .box-custom .serviceicon { background-color: #343434; border-color: #545454; } body[class*=preset-dark] .blog-columns { background: none repeat scroll 0 0 #292929; border: 1px solid #545454; } body[class*=preset-dark] .blog-columns .blog-content h3 { border-bottom: 1px solid #545454; } body[class*=preset-dark] .blog-columns .blog-content h3 a { color: #FFFFFF !important; } body[class*=preset-dark] .blog-columns .blog-content i { color: #FFFFFF !important; } body[class*=preset-dark] .comment-wrapper .comment-content { background: none repeat scroll 0 0 #292929 !important; border: 1px solid #545454 !important; } body[class*=preset-dark] .comment-wrapper .comment-avatar img { padding: 0 !important; background-color: transparent !important; border-color: transparent !important; } body[class*=preset-dark] .product_title a { color: #fff !important; } body[class*=preset-dark] .social li, body[class*=preset-dark] .callus li { border-left: 1px solid #2F2F2F; } body[class*=preset-dark] .social li:last-child, body[class*=preset-dark] .callus li:last-child { border-right: 1px solid #2F2F2F; } body[class*=preset-dark] #section-main-content { background-color: #292929 !important; } body[class*=preset-dark] .forum-table { background: transparent !important; } body[class*=preset-dark] .forum-table th { color: #FFFFFF !important; border: 1px solid #545454 !important; } body[class*=preset-dark] .forum-table th a { color: #FFFFFF !important; } body[class*=preset-dark] .forum-table tr { border: 1px solid #545454 !important; } body[class*=preset-dark] .forum-table tr td { border: 1px solid #545454 !important; } body[class*=preset-dark] .forum-table-name { color: #FFFFFF !important; } body[class*=preset-dark] .forum-table-superheader { background: transparent !important; border: 1px solid #545454 !important; } body[class*=preset-dark] #commerce-checkout-form-checkout legend span, body[class*=preset-dark] #commerce-checkout-form-checkout legend a { color: #FFF; } body[class*=preset-dark] #commerce-checkout-form-checkout legend span:hover, body[class*=preset-dark] #commerce-checkout-form-checkout legend a:hover { color: #21C2F8; } body[class*=preset-dark] #section-copyright { background: #292723 !important; color: #FFF; } body[class*=preset-dark] #section-copyright a { color: #FFF; } body[class*=preset-dark] #section-copyright a.active-trail, body[class*=preset-dark] #section-copyright a:hover { color: #21C2F8; } body[class*=preset-dark] h3.portfolio-title a { color: #FFF; } body[class*=preset-dark] .forum-post-info, body[class*=preset-dark] .forum-post-wrapper, body[class*=preset-dark] .forum-post-panel-main, body[class*=preset-dark] .forum-post, body[class*=preset-dark] .forum-post-title, body[class*=preset-dark] .forum-post-footer { background: transparent !important; border-color: #545454 !important; } body[class*=preset-dark] .forum-post-info { border-top: none; } body[class*=preset-dark] .forum-post-info a, body[class*=preset-dark] .forum-post-info .forum-posted-on, body[class*=preset-dark] .forum-post-info span { color: #fff !important; } body[class*=preset-dark] #forum-statistics-header, body[class*=preset-dark] #forum-statistics-active-body, body[class*=preset-dark] #forum-statistics-statistics-body { background: transparent !important; border-top: none; color: #FFF; } #block-dexp-quicksettings-dexp-quicksettings { background: #FFF; position: fixed; left: -207px; -webkit-transition: left 0.5s linear; -moz-transition: left 0.5s linear; -o-transition: left 0.5s linear; -ms-transition: left 0.5s linear; transition: left 0.5s linear; top: 96px; z-index: 999; box-shadow: 0 0 3px 0 rgba(0,0,0,0.08); } #block-dexp-quicksettings-dexp-quicksettings h2.block-title { font-size: 14px; font-weight: bold; line-height: 48px; text-align: center; color: #404040; margin: 0; } #block-dexp-quicksettings-dexp-quicksettings.open { left: 0; } #block-dexp-quicksettings-dexp-quicksettings .content { padding: 2px 18px 10px; width: 205px; } #block-dexp-quicksettings-dexp-quicksettings h3 { color: #848688; font-size: 13px; margin: 5px 0 -5px 1px; line-height: 30px; } #block-dexp-quicksettings-dexp-quicksettings select.form-select { border-radius: 2px; color: #848688; cursor: pointer; font-size: 13px; margin: 2px 0 10px 2px; padding: 5px; width: 164px; } #block-dexp-quicksettings-dexp-quicksettings ul.presets, #block-dexp-quicksettings-dexp-quicksettings ul.dexp_background { margin: 0; padding: 0; } #block-dexp-quicksettings-dexp-quicksettings ul.presets li, #block-dexp-quicksettings-dexp-quicksettings ul.dexp_background li { display: inline-block; margin: 4px 2px 0; } #block-dexp-quicksettings-dexp-quicksettings ul.presets li span, #block-dexp-quicksettings-dexp-quicksettings ul.dexp_background li span { cursor: pointer; width: 20px; height: 20px; display: block; border-radius: 2px; -webkit-box-shadow: -2px 2px 2px -1px rgba(0,0,0,0.75); -moz-box-shadow: -2px 2px 2px -1px rgba(0,0,0,0.75); box-shadow: -2px 2px 2px -1px rgba(0,0,0,0.75); } #block-dexp-quicksettings-dexp-quicksettings ul.presets li[class^=white] span, #block-dexp-quicksettings-dexp-quicksettings ul.dexp_background li[class^=white] span { background-image: url(../images/white-preset.png); } #block-dexp-quicksettings-dexp-quicksettings ul.presets li[class^=dark] span, #block-dexp-quicksettings-dexp-quicksettings ul.dexp_background li[class^=dark] span { background-image: url(../images/dark-preset.png); } #block-dexp-quicksettings-dexp-quicksettings .quicksettings_toggle { box-shadow: 0 0 3px 0 rgba(0,0,0,0.08); background: url("../images/switcher.gif") no-repeat scroll 10px center #FFFFFF; border-color: #EEEEEE; border-radius: 0 2px 2px 0; border-style: solid; border-width: 1px 1px 1px 0; display: block; height: 44px; position: absolute; right: -44px; text-indent: -9999px; top: 0px; width: 44px; cursor: pointer; } body.rtl .panel-group .panel-title:after { float: left; } body.rtl .ImageWrapper .StyleSc span:nth-of-type(2) { right: auto; } body.rtl .menu ul li a, body.rtl .menu ul li span { text-align: right; } body.rtl .dexp-dropdown > ul ul ul { left: -200px; width: 200px; } body.rtl .boder-icon .dexp-twitter .sp-text { padding-right: 50px; padding-left: 0; text-align: right; } body.rtl .boder-icon .dexp-twitter .sp-text:before { left: auto; right: 0; } body.rtl .boder-icon .dexp-twitter .author { padding-left: 0; padding-right: 50px; text-align: right; } body.rtl .dexp-shortcodes-box.box-top .box-icon { float: right; margin: 3px 0px 10px 15px; } body.rtl .dexp-shortcodes-box.box-top h3 { text-align: right; } body.rtl .blog_wrap .post_date { float: right; margin-right: 0; margin-left: 10px; }
mikeusry/lad
sites/all/themes/jollyness_sub/assets/css/style-darkblue.css
CSS
gpl-2.0
207,439
#ifndef _ASM_WORD_AT_A_TIME_H #define _ASM_WORD_AT_A_TIME_H /* */ #ifdef CONFIG_64BIT /* */ static inline long count_masked_bytes(unsigned long mask) { return mask*0x0001020304050608ul >> 56; } #else /* */ /* */ static inline long count_masked_bytes(long mask) { /* */ long a = (0x0ff0001+mask) >> 23; /* */ return a & mask; } #endif #define REPEAT_BYTE(x) ((~0ul / 0xff) * (x)) /* */ static inline unsigned long has_zero(unsigned long a) { return ((a - REPEAT_BYTE(0x01)) & ~a) & REPEAT_BYTE(0x80); } /* */ static inline unsigned long load_unaligned_zeropad(const void *addr) { unsigned long ret, dummy; asm( "1:\tmov %2,%0\n" "2:\n" ".section .fixup,\"ax\"\n" "3:\t" "lea %2,%1\n\t" "and %3,%1\n\t" "mov (%1),%0\n\t" "leal %2,%%ecx\n\t" "andl %4,%%ecx\n\t" "shll $3,%%ecx\n\t" "shr %%cl,%0\n\t" "jmp 2b\n" ".previous\n" _ASM_EXTABLE(1b, 3b) :"=&r" (ret),"=&c" (dummy) :"m" (*(unsigned long *)addr), "i" (-sizeof(unsigned long)), "i" (sizeof(unsigned long)-1)); return ret; } #endif /* */
holyangel/LGE_G3
arch/x86/include/asm/word-at-a-time.h
C
gpl-2.0
1,932
/* * drivers/input/touchscreen/zt8031.h * * (C) Copyright 2007-2012 * Allwinner Technology Co., Ltd. <www.allwinnertech.com> * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software Foundation; either version 2 of * the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, * MA 02111-1307 USA */ #ifndef __LINUX_ZT_TS_H__ #define __LINUX_ZT_TS_H__ #include <mach/sys_config.h> #include <mach/irqs.h> #include <linux/i2c.h> #include <linux/i2c/tsc2007.h> // gpio base address #define PIO_BASE_ADDRESS (0x01c20800) #define PIO_RANGE_SIZE (0x400) #define IRQ_EINT21 (21) #define IRQ_EINT29 (29) #define IRQ_EINT25 (25) #define TS_POLL_DELAY 10/* ms delay between samples */ #define TS_POLL_PERIOD 10 /* ms delay between samples */ #define GPIO_ENABLE #define SYSCONFIG_GPIO_ENABLE #define PIO_INT_STAT_OFFSET (0x214) #define PIO_INT_CTRL_OFFSET (0x210) #define PIO_INT_CFG2_OFFSET (0x208) #define PIO_INT_CFG3_OFFSET (0x20c) #define PIO_PN_DAT_OFFSET(n) ((n)*0x24 + 0x10) //#define PIOI_DATA (0x130) #define PIOH_DATA (0x10c) #define PIOI_CFG3_OFFSET (0x12c) #define PRESS_DOWN 1 #define FREE_UP 0 #define TS_RESET_LOW_PERIOD (1) #define TS_INITIAL_HIGH_PERIOD (100) #define TS_WAKEUP_LOW_PERIOD (10) #define TS_WAKEUP_HIGH_PERIOD (10) #define IRQ_NO (IRQ_EINT25) struct aw_platform_ops{ int irq; bool pendown; int (*get_pendown_state)(void); void (*clear_penirq)(void); int (*set_irq_mode)(void); int (*set_gpio_mode)(void); int (*judge_int_occur)(void); int (*init_platform_resource)(void); void (*free_platform_resource)(void); int (*fetch_sysconfig_para)(void); void (*ts_reset)(void); void (*ts_wakeup)(void); }; #define ZT_NAME "zt8031" struct zt_ts_platform_data{ u16 intr; /* irq number */ }; #define PIOA_CFG1_REG (gpio_addr+0x4) #define PIOA_DATA (gpio_addr+0x10) #define PIOI_DATA (gpio_addr+0x130) #define POINT_DELAY (1) #define ZT8031_ADDR (0x90>>1) #define ZT8031_MEASURE_TEMP0 (0x0 << 4) #define ZT8031_MEASURE_AUX (0x2 << 4) #define ZT8031_MEASURE_TEMP1 (0x4 << 4) #define ZT8031_ACTIVATE_XN (0x8 << 4) #define ZT8031_ACTIVATE_YN (0x9 << 4) #define ZT8031_ACTIVATE_YP_XN (0xa << 4) #define ZT8031_SETUP (0xb << 4) #define ZT8031_MEASURE_X (0xc << 4) #define ZT8031_MEASURE_Y (0xd << 4) #define ZT8031_MEASURE_Z1 (0xe << 4) #define ZT8031_MEASURE_Z2 (0xf << 4) #define ZT8031_POWER_OFF_IRQ_EN (0x0 << 2) #define ZT8031_ADC_ON_IRQ_DIS0 (0x1 << 2) #define ZT8031_ADC_OFF_IRQ_EN (0x2 << 2) #define ZT8031_ADC_ON_IRQ_DIS1 (0x3 << 2) #define ZT8031_12BIT (0x0 << 1) #define ZT8031_8BIT (0x1 << 1) #define MAX_12BIT ((1 << 12) - 1) #define ADC_ON_12BIT (ZT8031_12BIT | ZT8031_ADC_ON_IRQ_DIS1) #define READ_Y (ADC_ON_12BIT | ZT8031_MEASURE_Y) #define READ_Z1 (ADC_ON_12BIT | ZT8031_MEASURE_Z1) #define READ_Z2 (ADC_ON_12BIT | ZT8031_MEASURE_Z2) #define READ_X (ADC_ON_12BIT | ZT8031_MEASURE_X) #define PWRDOWN (ZT8031_12BIT | ZT8031_POWER_OFF_IRQ_EN) #define PWRUP (ZT8031_12BIT|ZT8031_ADC_ON_IRQ_DIS1) #define POINT_DELAY (1) #endif
christiantroy/linux-allwinner
drivers/input/touchscreen/zt8031.h
C
gpl-2.0
4,011
<?php /** * Cpdf * * http://www.ros.co.nz/pdf * * A PHP class to provide the basic functionality to create a pdf document without * any requirement for additional modules. * * Note that they companion class CezPdf can be used to extend this class and dramatically * simplify the creation of documents. * * IMPORTANT NOTE * there is no warranty, implied or otherwise with this software. * * LICENCE * This code has been placed in the Public Domain for all to enjoy. * * @author Wayne Munro <pdf@ros.co.nz> * @version 009 * @package Cpdf */ class Cpdf { /** * the current number of pdf objects in the document */ var $numObj=0; /** * this array contains all of the pdf objects, ready for final assembly */ var $objects = array(); /** * the objectId (number within the objects array) of the document catalog */ var $catalogId; /** * array carrying information about the fonts that the system currently knows about * used to ensure that a font is not loaded twice, among other things */ var $fonts=array(); /** * a record of the current font */ var $currentFont=''; /** * the current base font */ var $currentBaseFont=''; /** * the number of the current font within the font array */ var $currentFontNum=0; /** * */ var $currentNode; /** * object number of the current page */ var $currentPage; /** * object number of the currently active contents block */ var $currentContents; /** * number of fonts within the system */ var $numFonts=0; /** * current colour for fill operations, defaults to inactive value, all three components should be between 0 and 1 inclusive when active */ var $currentColour=array('r'=>-1,'g'=>-1,'b'=>-1); /** * current colour for stroke operations (lines etc.) */ var $currentStrokeColour=array('r'=>-1,'g'=>-1,'b'=>-1); /** * current style that lines are drawn in */ var $currentLineStyle=''; /** * an array which is used to save the state of the document, mainly the colours and styles * it is used to temporarily change to another state, the change back to what it was before */ var $stateStack = array(); /** * number of elements within the state stack */ var $nStateStack = 0; /** * number of page objects within the document */ var $numPages=0; /** * object Id storage stack */ var $stack=array(); /** * number of elements within the object Id storage stack */ var $nStack=0; /** * an array which contains information about the objects which are not firmly attached to pages * these have been added with the addObject function */ var $looseObjects=array(); /** * array contains infomation about how the loose objects are to be added to the document */ var $addLooseObjects=array(); /** * the objectId of the information object for the document * this contains authorship, title etc. */ var $infoObject=0; /** * number of images being tracked within the document */ var $numImages=0; /** * an array containing options about the document * it defaults to turning on the compression of the objects */ var $options=array('compression'=>1); /** * the objectId of the first page of the document */ var $firstPageId; /** * used to track the last used value of the inter-word spacing, this is so that it is known * when the spacing is changed. */ var $wordSpaceAdjust=0; /** * the object Id of the procset object */ var $procsetObjectId; /** * store the information about the relationship between font families * this used so that the code knows which font is the bold version of another font, etc. * the value of this array is initialised in the constuctor function. */ var $fontFamilies = array(); /** * track if the current font is bolded or italicised */ var $currentTextState = ''; /** * messages are stored here during processing, these can be selected afterwards to give some useful debug information */ var $messages=''; /** * the ancryption array for the document encryption is stored here */ var $arc4=''; /** * the object Id of the encryption information */ var $arc4_objnum=0; /** * the file identifier, used to uniquely identify a pdf document */ var $fileIdentifier=''; /** * a flag to say if a document is to be encrypted or not */ var $encrypted=0; /** * the ancryption key for the encryption of all the document content (structure is not encrypted) */ var $encryptionKey=''; /** * array which forms a stack to keep track of nested callback functions */ var $callback = array(); /** * the number of callback functions in the callback array */ var $nCallback = 0; /** * store label->id pairs for named destinations, these will be used to replace internal links * done this way so that destinations can be defined after the location that links to them */ var $destinations = array(); /** * store the stack for the transaction commands, each item in here is a record of the values of all the * variables within the class, so that the user can rollback at will (from each 'start' command) * note that this includes the objects array, so these can be large. */ var $checkpoint = ''; /** * class constructor * this will start a new document * @var array array of 4 numbers, defining the bottom left and upper right corner of the page. first two are normally zero. */ function Cpdf ($pageSize=array(0,0,612,792)){ $this->newDocument($pageSize); // also initialize the font families that are known about already $this->setFontFamily('init'); // $this->fileIdentifier = md5('xxxxxxxx'.time()); } /** * Document object methods (internal use only) * * There is about one object method for each type of object in the pdf document * Each function has the same call list ($id,$action,$options). * $id = the object ID of the object, or what it is to be if it is being created * $action = a string specifying the action to be performed, though ALL must support: * 'new' - create the object with the id $id * 'out' - produce the output for the pdf object * $options = optional, a string or array containing the various parameters for the object * * These, in conjunction with the output function are the ONLY way for output to be produced * within the pdf 'file'. */ /** *destination object, used to specify the location for the user to jump to, presently on opening */ function o_destination($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch($action){ case 'new': $this->objects[$id]=array('t'=>'destination','info'=>array()); $tmp = ''; switch ($options['type']){ case 'XYZ': case 'FitR': $tmp = ' '.$options['p3'].$tmp; case 'FitH': case 'FitV': case 'FitBH': case 'FitBV': $tmp = ' '.$options['p1'].' '.$options['p2'].$tmp; case 'Fit': case 'FitB': $tmp = $options['type'].$tmp; $this->objects[$id]['info']['string']=$tmp; $this->objects[$id]['info']['page']=$options['page']; } break; case 'out': $tmp = $o['info']; $res="\n".$id." 0 obj\n".'['.$tmp['page'].' 0 R /'.$tmp['string']."]\nendobj\n"; return $res; break; } } /** * set the viewer preferences */ function o_viewerPreferences($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'viewerPreferences','info'=>array()); break; case 'add': foreach($options as $k=>$v){ switch ($k){ case 'HideToolbar': case 'HideMenubar': case 'HideWindowUI': case 'FitWindow': case 'CenterWindow': case 'NonFullScreenPageMode': case 'Direction': $o['info'][$k]=$v; break; } } break; case 'out': $res="\n".$id." 0 obj\n".'<< '; foreach($o['info'] as $k=>$v){ $res.="\n/".$k.' '.$v; } $res.="\n>>\n"; return $res; break; } } /** * define the document catalog, the overall controller for the document */ function o_catalog($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'catalog','info'=>array()); $this->catalogId=$id; break; case 'outlines': case 'pages': case 'openHere': $o['info'][$action]=$options; break; case 'viewerPreferences': if (!isset($o['info']['viewerPreferences'])){ $this->numObj++; $this->o_viewerPreferences($this->numObj,'new'); $o['info']['viewerPreferences']=$this->numObj; } $vp = $o['info']['viewerPreferences']; $this->o_viewerPreferences($vp,'add',$options); break; case 'out': $res="\n".$id." 0 obj\n".'<< /Type /Catalog'; foreach($o['info'] as $k=>$v){ switch($k){ case 'outlines': $res.="\n".'/Outlines '.$v.' 0 R'; break; case 'pages': $res.="\n".'/Pages '.$v.' 0 R'; break; case 'viewerPreferences': $res.="\n".'/ViewerPreferences '.$o['info']['viewerPreferences'].' 0 R'; break; case 'openHere': $res.="\n".'/OpenAction '.$o['info']['openHere'].' 0 R'; break; } } $res.=" >>\nendobj"; return $res; break; } } /** * object which is a parent to the pages in the document */ function o_pages($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'pages','info'=>array()); $this->o_catalog($this->catalogId,'pages',$id); break; case 'page': if (!is_array($options)){ // then it will just be the id of the new page $o['info']['pages'][]=$options; } else { // then it should be an array having 'id','rid','pos', where rid=the page to which this one will be placed relative // and pos is either 'before' or 'after', saying where this page will fit. if (isset($options['id']) && isset($options['rid']) && isset($options['pos'])){ $i = array_search($options['rid'],$o['info']['pages']); if (isset($o['info']['pages'][$i]) && $o['info']['pages'][$i]==$options['rid']){ // then there is a match // make a space switch ($options['pos']){ case 'before': $k = $i; break; case 'after': $k=$i+1; break; default: $k=-1; break; } if ($k>=0){ for ($j=count($o['info']['pages'])-1;$j>=$k;$j--){ $o['info']['pages'][$j+1]=$o['info']['pages'][$j]; } $o['info']['pages'][$k]=$options['id']; } } } } break; case 'procset': $o['info']['procset']=$options; break; case 'mediaBox': $o['info']['mediaBox']=$options; // which should be an array of 4 numbers break; case 'font': $o['info']['fonts'][]=array('objNum'=>$options['objNum'],'fontNum'=>$options['fontNum']); break; case 'xObject': $o['info']['xObjects'][]=array('objNum'=>$options['objNum'],'label'=>$options['label']); break; case 'out': if (count($o['info']['pages'])){ $res="\n".$id." 0 obj\n<< /Type /Pages\n/Kids ["; foreach($o['info']['pages'] as $k=>$v){ $res.=$v." 0 R\n"; } $res.="]\n/Count ".count($this->objects[$id]['info']['pages']); if ((isset($o['info']['fonts']) && count($o['info']['fonts'])) || isset($o['info']['procset'])){ $res.="\n/Resources <<"; if (isset($o['info']['procset'])){ $res.="\n/ProcSet ".$o['info']['procset']." 0 R"; } if (isset($o['info']['fonts']) && count($o['info']['fonts'])){ $res.="\n/Font << "; foreach($o['info']['fonts'] as $finfo){ $res.="\n/F".$finfo['fontNum']." ".$finfo['objNum']." 0 R"; } $res.=" >>"; } if (isset($o['info']['xObjects']) && count($o['info']['xObjects'])){ $res.="\n/XObject << "; foreach($o['info']['xObjects'] as $finfo){ $res.="\n/".$finfo['label']." ".$finfo['objNum']." 0 R"; } $res.=" >>"; } $res.="\n>>"; if (isset($o['info']['mediaBox'])){ $tmp=$o['info']['mediaBox']; $res.="\n/MediaBox [".sprintf('%.3f',$tmp[0]).' '.sprintf('%.3f',$tmp[1]).' '.sprintf('%.3f',$tmp[2]).' '.sprintf('%.3f',$tmp[3]).']'; } } $res.="\n >>\nendobj"; } else { $res="\n".$id." 0 obj\n<< /Type /Pages\n/Count 0\n>>\nendobj"; } return $res; break; } } /** * define the outlines in the doc, empty for now */ function o_outlines($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'outlines','info'=>array('outlines'=>array())); $this->o_catalog($this->catalogId,'outlines',$id); break; case 'outline': $o['info']['outlines'][]=$options; break; case 'out': if (count($o['info']['outlines'])){ $res="\n".$id." 0 obj\n<< /Type /Outlines /Kids ["; foreach($o['info']['outlines'] as $k=>$v){ $res.=$v." 0 R "; } $res.="] /Count ".count($o['info']['outlines'])." >>\nendobj"; } else { $res="\n".$id." 0 obj\n<< /Type /Outlines /Count 0 >>\nendobj"; } return $res; break; } } /** * an object to hold the font description */ function o_font($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'font','info'=>array('name'=>$options['name'],'SubType'=>'Type1')); $fontNum=$this->numFonts; $this->objects[$id]['info']['fontNum']=$fontNum; // deal with the encoding and the differences if (isset($options['differences'])){ // then we'll need an encoding dictionary $this->numObj++; $this->o_fontEncoding($this->numObj,'new',$options); $this->objects[$id]['info']['encodingDictionary']=$this->numObj; } else if (isset($options['encoding'])){ // we can specify encoding here switch($options['encoding']){ case 'WinAnsiEncoding': case 'MacRomanEncoding': case 'MacExpertEncoding': $this->objects[$id]['info']['encoding']=$options['encoding']; break; case 'none': break; default: $this->objects[$id]['info']['encoding']='WinAnsiEncoding'; break; } } else { $this->objects[$id]['info']['encoding']='WinAnsiEncoding'; } // also tell the pages node about the new font $this->o_pages($this->currentNode,'font',array('fontNum'=>$fontNum,'objNum'=>$id)); break; case 'add': foreach ($options as $k=>$v){ switch ($k){ case 'BaseFont': $o['info']['name'] = $v; break; case 'FirstChar': case 'LastChar': case 'Widths': case 'FontDescriptor': case 'SubType': $this->addMessage('o_font '.$k." : ".$v); $o['info'][$k] = $v; break; } } break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Font\n/Subtype /".$o['info']['SubType']."\n"; $res.="/Name /F".$o['info']['fontNum']."\n"; $res.="/BaseFont /".$o['info']['name']."\n"; if (isset($o['info']['encodingDictionary'])){ // then place a reference to the dictionary $res.="/Encoding ".$o['info']['encodingDictionary']." 0 R\n"; } else if (isset($o['info']['encoding'])){ // use the specified encoding $res.="/Encoding /".$o['info']['encoding']."\n"; } if (isset($o['info']['FirstChar'])){ $res.="/FirstChar ".$o['info']['FirstChar']."\n"; } if (isset($o['info']['LastChar'])){ $res.="/LastChar ".$o['info']['LastChar']."\n"; } if (isset($o['info']['Widths'])){ $res.="/Widths ".$o['info']['Widths']." 0 R\n"; } if (isset($o['info']['FontDescriptor'])){ $res.="/FontDescriptor ".$o['info']['FontDescriptor']." 0 R\n"; } $res.=">>\nendobj"; return $res; break; } } /** * a font descriptor, needed for including additional fonts */ function o_fontDescriptor($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'fontDescriptor','info'=>$options); break; case 'out': $res="\n".$id." 0 obj\n<< /Type /FontDescriptor\n"; foreach ($o['info'] as $label => $value){ switch ($label){ case 'Ascent': case 'CapHeight': case 'Descent': case 'Flags': case 'ItalicAngle': case 'StemV': case 'AvgWidth': case 'Leading': case 'MaxWidth': case 'MissingWidth': case 'StemH': case 'XHeight': case 'CharSet': if (strlen($value)){ $res.='/'.$label.' '.$value."\n"; } break; case 'FontFile': case 'FontFile2': case 'FontFile3': $res.='/'.$label.' '.$value." 0 R\n"; break; case 'FontBBox': $res.='/'.$label.' ['.$value[0].' '.$value[1].' '.$value[2].' '.$value[3]."]\n"; break; case 'FontName': $res.='/'.$label.' /'.$value."\n"; break; } } $res.=">>\nendobj"; return $res; break; } } /** * the font encoding */ function o_fontEncoding($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': // the options array should contain 'differences' and maybe 'encoding' $this->objects[$id]=array('t'=>'fontEncoding','info'=>$options); break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Encoding\n"; if (!isset($o['info']['encoding'])){ $o['info']['encoding']='WinAnsiEncoding'; } if ($o['info']['encoding']!='none'){ $res.="/BaseEncoding /".$o['info']['encoding']."\n"; } $res.="/Differences \n["; $onum=-100; foreach($o['info']['differences'] as $num=>$label){ if ($num!=$onum+1){ // we cannot make use of consecutive numbering $res.= "\n".$num." /".$label; } else { $res.= " /".$label; } $onum=$num; } $res.="\n]\n>>\nendobj"; return $res; break; } } /** * the document procset, solves some problems with printing to old PS printers */ function o_procset($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'procset','info'=>array('PDF'=>1,'Text'=>1)); $this->o_pages($this->currentNode,'procset',$id); $this->procsetObjectId=$id; break; case 'add': // this is to add new items to the procset list, despite the fact that this is considered // obselete, the items are required for printing to some postscript printers switch ($options) { case 'ImageB': case 'ImageC': case 'ImageI': $o['info'][$options]=1; break; } break; case 'out': $res="\n".$id." 0 obj\n["; foreach ($o['info'] as $label=>$val){ $res.='/'.$label.' '; } $res.="]\nendobj"; return $res; break; } } /** * define the document information */ function o_info($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->infoObject=$id; $date='D:'.date('Ymd'); $this->objects[$id]=array('t'=>'info','info'=>array('Creator'=>'R and OS php pdf writer, http://www.ros.co.nz','CreationDate'=>$date)); break; case 'Title': case 'Author': case 'Subject': case 'Keywords': case 'Creator': case 'Producer': case 'CreationDate': case 'ModDate': case 'Trapped': $o['info'][$action]=$options; break; case 'out': if ($this->encrypted){ $this->encryptInit($id); } $res="\n".$id." 0 obj\n<<\n"; foreach ($o['info'] as $k=>$v){ $res.='/'.$k.' ('; if ($this->encrypted){ $res.=$this->filterText($this->ARC4($v)); } else { $res.=$this->filterText($v); } $res.=")\n"; } $res.=">>\nendobj"; return $res; break; } } /** * an action object, used to link to URLS initially */ function o_action($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': if (is_array($options)){ $this->objects[$id]=array('t'=>'action','info'=>$options,'type'=>$options['type']); } else { // then assume a URI action $this->objects[$id]=array('t'=>'action','info'=>$options,'type'=>'URI'); } break; case 'out': if ($this->encrypted){ $this->encryptInit($id); } $res="\n".$id." 0 obj\n<< /Type /Action"; switch($o['type']){ case 'ilink': // there will be an 'label' setting, this is the name of the destination $res.="\n/S /GoTo\n/D ".$this->destinations[(string)$o['info']['label']]." 0 R"; break; case 'URI': $res.="\n/S /URI\n/URI ("; if ($this->encrypted){ $res.=$this->filterText($this->ARC4($o['info'])); } else { $res.=$this->filterText($o['info']); } $res.=")"; break; } $res.="\n>>\nendobj"; return $res; break; } } /** * an annotation object, this will add an annotation to the current page. * initially will support just link annotations */ function o_annotation($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': // add the annotation to the current page $pageId = $this->currentPage; $this->o_page($pageId,'annot',$id); // and add the action object which is going to be required switch($options['type']){ case 'link': $this->objects[$id]=array('t'=>'annotation','info'=>$options); $this->numObj++; $this->o_action($this->numObj,'new',$options['url']); $this->objects[$id]['info']['actionId']=$this->numObj; break; case 'ilink': // this is to a named internal link $label = $options['label']; $this->objects[$id]=array('t'=>'annotation','info'=>$options); $this->numObj++; $this->o_action($this->numObj,'new',array('type'=>'ilink','label'=>$label)); $this->objects[$id]['info']['actionId']=$this->numObj; break; } break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Annot"; switch($o['info']['type']){ case 'link': case 'ilink': $res.= "\n/Subtype /Link"; break; } $res.="\n/A ".$o['info']['actionId']." 0 R"; $res.="\n/Border [0 0 0]"; $res.="\n/H /I"; $res.="\n/Rect [ "; foreach($o['info']['rect'] as $v){ $res.= sprintf("%.4f ",$v); } $res.="]"; $res.="\n>>\nendobj"; return $res; break; } } /** * a page object, it also creates a contents object to hold its contents */ function o_page($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->numPages++; $this->objects[$id]=array('t'=>'page','info'=>array('parent'=>$this->currentNode,'pageNum'=>$this->numPages)); if (is_array($options)){ // then this must be a page insertion, array shoudl contain 'rid','pos'=[before|after] $options['id']=$id; $this->o_pages($this->currentNode,'page',$options); } else { $this->o_pages($this->currentNode,'page',$id); } $this->currentPage=$id; //make a contents object to go with this page $this->numObj++; $this->o_contents($this->numObj,'new',$id); $this->currentContents=$this->numObj; $this->objects[$id]['info']['contents']=array(); $this->objects[$id]['info']['contents'][]=$this->numObj; $match = ($this->numPages%2 ? 'odd' : 'even'); foreach($this->addLooseObjects as $oId=>$target){ if ($target=='all' || $match==$target){ $this->objects[$id]['info']['contents'][]=$oId; } } break; case 'content': $o['info']['contents'][]=$options; break; case 'annot': // add an annotation to this page if (!isset($o['info']['annot'])){ $o['info']['annot']=array(); } // $options should contain the id of the annotation dictionary $o['info']['annot'][]=$options; break; case 'out': $res="\n".$id." 0 obj\n<< /Type /Page"; $res.="\n/Parent ".$o['info']['parent']." 0 R"; if (isset($o['info']['annot'])){ $res.="\n/Annots ["; foreach($o['info']['annot'] as $aId){ $res.=" ".$aId." 0 R"; } $res.=" ]"; } $count = count($o['info']['contents']); if ($count==1){ $res.="\n/Contents ".$o['info']['contents'][0]." 0 R"; } else if ($count>1){ $res.="\n/Contents [\n"; foreach ($o['info']['contents'] as $cId){ $res.=$cId." 0 R\n"; } $res.="]"; } $res.="\n>>\nendobj"; return $res; break; } } /** * the contents objects hold all of the content which appears on pages */ function o_contents($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch ($action){ case 'new': $this->objects[$id]=array('t'=>'contents','c'=>'','info'=>array()); if (strlen($options) && intval($options)){ // then this contents is the primary for a page $this->objects[$id]['onPage']=$options; } else if ($options=='raw'){ // then this page contains some other type of system object $this->objects[$id]['raw']=1; } break; case 'add': // add more options to the decleration foreach ($options as $k=>$v){ $o['info'][$k]=$v; } case 'out': $tmp=$o['c']; $res= "\n".$id." 0 obj\n"; if (isset($this->objects[$id]['raw'])){ $res.=$tmp; } else { $res.= "<<"; if (function_exists('gzcompress') && $this->options['compression']){ // then implement ZLIB based compression on this content stream $res.=" /Filter /FlateDecode"; $tmp = gzcompress($tmp); } if ($this->encrypted){ $this->encryptInit($id); $tmp = $this->ARC4($tmp); } foreach($o['info'] as $k=>$v){ $res .= "\n/".$k.' '.$v; } $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream"; } $res.="\nendobj\n"; return $res; break; } } /** * an image object, will be an XObject in the document, includes description and data */ function o_image($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch($action){ case 'new': // make the new object $this->objects[$id]=array('t'=>'image','data'=>$options['data'],'info'=>array()); $this->objects[$id]['info']['Type']='/XObject'; $this->objects[$id]['info']['Subtype']='/Image'; $this->objects[$id]['info']['Width']=$options['iw']; $this->objects[$id]['info']['Height']=$options['ih']; if (!isset($options['type']) || $options['type']=='jpg'){ if (!isset($options['channels'])){ $options['channels']=3; } switch($options['channels']){ case 1: $this->objects[$id]['info']['ColorSpace']='/DeviceGray'; break; default: $this->objects[$id]['info']['ColorSpace']='/DeviceRGB'; break; } $this->objects[$id]['info']['Filter']='/DCTDecode'; $this->objects[$id]['info']['BitsPerComponent']=8; } else if ($options['type']=='png'){ $this->objects[$id]['info']['Filter']='/FlateDecode'; $this->objects[$id]['info']['DecodeParms']='<< /Predictor 15 /Colors '.$options['ncolor'].' /Columns '.$options['iw'].' /BitsPerComponent '.$options['bitsPerComponent'].'>>'; if (strlen($options['pdata'])){ $tmp = ' [ /Indexed /DeviceRGB '.(strlen($options['pdata'])/3-1).' '; $this->numObj++; $this->o_contents($this->numObj,'new'); $this->objects[$this->numObj]['c']=$options['pdata']; $tmp.=$this->numObj.' 0 R'; $tmp .=' ]'; $this->objects[$id]['info']['ColorSpace'] = $tmp; if (isset($options['transparency'])){ switch($options['transparency']['type']){ case 'indexed': $tmp=' [ '.$options['transparency']['data'].' '.$options['transparency']['data'].'] '; $this->objects[$id]['info']['Mask'] = $tmp; break; } } } else { $this->objects[$id]['info']['ColorSpace']='/'.$options['color']; } $this->objects[$id]['info']['BitsPerComponent']=$options['bitsPerComponent']; } // assign it a place in the named resource dictionary as an external object, according to // the label passed in with it. $this->o_pages($this->currentNode,'xObject',array('label'=>$options['label'],'objNum'=>$id)); // also make sure that we have the right procset object for it. $this->o_procset($this->procsetObjectId,'add','ImageC'); break; case 'out': $tmp=$o['data']; $res= "\n".$id." 0 obj\n<<"; foreach($o['info'] as $k=>$v){ $res.="\n/".$k.' '.$v; } if ($this->encrypted){ $this->encryptInit($id); $tmp = $this->ARC4($tmp); } $res.="\n/Length ".strlen($tmp)." >>\nstream\n".$tmp."\nendstream\nendobj\n"; return $res; break; } } /** * encryption object. */ function o_encryption($id,$action,$options=''){ if ($action!='new'){ $o =& $this->objects[$id]; } switch($action){ case 'new': // make the new object $this->objects[$id]=array('t'=>'encryption','info'=>$options); $this->arc4_objnum=$id; // figure out the additional paramaters required $pad = chr(0x28).chr(0xBF).chr(0x4E).chr(0x5E).chr(0x4E).chr(0x75).chr(0x8A).chr(0x41).chr(0x64).chr(0x00).chr(0x4E).chr(0x56).chr(0xFF).chr(0xFA).chr(0x01).chr(0x08).chr(0x2E).chr(0x2E).chr(0x00).chr(0xB6).chr(0xD0).chr(0x68).chr(0x3E).chr(0x80).chr(0x2F).chr(0x0C).chr(0xA9).chr(0xFE).chr(0x64).chr(0x53).chr(0x69).chr(0x7A); $len = strlen($options['owner']); if ($len>32){ $owner = substr($options['owner'],0,32); } else if ($len<32){ $owner = $options['owner'].substr($pad,0,32-$len); } else { $owner = $options['owner']; } $len = strlen($options['user']); if ($len>32){ $user = substr($options['user'],0,32); } else if ($len<32){ $user = $options['user'].substr($pad,0,32-$len); } else { $user = $options['user']; } $tmp = $this->md5_16($owner); $okey = substr($tmp,0,5); $this->ARC4_init($okey); $ovalue=$this->ARC4($user); $this->objects[$id]['info']['O']=$ovalue; // now make the u value, phew. $tmp = $this->md5_16($user.$ovalue.chr($options['p']).chr(255).chr(255).chr(255).$this->fileIdentifier); $ukey = substr($tmp,0,5); $this->ARC4_init($ukey); $this->encryptionKey = $ukey; $this->encrypted=1; $uvalue=$this->ARC4($pad); $this->objects[$id]['info']['U']=$uvalue; $this->encryptionKey=$ukey; // initialize the arc4 array break; case 'out': $res= "\n".$id." 0 obj\n<<"; $res.="\n/Filter /Standard"; $res.="\n/V 1"; $res.="\n/R 2"; $res.="\n/O (".$this->filterText($o['info']['O']).')'; $res.="\n/U (".$this->filterText($o['info']['U']).')'; // and the p-value needs to be converted to account for the twos-complement approach $o['info']['p'] = (($o['info']['p']^255)+1)*-1; $res.="\n/P ".($o['info']['p']); $res.="\n>>\nendobj\n"; return $res; break; } } /** * ARC4 functions * A series of function to implement ARC4 encoding in PHP */ /** * calculate the 16 byte version of the 128 bit md5 digest of the string */ function md5_16($string){ $tmp = md5($string); $out=''; for ($i=0;$i<=30;$i=$i+2){ $out.=chr(hexdec(substr($tmp,$i,2))); } return $out; } /** * initialize the encryption for processing a particular object */ function encryptInit($id){ $tmp = $this->encryptionKey; $hex = dechex($id); if (strlen($hex)<6){ $hex = substr('000000',0,6-strlen($hex)).$hex; } $tmp.= chr(hexdec(substr($hex,4,2))).chr(hexdec(substr($hex,2,2))).chr(hexdec(substr($hex,0,2))).chr(0).chr(0); $key = $this->md5_16($tmp); $this->ARC4_init(substr($key,0,10)); } /** * initialize the ARC4 encryption */ function ARC4_init($key=''){ $this->arc4 = ''; // setup the control array if (strlen($key)==0){ return; } $k = ''; while(strlen($k)<256){ $k.=$key; } $k=substr($k,0,256); for ($i=0;$i<256;$i++){ $this->arc4 .= chr($i); } $j=0; for ($i=0;$i<256;$i++){ $t = $this->arc4[$i]; $j = ($j + ord($t) + ord($k[$i]))%256; $this->arc4[$i]=$this->arc4[$j]; $this->arc4[$j]=$t; } } /** * ARC4 encrypt a text string */ function ARC4($text){ $len=strlen($text); $a=0; $b=0; $c = $this->arc4; $out=''; for ($i=0;$i<$len;$i++){ $a = ($a+1)%256; $t= $c[$a]; $b = ($b+ord($t))%256; $c[$a]=$c[$b]; $c[$b]=$t; $k = ord($c[(ord($c[$a])+ord($c[$b]))%256]); $out.=chr(ord($text[$i]) ^ $k); } return $out; } /** * functions which can be called to adjust or add to the document */ /** * add a link in the document to an external URL */ function addLink($url,$x0,$y0,$x1,$y1){ $this->numObj++; $info = array('type'=>'link','url'=>$url,'rect'=>array($x0,$y0,$x1,$y1)); $this->o_annotation($this->numObj,'new',$info); } /** * add a link in the document to an internal destination (ie. within the document) */ function addInternalLink($label,$x0,$y0,$x1,$y1){ $this->numObj++; $info = array('type'=>'ilink','label'=>$label,'rect'=>array($x0,$y0,$x1,$y1)); $this->o_annotation($this->numObj,'new',$info); } /** * set the encryption of the document * can be used to turn it on and/or set the passwords which it will have. * also the functions that the user will have are set here, such as print, modify, add */ function setEncryption($userPass='',$ownerPass='',$pc=array()){ $p=bindec(11000000); $options = array( 'print'=>4 ,'modify'=>8 ,'copy'=>16 ,'add'=>32 ); foreach($pc as $k=>$v){ if ($v && isset($options[$k])){ $p+=$options[$k]; } else if (isset($options[$v])){ $p+=$options[$v]; } } // implement encryption on the document if ($this->arc4_objnum == 0){ // then the block does not exist already, add it. $this->numObj++; if (strlen($ownerPass)==0){ $ownerPass=$userPass; } $this->o_encryption($this->numObj,'new',array('user'=>$userPass,'owner'=>$ownerPass,'p'=>$p)); } } /** * should be used for internal checks, not implemented as yet */ function checkAllHere(){ } /** * return the pdf stream as a string returned from the function */ function output($debug=0){ if ($debug){ // turn compression off $this->options['compression']=0; } if ($this->arc4_objnum){ $this->ARC4_init($this->encryptionKey); } $this->checkAllHere(); $xref=array(); $content="%PDF-1.3\n%âãÏÓ\n"; // $content="%PDF-1.3\n"; $pos=strlen($content); foreach($this->objects as $k=>$v){ $tmp='o_'.$v['t']; $cont=$this->$tmp($k,'out'); $content.=$cont; $xref[]=$pos; $pos+=strlen($cont); } $content.="\nxref\n0 ".(count($xref)+1)."\n0000000000 65535 f \n"; foreach($xref as $p){ $content.=substr('0000000000',0,10-strlen($p)).$p." 00000 n \n"; } $content.="\ntrailer\n << /Size ".(count($xref)+1)."\n /Root 1 0 R\n /Info ".$this->infoObject." 0 R\n"; // if encryption has been applied to this document then add the marker for this dictionary if ($this->arc4_objnum > 0){ $content .= "/Encrypt ".$this->arc4_objnum." 0 R\n"; } if (strlen($this->fileIdentifier)){ $content .= "/ID[<".$this->fileIdentifier."><".$this->fileIdentifier.">]\n"; } $content .= " >>\nstartxref\n".$pos."\n%%EOF\n"; return $content; } /** * intialize a new document * if this is called on an existing document results may be unpredictable, but the existing document would be lost at minimum * this function is called automatically by the constructor function * * @access private */ function newDocument($pageSize=array(0,0,612,792)){ $this->numObj=0; $this->objects = array(); $this->numObj++; $this->o_catalog($this->numObj,'new'); $this->numObj++; $this->o_outlines($this->numObj,'new'); $this->numObj++; $this->o_pages($this->numObj,'new'); $this->o_pages($this->numObj,'mediaBox',$pageSize); $this->currentNode = 3; $this->numObj++; $this->o_procset($this->numObj,'new'); $this->numObj++; $this->o_info($this->numObj,'new'); $this->numObj++; $this->o_page($this->numObj,'new'); // need to store the first page id as there is no way to get it to the user during // startup $this->firstPageId = $this->currentContents; } /** * open the font file and return a php structure containing it. * first check if this one has been done before and saved in a form more suited to php * note that if a php serialized version does not exist it will try and make one, but will * require write access to the directory to do it... it is MUCH faster to have these serialized * files. * * @access private */ function openFont($font){ // assume that $font contains both the path and perhaps the extension to the file, split them $pos=strrpos($font,'/'); if ($pos===false){ $dir = './'; $name = $font; } else { $dir=substr($font,0,$pos+1); $name=substr($font,$pos+1); } if (substr($name,-4)=='.afm'){ $name=substr($name,0,strlen($name)-4); } $this->addMessage('openFont: '.$font.' - '.$name); if (file_exists($dir.'php_'.$name.'.afm')){ $this->addMessage('openFont: php file exists '.$dir.'php_'.$name.'.afm'); $tmp = file($dir.'php_'.$name.'.afm'); $this->fonts[$font]=unserialize($tmp[0]); if (!isset($this->fonts[$font]['_version_']) || $this->fonts[$font]['_version_']<1){ // if the font file is old, then clear it out and prepare for re-creation $this->addMessage('openFont: clear out, make way for new version.'); unset($this->fonts[$font]); } } if (!isset($this->fonts[$font]) && file_exists($dir.$name.'.afm')){ // then rebuild the php_<font>.afm file from the <font>.afm file $this->addMessage('openFont: build php file from '.$dir.$name.'.afm'); $data = array(); $file = file($dir.$name.'.afm'); foreach ($file as $rowA){ $row=trim($rowA); $pos=strpos($row,' '); if ($pos){ // then there must be some keyword $key = substr($row,0,$pos); switch ($key){ case 'FontName': case 'FullName': case 'FamilyName': case 'Weight': case 'ItalicAngle': case 'IsFixedPitch': case 'CharacterSet': case 'UnderlinePosition': case 'UnderlineThickness': case 'Version': case 'EncodingScheme': case 'CapHeight': case 'XHeight': case 'Ascender': case 'Descender': case 'StdHW': case 'StdVW': case 'StartCharMetrics': $data[$key]=trim(substr($row,$pos)); break; case 'FontBBox': $data[$key]=explode(' ',trim(substr($row,$pos))); break; case 'C': //C 39 ; WX 222 ; N quoteright ; B 53 463 157 718 ; $bits=explode(';',trim($row)); $dtmp=array(); foreach($bits as $bit){ $bits2 = explode(' ',trim($bit)); if (strlen($bits2[0])){ if (count($bits2)>2){ $dtmp[$bits2[0]]=array(); for ($i=1;$i<count($bits2);$i++){ $dtmp[$bits2[0]][]=$bits2[$i]; } } else if (count($bits2)==2){ $dtmp[$bits2[0]]=$bits2[1]; } } } if ($dtmp['C']>=0){ $data['C'][$dtmp['C']]=$dtmp; $data['C'][$dtmp['N']]=$dtmp; } else { $data['C'][$dtmp['N']]=$dtmp; } break; case 'KPX': //KPX Adieresis yacute -40 $bits=explode(' ',trim($row)); $data['KPX'][$bits[1]][$bits[2]]=$bits[3]; break; } } } $data['_version_']=1; $this->fonts[$font]=$data; $fp = fopen($dir.'php_'.$name.'.afm','w'); fwrite($fp,serialize($data)); fclose($fp); } else if (!isset($this->fonts[$font])){ $this->addMessage('openFont: no font file found'); // echo 'Font not Found '.$font; } } /** * if the font is not loaded then load it and make the required object * else just make it the current font * the encoding array can contain 'encoding'=> 'none','WinAnsiEncoding','MacRomanEncoding' or 'MacExpertEncoding' * note that encoding='none' will need to be used for symbolic fonts * and 'differences' => an array of mappings between numbers 0->255 and character names. * */ function selectFont($fontName,$encoding='',$set=1){ if (!isset($this->fonts[$fontName])){ // load the file $this->openFont($fontName); if (isset($this->fonts[$fontName])){ $this->numObj++; $this->numFonts++; $pos=strrpos($fontName,'/'); // $dir=substr($fontName,0,$pos+1); $name=substr($fontName,$pos+1); if (substr($name,-4)=='.afm'){ $name=substr($name,0,strlen($name)-4); } $options=array('name'=>$name); if (is_array($encoding)){ // then encoding and differences might be set if (isset($encoding['encoding'])){ $options['encoding']=$encoding['encoding']; } if (isset($encoding['differences'])){ $options['differences']=$encoding['differences']; } } else if (strlen($encoding)){ // then perhaps only the encoding has been set $options['encoding']=$encoding; } $fontObj = $this->numObj; $this->o_font($this->numObj,'new',$options); $this->fonts[$fontName]['fontNum']=$this->numFonts; // if this is a '.afm' font, and there is a '.pfa' file to go with it ( as there // should be for all non-basic fonts), then load it into an object and put the // references into the font object $basefile = substr($fontName,0,strlen($fontName)-4); if (file_exists($basefile.'.pfb')){ $fbtype = 'pfb'; } else if (file_exists($basefile.'.ttf')){ $fbtype = 'ttf'; } else { $fbtype=''; } $fbfile = $basefile.'.'.$fbtype; // $pfbfile = substr($fontName,0,strlen($fontName)-4).'.pfb'; // $ttffile = substr($fontName,0,strlen($fontName)-4).'.ttf'; $this->addMessage('selectFont: checking for - '.$fbfile); if (substr($fontName,-4)=='.afm' && strlen($fbtype) ){ $adobeFontName = $this->fonts[$fontName]['FontName']; // $fontObj = $this->numObj; $this->addMessage('selectFont: adding font file - '.$fbfile.' - '.$adobeFontName); // find the array of fond widths, and put that into an object. $firstChar = -1; $lastChar = 0; $widths = array(); foreach ($this->fonts[$fontName]['C'] as $num=>$d){ if (intval($num)>0 || $num=='0'){ if ($lastChar>0 && $num>$lastChar+1){ for($i=$lastChar+1;$i<$num;$i++){ $widths[] = 0; } } $widths[] = $d['WX']; if ($firstChar==-1){ $firstChar = $num; } $lastChar = $num; } } // also need to adjust the widths for the differences array if (isset($options['differences'])){ foreach($options['differences'] as $charNum=>$charName){ if ($charNum>$lastChar){ for($i=$lastChar+1;$i<=$charNum;$i++){ $widths[]=0; } $lastChar=$charNum; } if (isset($this->fonts[$fontName]['C'][$charName])){ $widths[$charNum-$firstChar]=$this->fonts[$fontName]['C'][$charName]['WX']; } } } $this->addMessage('selectFont: FirstChar='.$firstChar); $this->addMessage('selectFont: LastChar='.$lastChar); $this->numObj++; $this->o_contents($this->numObj,'new','raw'); $this->objects[$this->numObj]['c'].='['; foreach($widths as $width){ $this->objects[$this->numObj]['c'].=' '.$width; } $this->objects[$this->numObj]['c'].=' ]'; $widthid = $this->numObj; // load the pfb file, and put that into an object too. // note that pdf supports only binary format type 1 font files, though there is a // simple utility to convert them from pfa to pfb. $fp = fopen($fbfile,'rb'); $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $data = fread($fp,filesize($fbfile)); if ($tmp) set_magic_quotes_runtime($tmp); fclose($fp); // create the font descriptor $this->numObj++; $fontDescriptorId = $this->numObj; $this->numObj++; $pfbid = $this->numObj; // determine flags (more than a little flakey, hopefully will not matter much) $flags=0; if ($this->fonts[$fontName]['ItalicAngle']!=0){ $flags+=pow(2,6); } if ($this->fonts[$fontName]['IsFixedPitch']=='true'){ $flags+=1; } $flags+=pow(2,5); // assume non-sybolic $list = array('Ascent'=>'Ascender','CapHeight'=>'CapHeight','Descent'=>'Descender','FontBBox'=>'FontBBox','ItalicAngle'=>'ItalicAngle'); $fdopt = array( 'Flags'=>$flags ,'FontName'=>$adobeFontName ,'StemV'=>100 // don't know what the value for this should be! ); foreach($list as $k=>$v){ if (isset($this->fonts[$fontName][$v])){ $fdopt[$k]=$this->fonts[$fontName][$v]; } } if ($fbtype=='pfb'){ $fdopt['FontFile']=$pfbid; } else if ($fbtype=='ttf'){ $fdopt['FontFile2']=$pfbid; } $this->o_fontDescriptor($fontDescriptorId,'new',$fdopt); // embed the font program $this->o_contents($this->numObj,'new'); $this->objects[$pfbid]['c'].=$data; // determine the cruicial lengths within this file if ($fbtype=='pfb'){ $l1 = strpos($data,'eexec')+6; $l2 = strpos($data,'00000000')-$l1; $l3 = strlen($data)-$l2-$l1; $this->o_contents($this->numObj,'add',array('Length1'=>$l1,'Length2'=>$l2,'Length3'=>$l3)); } else if ($fbtype=='ttf'){ $l1 = strlen($data); $this->o_contents($this->numObj,'add',array('Length1'=>$l1)); } // tell the font object about all this new stuff $tmp = array('BaseFont'=>$adobeFontName,'Widths'=>$widthid ,'FirstChar'=>$firstChar,'LastChar'=>$lastChar ,'FontDescriptor'=>$fontDescriptorId); if ($fbtype=='ttf'){ $tmp['SubType']='TrueType'; } $this->addMessage('adding extra info to font.('.$fontObj.')'); foreach($tmp as $fk=>$fv){ $this->addMessage($fk." : ".$fv); } $this->o_font($fontObj,'add',$tmp); } else { $this->addMessage('selectFont: pfb or ttf file not found, ok if this is one of the 14 standard fonts'); } // also set the differences here, note that this means that these will take effect only the //first time that a font is selected, else they are ignored if (isset($options['differences'])){ $this->fonts[$fontName]['differences']=$options['differences']; } } } if ($set && isset($this->fonts[$fontName])){ // so if for some reason the font was not set in the last one then it will not be selected $this->currentBaseFont=$fontName; // the next line means that if a new font is selected, then the current text state will be // applied to it as well. $this->setCurrentFont(); } return $this->currentFontNum; } /** * sets up the current font, based on the font families, and the current text state * note that this system is quite flexible, a <b><i> font can be completely different to a * <i><b> font, and even <b><b> will have to be defined within the family to have meaning * This function is to be called whenever the currentTextState is changed, it will update * the currentFont setting to whatever the appropriatte family one is. * If the user calls selectFont themselves then that will reset the currentBaseFont, and the currentFont * This function will change the currentFont to whatever it should be, but will not change the * currentBaseFont. * * @access private */ function setCurrentFont(){ if (strlen($this->currentBaseFont)==0){ // then assume an initial font $this->selectFont('./fonts/Helvetica.afm'); } $cf = substr($this->currentBaseFont,strrpos($this->currentBaseFont,'/')+1); if (strlen($this->currentTextState) && isset($this->fontFamilies[$cf]) && isset($this->fontFamilies[$cf][$this->currentTextState])){ // then we are in some state or another // and this font has a family, and the current setting exists within it // select the font, then return it $nf = substr($this->currentBaseFont,0,strrpos($this->currentBaseFont,'/')+1).$this->fontFamilies[$cf][$this->currentTextState]; $this->selectFont($nf,'',0); $this->currentFont = $nf; $this->currentFontNum = $this->fonts[$nf]['fontNum']; } else { // the this font must not have the right family member for the current state // simply assume the base font $this->currentFont = $this->currentBaseFont; $this->currentFontNum = $this->fonts[$this->currentFont]['fontNum']; } } /** * function for the user to find out what the ID is of the first page that was created during * startup - useful if they wish to add something to it later. */ function getFirstPageId(){ return $this->firstPageId; } /** * add content to the currently active object * * @access private */ function addContent($content){ $this->objects[$this->currentContents]['c'].=$content; } /** * sets the colour for fill operations */ function setColor($r,$g,$b,$force=0){ if ($r>=0 && ($force || $r!=$this->currentColour['r'] || $g!=$this->currentColour['g'] || $b!=$this->currentColour['b'])){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$r).' '.sprintf('%.3f',$g).' '.sprintf('%.3f',$b).' rg'; $this->currentColour=array('r'=>$r,'g'=>$g,'b'=>$b); } } /** * sets the colour for stroke operations */ function setStrokeColor($r,$g,$b,$force=0){ if ($r>=0 && ($force || $r!=$this->currentStrokeColour['r'] || $g!=$this->currentStrokeColour['g'] || $b!=$this->currentStrokeColour['b'])){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$r).' '.sprintf('%.3f',$g).' '.sprintf('%.3f',$b).' RG'; $this->currentStrokeColour=array('r'=>$r,'g'=>$g,'b'=>$b); } } /** * draw a line from one set of coordinates to another */ function line($x1,$y1,$x2,$y2){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' m '.sprintf('%.3f',$x2).' '.sprintf('%.3f',$y2).' l S'; } /** * draw a bezier curve based on 4 control points */ function curve($x0,$y0,$x1,$y1,$x2,$y2,$x3,$y3){ // in the current line style, draw a bezier curve from (x0,y0) to (x3,y3) using the other two points // as the control points for the curve. $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x0).' '.sprintf('%.3f',$y0).' m '.sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1); $this->objects[$this->currentContents]['c'].= ' '.sprintf('%.3f',$x2).' '.sprintf('%.3f',$y2).' '.sprintf('%.3f',$x3).' '.sprintf('%.3f',$y3).' c S'; } /** * draw a part of an ellipse */ function partEllipse($x0,$y0,$astart,$afinish,$r1,$r2=0,$angle=0,$nSeg=8){ $this->ellipse($x0,$y0,$r1,$r2,$angle,$nSeg,$astart,$afinish,0); } /** * draw a filled ellipse */ function filledEllipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360){ return $this->ellipse($x0,$y0,$r1,$r2=0,$angle,$nSeg,$astart,$afinish,1,1); } /** * draw an ellipse * note that the part and filled ellipse are just special cases of this function * * draws an ellipse in the current line style * centered at $x0,$y0, radii $r1,$r2 * if $r2 is not set, then a circle is drawn * nSeg is not allowed to be less than 2, as this will simply draw a line (and will even draw a * pretty crappy shape at 2, as we are approximating with bezier curves. */ function ellipse($x0,$y0,$r1,$r2=0,$angle=0,$nSeg=8,$astart=0,$afinish=360,$close=1,$fill=0){ if ($r1==0){ return; } if ($r2==0){ $r2=$r1; } if ($nSeg<2){ $nSeg=2; } $astart = deg2rad((float)$astart); $afinish = deg2rad((float)$afinish); $totalAngle =$afinish-$astart; $dt = $totalAngle/$nSeg; $dtm = $dt/3; if ($angle != 0){ $a = -1*deg2rad((float)$angle); $tmp = "\n q "; $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' '; $tmp .= sprintf('%.3f',$x0).' '.sprintf('%.3f',$y0).' cm'; $this->objects[$this->currentContents]['c'].= $tmp; $x0=0; $y0=0; } $t1 = $astart; $a0 = $x0+$r1*cos($t1); $b0 = $y0+$r2*sin($t1); $c0 = -$r1*sin($t1); $d0 = $r2*cos($t1); $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$a0).' '.sprintf('%.3f',$b0).' m '; for ($i=1;$i<=$nSeg;$i++){ // draw this bit of the total curve $t1 = $i*$dt+$astart; $a1 = $x0+$r1*cos($t1); $b1 = $y0+$r2*sin($t1); $c1 = -$r1*sin($t1); $d1 = $r2*cos($t1); $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',($a0+$c0*$dtm)).' '.sprintf('%.3f',($b0+$d0*$dtm)); $this->objects[$this->currentContents]['c'].= ' '.sprintf('%.3f',($a1-$c1*$dtm)).' '.sprintf('%.3f',($b1-$d1*$dtm)).' '.sprintf('%.3f',$a1).' '.sprintf('%.3f',$b1).' c'; $a0=$a1; $b0=$b1; $c0=$c1; $d0=$d1; } if ($fill){ $this->objects[$this->currentContents]['c'].=' f'; } else { if ($close){ $this->objects[$this->currentContents]['c'].=' s'; // small 's' signifies closing the path as well } else { $this->objects[$this->currentContents]['c'].=' S'; } } if ($angle !=0){ $this->objects[$this->currentContents]['c'].=' Q'; } } /** * this sets the line drawing style. * width, is the thickness of the line in user units * cap is the type of cap to put on the line, values can be 'butt','round','square' * where the diffference between 'square' and 'butt' is that 'square' projects a flat end past the * end of the line. * join can be 'miter', 'round', 'bevel' * dash is an array which sets the dash pattern, is a series of length values, which are the lengths of the * on and off dashes. * (2) represents 2 on, 2 off, 2 on , 2 off ... * (2,1) is 2 on, 1 off, 2 on, 1 off.. etc * phase is a modifier on the dash pattern which is used to shift the point at which the pattern starts. */ function setLineStyle($width=1,$cap='',$join='',$dash='',$phase=0){ // this is quite inefficient in that it sets all the parameters whenever 1 is changed, but will fix another day $string = ''; if ($width>0){ $string.= $width.' w'; } $ca = array('butt'=>0,'round'=>1,'square'=>2); if (isset($ca[$cap])){ $string.= ' '.$ca[$cap].' J'; } $ja = array('miter'=>0,'round'=>1,'bevel'=>2); if (isset($ja[$join])){ $string.= ' '.$ja[$join].' j'; } if (is_array($dash)){ $string.= ' ['; foreach ($dash as $len){ $string.=' '.$len; } $string.= ' ] '.$phase.' d'; } $this->currentLineStyle = $string; $this->objects[$this->currentContents]['c'].="\n".$string; } /** * draw a polygon, the syntax for this is similar to the GD polygon command */ function polygon($p,$np,$f=0){ $this->objects[$this->currentContents]['c'].="\n"; $this->objects[$this->currentContents]['c'].=sprintf('%.3f',$p[0]).' '.sprintf('%.3f',$p[1]).' m '; for ($i=2;$i<$np*2;$i=$i+2){ $this->objects[$this->currentContents]['c'].= sprintf('%.3f',$p[$i]).' '.sprintf('%.3f',$p[$i+1]).' l '; } if ($f==1){ $this->objects[$this->currentContents]['c'].=' f'; } else { $this->objects[$this->currentContents]['c'].=' S'; } } /** * a filled rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not * the coordinates of the upper-right corner */ function filledRectangle($x1,$y1,$width,$height){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' '.sprintf('%.3f',$width).' '.sprintf('%.3f',$height).' re f'; } /** * draw a rectangle, note that it is the width and height of the rectangle which are the secondary paramaters, not * the coordinates of the upper-right corner */ function rectangle($x1,$y1,$width,$height){ $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$x1).' '.sprintf('%.3f',$y1).' '.sprintf('%.3f',$width).' '.sprintf('%.3f',$height).' re S'; } /** * add a new page to the document * this also makes the new page the current active object */ function newPage($insert=0,$id=0,$pos='after'){ // if there is a state saved, then go up the stack closing them // then on the new page, re-open them with the right setings if ($this->nStateStack){ for ($i=$this->nStateStack;$i>=1;$i--){ $this->restoreState($i); } } $this->numObj++; if ($insert){ // the id from the ezPdf class is the od of the contents of the page, not the page object itself // query that object to find the parent $rid = $this->objects[$id]['onPage']; $opt= array('rid'=>$rid,'pos'=>$pos); $this->o_page($this->numObj,'new',$opt); } else { $this->o_page($this->numObj,'new'); } // if there is a stack saved, then put that onto the page if ($this->nStateStack){ for ($i=1;$i<=$this->nStateStack;$i++){ $this->saveState($i); } } // and if there has been a stroke or fill colour set, then transfer them if ($this->currentColour['r']>=0){ $this->setColor($this->currentColour['r'],$this->currentColour['g'],$this->currentColour['b'],1); } if ($this->currentStrokeColour['r']>=0){ $this->setStrokeColor($this->currentStrokeColour['r'],$this->currentStrokeColour['g'],$this->currentStrokeColour['b'],1); } // if there is a line style set, then put this in too if (strlen($this->currentLineStyle)){ $this->objects[$this->currentContents]['c'].="\n".$this->currentLineStyle; } // the call to the o_page object set currentContents to the present page, so this can be returned as the page id return $this->currentContents; } /** * output the pdf code, streaming it to the browser * the relevant headers are set so that hopefully the browser will recognise it */ function stream($options=''){ // setting the options allows the adjustment of the headers // values at the moment are: // 'Content-Disposition'=>'filename' - sets the filename, though not too sure how well this will // work as in my trial the browser seems to use the filename of the php file with .pdf on the end // 'Accept-Ranges'=>1 or 0 - if this is not set to 1, then this header is not included, off by default // this header seems to have caused some problems despite tha fact that it is supposed to solve // them, so I am leaving it off by default. // 'compress'=> 1 or 0 - apply content stream compression, this is on (1) by default if (!is_array($options)){ $options=array(); } if ( isset($options['compress']) && $options['compress']==0){ $tmp = $this->output(1); } else { $tmp = $this->output(); } header("Expires: Mon, 26 Nov 1962 00:00:00 GMT"); header('Pragma: private'); /// IE BUG + SSL //header('Pragma: no-cache'); header('Cache-control: private, must-revalidate'); /// IE BUG + SSL header("Content-type: application/pdf"); header("Content-Length: ".strlen(ltrim($tmp))); $fileName = (isset($options['Content-Disposition'])?$options['Content-Disposition']:'file.pdf'); header("Content-Disposition: inline; filename=".$fileName); if (isset($options['Accept-Ranges']) && $options['Accept-Ranges']==1){ header("Accept-Ranges: ".strlen(ltrim($tmp))); } echo ltrim($tmp); } /** * return the height in units of the current font in the given size */ function getFontHeight($size){ if (!$this->numFonts){ $this->selectFont('./fonts/Helvetica'); } // for the current font, and the given size, what is the height of the font in user units $h = $this->fonts[$this->currentFont]['FontBBox'][3]-$this->fonts[$this->currentFont]['FontBBox'][1]; return $size*$h/1000; } /** * return the font decender, this will normally return a negative number * if you add this number to the baseline, you get the level of the bottom of the font * it is in the pdf user units */ function getFontDecender($size){ // note that this will most likely return a negative value if (!$this->numFonts){ $this->selectFont('./fonts/Helvetica'); } $h = $this->fonts[$this->currentFont]['FontBBox'][1]; return $size*$h/1000; } /** * filter the text, this is applied to all text just before being inserted into the pdf document * it escapes the various things that need to be escaped, and so on * * @access private */ function filterText($text){ $text = str_replace('\\','\\\\',$text); $text = str_replace('(','\(',$text); $text = str_replace(')','\)',$text); $text = str_replace('&lt;','<',$text); $text = str_replace('&gt;','>',$text); $text = str_replace('&#039;','\'',$text); $text = str_replace('&quot;','"',$text); $text = str_replace('&amp;','&',$text); return $text; } /** * given a start position and information about how text is to be laid out, calculate where * on the page the text will end * * @access private */ function PRVTgetTextPosition($x,$y,$angle,$size,$wa,$text){ // given this information return an array containing x and y for the end position as elements 0 and 1 $w = $this->getTextWidth($size,$text); // need to adjust for the number of spaces in this text $words = explode(' ',$text); $nspaces=count($words)-1; $w += $wa*$nspaces; $a = deg2rad((float)$angle); return array(cos($a)*$w+$x,-sin($a)*$w+$y); } /** * wrapper function for PRVTcheckTextDirective1 * * @access private */ function PRVTcheckTextDirective(&$text,$i,&$f){ $x=0; $y=0; return $this->PRVTcheckTextDirective1($text,$i,$f,0,$x,$y); } /** * checks if the text stream contains a control directive * if so then makes some changes and returns the number of characters involved in the directive * this has been re-worked to include everything neccesary to fins the current writing point, so that * the location can be sent to the callback function if required * if the directive does not require a font change, then $f should be set to 0 * * @access private */ function PRVTcheckTextDirective1(&$text,$i,&$f,$final,&$x,&$y,$size=0,$angle=0,$wordSpaceAdjust=0){ $directive = 0; $j=$i; if ($text[$j]=='<'){ $j++; switch($text[$j]){ case '/': $j++; if (strlen($text) <= $j){ return $directive; } switch($text[$j]){ case 'b': case 'i': $j++; if ($text[$j]=='>'){ $p = strrpos($this->currentTextState,$text[$j-1]); if ($p !== false){ // then there is one to remove $this->currentTextState = substr($this->currentTextState,0,$p).substr($this->currentTextState,$p+1); } $directive=$j-$i+1; } break; case 'c': // this this might be a callback function $j++; $k = strpos($text,'>',$j); if ($k!==false && $text[$j]==':'){ // then this will be treated as a callback directive $directive = $k-$i+1; $f=0; // split the remainder on colons to get the function name and the paramater $tmp = substr($text,$j+1,$k-$j-1); $b1 = strpos($tmp,':'); if ($b1!==false){ $func = substr($tmp,0,$b1); $parm = substr($tmp,$b1+1); } else { $func=$tmp; $parm=''; } if (!isset($func) || !strlen(trim($func))){ $directive=0; } else { // only call the function if this is the final call if ($final){ // need to assess the text position, calculate the text width to this point // can use getTextWidth to find the text width I think $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,substr($text,0,$i)); $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'end','p'=>$parm,'nCallback'=>$this->nCallback); $x=$tmp[0]; $y=$tmp[1]; $ret = $this->$func($info); if (is_array($ret)){ // then the return from the callback function could set the position, to start with, later will do font colour, and font foreach($ret as $rk=>$rv){ switch($rk){ case 'x': case 'y': $$rk=$rv; break; } } } // also remove from to the stack // for simplicity, just take from the end, fix this another day $this->nCallback--; if ($this->nCallback<0){ $this->nCallBack=0; } } } } break; } break; case 'b': case 'i': $j++; if ($text[$j]=='>'){ $this->currentTextState.=$text[$j-1]; $directive=$j-$i+1; } break; case 'C': $noClose=1; case 'c': // this this might be a callback function $j++; $k = strpos($text,'>',$j); if ($k!==false && $text[$j]==':'){ // then this will be treated as a callback directive $directive = $k-$i+1; $f=0; // split the remainder on colons to get the function name and the paramater // $bits = explode(':',substr($text,$j+1,$k-$j-1)); $tmp = substr($text,$j+1,$k-$j-1); $b1 = strpos($tmp,':'); if ($b1!==false){ $func = substr($tmp,0,$b1); $parm = substr($tmp,$b1+1); } else { $func=$tmp; $parm=''; } if (!isset($func) || !strlen(trim($func))){ $directive=0; } else { // only call the function if this is the final call, ie, the one actually doing printing, not measurement if ($final){ // need to assess the text position, calculate the text width to this point // can use getTextWidth to find the text width I think // also add the text height and decender $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,substr($text,0,$i)); $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'start','p'=>$parm,'f'=>$func,'height'=>$this->getFontHeight($size),'decender'=>$this->getFontDecender($size)); $x=$tmp[0]; $y=$tmp[1]; if (!isset($noClose) || !$noClose){ // only add to the stack if this is a small 'c', therefore is a start-stop pair $this->nCallback++; $info['nCallback']=$this->nCallback; $this->callback[$this->nCallback]=$info; } $ret = $this->$func($info); if (is_array($ret)){ // then the return from the callback function could set the position, to start with, later will do font colour, and font foreach($ret as $rk=>$rv){ switch($rk){ case 'x': case 'y': $$rk=$rv; break; } } } } } } break; } } return $directive; } /** * add text to the document, at a specified location, size and angle on the page */ function addText($x,$y,$size,$text,$angle=0,$wordSpaceAdjust=0){ if (!$this->numFonts){$this->selectFont('./fonts/Helvetica');} // if there are any open callbacks, then they should be called, to show the start of the line if ($this->nCallback>0){ for ($i=$this->nCallback;$i>0;$i--){ // call each function $info = array('x'=>$x,'y'=>$y,'angle'=>$angle,'status'=>'sol','p'=>$this->callback[$i]['p'],'nCallback'=>$this->callback[$i]['nCallback'],'height'=>$this->callback[$i]['height'],'decender'=>$this->callback[$i]['decender']); $func = $this->callback[$i]['f']; $this->$func($info); } } if ($angle==0){ $this->objects[$this->currentContents]['c'].="\n".'BT '.sprintf('%.3f',$x).' '.sprintf('%.3f',$y).' Td'; } else { $a = deg2rad((float)$angle); $tmp = "\n".'BT '; $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' '; $tmp .= sprintf('%.3f',$x).' '.sprintf('%.3f',$y).' Tm'; $this->objects[$this->currentContents]['c'] .= $tmp; } if ($wordSpaceAdjust!=0 || $wordSpaceAdjust != $this->wordSpaceAdjust){ $this->wordSpaceAdjust=$wordSpaceAdjust; $this->objects[$this->currentContents]['c'].=' '.sprintf('%.3f',$wordSpaceAdjust).' Tw'; } $len=strlen($text); $start=0; for ($i=0;$i<$len;$i++){ $f=1; $directive = $this->PRVTcheckTextDirective($text,$i,$f); if ($directive){ // then we should write what we need to if ($i>$start){ $part = substr($text,$start,$i-$start); $this->objects[$this->currentContents]['c'].=' /F'.$this->currentFontNum.' '.sprintf('%.1f',$size).' Tf '; $this->objects[$this->currentContents]['c'].=' ('.$this->filterText($part).') Tj'; } if ($f){ // then there was nothing drastic done here, restore the contents $this->setCurrentFont(); } else { $this->objects[$this->currentContents]['c'] .= ' ET'; $f=1; $xp=$x; $yp=$y; $directive = $this->PRVTcheckTextDirective1($text,$i,$f,1,$xp,$yp,$size,$angle,$wordSpaceAdjust); // restart the text object if ($angle==0){ $this->objects[$this->currentContents]['c'].="\n".'BT '.sprintf('%.3f',$xp).' '.sprintf('%.3f',$yp).' Td'; } else { $a = deg2rad((float)$angle); $tmp = "\n".'BT '; $tmp .= sprintf('%.3f',cos($a)).' '.sprintf('%.3f',(-1.0*sin($a))).' '.sprintf('%.3f',sin($a)).' '.sprintf('%.3f',cos($a)).' '; $tmp .= sprintf('%.3f',$xp).' '.sprintf('%.3f',$yp).' Tm'; $this->objects[$this->currentContents]['c'] .= $tmp; } if ($wordSpaceAdjust!=0 || $wordSpaceAdjust != $this->wordSpaceAdjust){ $this->wordSpaceAdjust=$wordSpaceAdjust; $this->objects[$this->currentContents]['c'].=' '.sprintf('%.3f',$wordSpaceAdjust).' Tw'; } } // and move the writing point to the next piece of text $i=$i+$directive-1; $start=$i+1; } } if ($start<$len){ $part = substr($text,$start); $this->objects[$this->currentContents]['c'].=' /F'.$this->currentFontNum.' '.sprintf('%.1f',$size).' Tf '; $this->objects[$this->currentContents]['c'].=' ('.$this->filterText($part).') Tj'; } $this->objects[$this->currentContents]['c'].=' ET'; // if there are any open callbacks, then they should be called, to show the end of the line if ($this->nCallback>0){ for ($i=$this->nCallback;$i>0;$i--){ // call each function $tmp = $this->PRVTgetTextPosition($x,$y,$angle,$size,$wordSpaceAdjust,$text); $info = array('x'=>$tmp[0],'y'=>$tmp[1],'angle'=>$angle,'status'=>'eol','p'=>$this->callback[$i]['p'],'nCallback'=>$this->callback[$i]['nCallback'],'height'=>$this->callback[$i]['height'],'decender'=>$this->callback[$i]['decender']); $func = $this->callback[$i]['f']; $this->$func($info); } } } /** * calculate how wide a given text string will be on a page, at a given size. * this can be called externally, but is alse used by the other class functions */ function getTextWidth($size,$text){ // this function should not change any of the settings, though it will need to // track any directives which change during calculation, so copy them at the start // and put them back at the end. $store_currentTextState = $this->currentTextState; if (!$this->numFonts){ $this->selectFont('./fonts/Helvetica'); } // converts a number or a float to a string so it can get the width $text = "$text"; // hmm, this is where it all starts to get tricky - use the font information to // calculate the width of each character, add them up and convert to user units $w=0; $len=strlen($text); $cf = $this->currentFont; for ($i=0;$i<$len;$i++){ $f=1; $directive = $this->PRVTcheckTextDirective($text,$i,$f); if ($directive){ if ($f){ $this->setCurrentFont(); $cf = $this->currentFont; } $i=$i+$directive-1; } else { $char=ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$char])){ // then this character is being replaced by another $name = $this->fonts[$cf]['differences'][$char]; if (isset($this->fonts[$cf]['C'][$name]['WX'])){ $w+=$this->fonts[$cf]['C'][$name]['WX']; } } else if (isset($this->fonts[$cf]['C'][$char]['WX'])){ $w+=$this->fonts[$cf]['C'][$char]['WX']; } else { /// GLPI fix add default width $w += 560; } } } $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); return $w*$size/1000; } /** * do a part of the calculation for sorting out the justification of the text * * @access private */ function PRVTadjustWrapText($text,$actual,$width,&$x,&$adjust,$justification){ switch ($justification){ case 'left': return; break; case 'right': $x+=$width-$actual; break; case 'center': case 'centre': $x+=($width-$actual)/2; break; case 'full': // count the number of words $words = explode(' ',$text); $nspaces=count($words)-1; if ($nspaces>0){ $adjust = ($width-$actual)/$nspaces; } else { $adjust=0; } break; } } /** * add text to the page, but ensure that it fits within a certain width * if it does not fit then put in as much as possible, splitting at word boundaries * and return the remainder. * justification and angle can also be specified for the text */ function addTextWrap($x,$y,$width,$size,$text,$justification='left',$angle=0,$test=0){ // this will display the text, and if it goes beyond the width $width, will backtrack to the // previous space or hyphen, and return the remainder of the text. // $justification can be set to 'left','right','center','centre','full' // need to store the initial text state, as this will change during the width calculation // but will need to be re-set before printing, so that the chars work out right $store_currentTextState = $this->currentTextState; if (!$this->numFonts){$this->selectFont('./fonts/Helvetica');} if ($width<=0){ // error, pretend it printed ok, otherwise risking a loop return ''; } $w=0; $break=0; $breakWidth=0; $len=strlen($text); $cf = $this->currentFont; $tw = $width/$size*1000; for ($i=0;$i<$len;$i++){ $f=1; $directive = $this->PRVTcheckTextDirective($text,$i,$f); if ($directive){ if ($f){ $this->setCurrentFont(); $cf = $this->currentFont; } $i=$i+$directive-1; } else { $cOrd = ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$cOrd])){ // then this character is being replaced by another $cOrd2 = $this->fonts[$cf]['differences'][$cOrd]; } else { $cOrd2 = $cOrd; } if (isset($this->fonts[$cf]['C'][$cOrd2]['WX'])){ $w+=$this->fonts[$cf]['C'][$cOrd2]['WX']; } else { /// GLPI fix add default width when not set $w+=560; } if ($w>$tw){ // then we need to truncate this line if ($break>0){ // then we have somewhere that we can split :) if ($text[$break]==' '){ $tmp = substr($text,0,$break); } else { $tmp = substr($text,0,$break+1); } $adjust=0; $this->PRVTadjustWrapText($tmp,$breakWidth,$width,$x,$adjust,$justification); // reset the text state $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); if (!$test){ $this->addText($x,$y,$size,$tmp,$angle,$adjust); } return substr($text,$break+1); } else { // just split before the current character $tmp = substr($text,0,$i); $adjust=0; $ctmp=ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$ctmp])){ $ctmp=$this->fonts[$cf]['differences'][$ctmp]; } $tmpw=($w-$this->fonts[$cf]['C'][$ctmp]['WX'])*$size/1000; $this->PRVTadjustWrapText($tmp,$tmpw,$width,$x,$adjust,$justification); // reset the text state $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); if (!$test){ $this->addText($x,$y,$size,$tmp,$angle,$adjust); } return substr($text,$i); } } if ($text[$i]=='-'){ $break=$i; $breakWidth = $w*$size/1000; } if ($text[$i]==' '){ $break=$i; $ctmp=ord($text[$i]); if (isset($this->fonts[$cf]['differences'][$ctmp])){ $ctmp=$this->fonts[$cf]['differences'][$ctmp]; } $breakWidth = ($w-$this->fonts[$cf]['C'][$ctmp]['WX'])*$size/1000; } } } // then there was no need to break this line if ($justification=='full'){ $justification='left'; } $adjust=0; $tmpw=$w*$size/1000; $this->PRVTadjustWrapText($text,$tmpw,$width,$x,$adjust,$justification); // reset the text state $this->currentTextState = $store_currentTextState; $this->setCurrentFont(); if (!$test){ $this->addText($x,$y,$size,$text,$angle,$adjust,$angle); } return ''; } /** * this will be called at a new page to return the state to what it was on the * end of the previous page, before the stack was closed down * This is to get around not being able to have open 'q' across pages * */ function saveState($pageEnd=0){ if ($pageEnd){ // this will be called at a new page to return the state to what it was on the // end of the previous page, before the stack was closed down // This is to get around not being able to have open 'q' across pages $opt = $this->stateStack[$pageEnd]; // ok to use this as stack starts numbering at 1 $this->setColor($opt['col']['r'],$opt['col']['g'],$opt['col']['b'],1); $this->setStrokeColor($opt['str']['r'],$opt['str']['g'],$opt['str']['b'],1); $this->objects[$this->currentContents]['c'].="\n".$opt['lin']; // $this->currentLineStyle = $opt['lin']; } else { $this->nStateStack++; $this->stateStack[$this->nStateStack]=array( 'col'=>$this->currentColour ,'str'=>$this->currentStrokeColour ,'lin'=>$this->currentLineStyle ); } $this->objects[$this->currentContents]['c'].="\nq"; } /** * restore a previously saved state */ function restoreState($pageEnd=0){ if (!$pageEnd){ $n = $this->nStateStack; $this->currentColour = $this->stateStack[$n]['col']; $this->currentStrokeColour = $this->stateStack[$n]['str']; $this->objects[$this->currentContents]['c'].="\n".$this->stateStack[$n]['lin']; $this->currentLineStyle = $this->stateStack[$n]['lin']; unset($this->stateStack[$n]); $this->nStateStack--; } $this->objects[$this->currentContents]['c'].="\nQ"; } /** * make a loose object, the output will go into this object, until it is closed, then will revert to * the current one. * this object will not appear until it is included within a page. * the function will return the object number */ function openObject(){ $this->nStack++; $this->stack[$this->nStack]=array('c'=>$this->currentContents,'p'=>$this->currentPage); // add a new object of the content type, to hold the data flow $this->numObj++; $this->o_contents($this->numObj,'new'); $this->currentContents=$this->numObj; $this->looseObjects[$this->numObj]=1; return $this->numObj; } /** * open an existing object for editing */ function reopenObject($id){ $this->nStack++; $this->stack[$this->nStack]=array('c'=>$this->currentContents,'p'=>$this->currentPage); $this->currentContents=$id; // also if this object is the primary contents for a page, then set the current page to its parent if (isset($this->objects[$id]['onPage'])){ $this->currentPage = $this->objects[$id]['onPage']; } } /** * close an object */ function closeObject(){ // close the object, as long as there was one open in the first place, which will be indicated by // an objectId on the stack. if ($this->nStack>0){ $this->currentContents=$this->stack[$this->nStack]['c']; $this->currentPage=$this->stack[$this->nStack]['p']; $this->nStack--; // easier to probably not worry about removing the old entries, they will be overwritten // if there are new ones. } } /** * stop an object from appearing on pages from this point on */ function stopObject($id){ // if an object has been appearing on pages up to now, then stop it, this page will // be the last one that could contian it. if (isset($this->addLooseObjects[$id])){ $this->addLooseObjects[$id]=''; } } /** * after an object has been created, it wil only show if it has been added, using this function. */ function addObject($id,$options='add'){ // add the specified object to the page if (isset($this->looseObjects[$id]) && $this->currentContents!=$id){ // then it is a valid object, and it is not being added to itself switch($options){ case 'all': // then this object is to be added to this page (done in the next block) and // all future new pages. $this->addLooseObjects[$id]='all'; case 'add': if (isset($this->objects[$this->currentContents]['onPage'])){ // then the destination contents is the primary for the page // (though this object is actually added to that page) $this->o_page($this->objects[$this->currentContents]['onPage'],'content',$id); } break; case 'even': $this->addLooseObjects[$id]='even'; $pageObjectId=$this->objects[$this->currentContents]['onPage']; if ($this->objects[$pageObjectId]['info']['pageNum']%2==0){ $this->addObject($id); // hacky huh :) } break; case 'odd': $this->addLooseObjects[$id]='odd'; $pageObjectId=$this->objects[$this->currentContents]['onPage']; if ($this->objects[$pageObjectId]['info']['pageNum']%2==1){ $this->addObject($id); // hacky huh :) } break; case 'next': $this->addLooseObjects[$id]='all'; break; case 'nexteven': $this->addLooseObjects[$id]='even'; break; case 'nextodd': $this->addLooseObjects[$id]='odd'; break; } } } /** * add content to the documents info object */ function addInfo($label,$value=0){ // this will only work if the label is one of the valid ones. // modify this so that arrays can be passed as well. // if $label is an array then assume that it is key=>value pairs // else assume that they are both scalar, anything else will probably error if (is_array($label)){ foreach ($label as $l=>$v){ $this->o_info($this->infoObject,$l,$v); } } else { $this->o_info($this->infoObject,$label,$value); } } /** * set the viewer preferences of the document, it is up to the browser to obey these. */ function setPreferences($label,$value=0){ // this will only work if the label is one of the valid ones. if (is_array($label)){ foreach ($label as $l=>$v){ $this->o_catalog($this->catalogId,'viewerPreferences',array($l=>$v)); } } else { $this->o_catalog($this->catalogId,'viewerPreferences',array($label=>$value)); } } /** * extract an integer from a position in a byte stream * * @access private */ function PRVT_getBytes(&$data,$pos,$num){ // return the integer represented by $num bytes from $pos within $data $ret=0; for ($i=0;$i<$num;$i++){ $ret=$ret*256; $ret+=ord($data[$pos+$i]); } return $ret; } /** * add a PNG image into the document, from a file * this should work with remote files */ function addPngFromFile($file,$x,$y,$w=0,$h=0){ // read in a png file, interpret it, then add to the system $error=0; $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $fp = @fopen($file,'rb'); if ($fp){ $data=''; while(!feof($fp)){ $data .= fread($fp,1024); } fclose($fp); } else { $error = 1; $errormsg = 'trouble opening file: '.$file; } if ($tmp) set_magic_quotes_runtime($tmp); if (!$error){ $header = chr(137).chr(80).chr(78).chr(71).chr(13).chr(10).chr(26).chr(10); if (substr($data,0,8)!=$header){ $error=1; $errormsg = 'this file does not have a valid header'; } } if (!$error){ // set pointer $p = 8; $len = strlen($data); // cycle through the file, identifying chunks $haveHeader=0; $info=array(); $idata=''; $pdata=''; while ($p<$len){ $chunkLen = $this->PRVT_getBytes($data,$p,4); $chunkType = substr($data,$p+4,4); // echo $chunkType.' - '.$chunkLen.'<br>'; switch($chunkType){ case 'IHDR': // this is where all the file information comes from $info['width']=$this->PRVT_getBytes($data,$p+8,4); $info['height']=$this->PRVT_getBytes($data,$p+12,4); $info['bitDepth']=ord($data[$p+16]); $info['colorType']=ord($data[$p+17]); $info['compressionMethod']=ord($data[$p+18]); $info['filterMethod']=ord($data[$p+19]); $info['interlaceMethod']=ord($data[$p+20]); //print_r($info); $haveHeader=1; if ($info['compressionMethod']!=0){ $error=1; $errormsg = 'unsupported compression method'; } if ($info['filterMethod']!=0){ $error=1; $errormsg = 'unsupported filter method'; } break; case 'PLTE': $pdata.=substr($data,$p+8,$chunkLen); break; case 'IDAT': $idata.=substr($data,$p+8,$chunkLen); break; case 'tRNS': //this chunk can only occur once and it must occur after the PLTE chunk and before IDAT chunk //print "tRNS found, color type = ".$info['colorType']."<BR>"; $transparency = array(); if ($info['colorType'] == 3) { // indexed color, rbg /* corresponding to entries in the plte chunk Alpha for palette index 0: 1 byte Alpha for palette index 1: 1 byte ...etc... */ // there will be one entry for each palette entry. up until the last non-opaque entry. // set up an array, stretching over all palette entries which will be o (opaque) or 1 (transparent) $transparency['type']='indexed'; $numPalette = strlen($pdata)/3; $trans=0; for ($i=$chunkLen;$i>=0;$i--){ if (ord($data[$p+8+$i])==0){ $trans=$i; } } $transparency['data'] = $trans; } elseif($info['colorType'] == 0) { // grayscale /* corresponding to entries in the plte chunk Gray: 2 bytes, range 0 .. (2^bitdepth)-1 */ // $transparency['grayscale']=$this->PRVT_getBytes($data,$p+8,2); // g = grayscale $transparency['type']='indexed'; $transparency['data'] = ord($data[$p+8+1]); } elseif($info['colorType'] == 2) { // truecolor /* corresponding to entries in the plte chunk Red: 2 bytes, range 0 .. (2^bitdepth)-1 Green: 2 bytes, range 0 .. (2^bitdepth)-1 Blue: 2 bytes, range 0 .. (2^bitdepth)-1 */ $transparency['r']=$this->PRVT_getBytes($data,$p+8,2); // r from truecolor $transparency['g']=$this->PRVT_getBytes($data,$p+10,2); // g from truecolor $transparency['b']=$this->PRVT_getBytes($data,$p+12,2); // b from truecolor } else { //unsupported transparency type } // KS End new code break; default: break; } $p += $chunkLen+12; } if(!$haveHeader){ $error = 1; $errormsg = 'information header is missing'; } if (isset($info['interlaceMethod']) && $info['interlaceMethod']){ $error = 1; $errormsg = 'There appears to be no support for interlaced images in pdf.'; } } if (!$error && $info['bitDepth'] > 8){ $error = 1; $errormsg = 'only bit depth of 8 or less is supported'; } if (!$error){ if ($info['colorType']!=2 && $info['colorType']!=0 && $info['colorType']!=3){ $error = 1; $errormsg = 'transparancey alpha channel not supported, transparency only supported for palette images.'; } else { switch ($info['colorType']){ case 3: $color = 'DeviceRGB'; $ncolor=1; break; case 2: $color = 'DeviceRGB'; $ncolor=3; break; case 0: $color = 'DeviceGray'; $ncolor=1; break; } } } if ($error){ $this->addMessage('PNG error - ('.$file.') '.$errormsg); return; } if ($w==0){ $w=$h/$info['height']*$info['width']; } if ($h==0){ $h=$w*$info['height']/$info['width']; } //print_r($info); // so this image is ok... add it in. $this->numImages++; $im=$this->numImages; $label='I'.$im; $this->numObj++; // $this->o_image($this->numObj,'new',array('label'=>$label,'data'=>$idata,'iw'=>$w,'ih'=>$h,'type'=>'png','ic'=>$info['width'])); $options = array('label'=>$label,'data'=>$idata,'bitsPerComponent'=>$info['bitDepth'],'pdata'=>$pdata ,'iw'=>$info['width'],'ih'=>$info['height'],'type'=>'png','color'=>$color,'ncolor'=>$ncolor); if (isset($transparency)){ $options['transparency']=$transparency; } $this->o_image($this->numObj,'new',$options); $this->objects[$this->currentContents]['c'].="\nq"; $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$w)." 0 0 ".sprintf('%.3f',$h)." ".sprintf('%.3f',$x)." ".sprintf('%.3f',$y)." cm"; $this->objects[$this->currentContents]['c'].="\n/".$label.' Do'; $this->objects[$this->currentContents]['c'].="\nQ"; } /** * add a JPEG image into the document, from a file */ function addJpegFromFile($img,$x,$y,$w=0,$h=0){ // attempt to add a jpeg image straight from a file, using no GD commands // note that this function is unable to operate on a remote file. if (!file_exists($img)){ return; } $tmp=getimagesize($img); $imageWidth=$tmp[0]; $imageHeight=$tmp[1]; if (isset($tmp['channels'])){ $channels = $tmp['channels']; } else { $channels = 3; } if ($w<=0 && $h<=0){ $w=$imageWidth; } if ($w==0){ $w=$h/$imageHeight*$imageWidth; } if ($h==0){ $h=$w*$imageHeight/$imageWidth; } $fp=fopen($img,'rb'); $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $data = fread($fp,filesize($img)); if ($tmp) set_magic_quotes_runtime($tmp); fclose($fp); $this->addJpegImage_common($data,$x,$y,$w,$h,$imageWidth,$imageHeight,$channels); } /** * add an image into the document, from a GD object * this function is not all that reliable, and I would probably encourage people to use * the file based functions */ function addImage(&$img,$x,$y,$w=0,$h=0,$quality=75){ // add a new image into the current location, as an external object // add the image at $x,$y, and with width and height as defined by $w & $h // note that this will only work with full colour images and makes them jpg images for display // later versions could present lossless image formats if there is interest. // there seems to be some problem here in that images that have quality set above 75 do not appear // not too sure why this is, but in the meantime I have restricted this to 75. if ($quality>75){ $quality=75; } // if the width or height are set to zero, then set the other one based on keeping the image // height/width ratio the same, if they are both zero, then give up :) $imageWidth=imagesx($img); $imageHeight=imagesy($img); if ($w<=0 && $h<=0){ return; } if ($w==0){ $w=$h/$imageHeight*$imageWidth; } if ($h==0){ $h=$w*$imageHeight/$imageWidth; } // gotta get the data out of the img.. // so I write to a temp file, and then read it back.. soo ugly, my apologies. $tmpDir='/tmp'; $tmpName=tempnam($tmpDir,'img'); imagejpeg($img,$tmpName,$quality); $fp=fopen($tmpName,'rb'); $tmp = get_magic_quotes_runtime(); if ($tmp) set_magic_quotes_runtime(0); $fp = @fopen($tmpName,'rb'); if ($fp){ $data=''; while(!feof($fp)){ $data .= fread($fp,1024); } fclose($fp); } else { $error = 1; $errormsg = 'trouble opening file'; } // $data = fread($fp,filesize($tmpName)); if ($tmp) set_magic_quotes_runtime($tmp); // fclose($fp); unlink($tmpName); $this->addJpegImage_common($data,$x,$y,$w,$h,$imageWidth,$imageHeight); } /** * common code used by the two JPEG adding functions * * @access private */ function addJpegImage_common(&$data,$x,$y,$w=0,$h=0,$imageWidth,$imageHeight,$channels=3){ // note that this function is not to be called externally // it is just the common code between the GD and the file options $this->numImages++; $im=$this->numImages; $label='I'.$im; $this->numObj++; $this->o_image($this->numObj,'new',array('label'=>$label,'data'=>$data,'iw'=>$imageWidth,'ih'=>$imageHeight,'channels'=>$channels)); $this->objects[$this->currentContents]['c'].="\nq"; $this->objects[$this->currentContents]['c'].="\n".sprintf('%.3f',$w)." 0 0 ".sprintf('%.3f',$h)." ".sprintf('%.3f',$x)." ".sprintf('%.3f',$y)." cm"; $this->objects[$this->currentContents]['c'].="\n/".$label.' Do'; $this->objects[$this->currentContents]['c'].="\nQ"; } /** * specify where the document should open when it first starts */ function openHere($style,$a=0,$b=0,$c=0){ // this function will open the document at a specified page, in a specified style // the values for style, and the required paramters are: // 'XYZ' left, top, zoom // 'Fit' // 'FitH' top // 'FitV' left // 'FitR' left,bottom,right // 'FitB' // 'FitBH' top // 'FitBV' left $this->numObj++; $this->o_destination($this->numObj,'new',array('page'=>$this->currentPage,'type'=>$style,'p1'=>$a,'p2'=>$b,'p3'=>$c)); $id = $this->catalogId; $this->o_catalog($id,'openHere',$this->numObj); } /** * create a labelled destination within the document */ function addDestination($label,$style,$a=0,$b=0,$c=0){ // associates the given label with the destination, it is done this way so that a destination can be specified after // it has been linked to // styles are the same as the 'openHere' function $this->numObj++; $this->o_destination($this->numObj,'new',array('page'=>$this->currentPage,'type'=>$style,'p1'=>$a,'p2'=>$b,'p3'=>$c)); $id = $this->numObj; // store the label->idf relationship, note that this means that labels can be used only once $this->destinations["$label"]=$id; } /** * define font families, this is used to initialize the font families for the default fonts * and for the user to add new ones for their fonts. The default bahavious can be overridden should * that be desired. */ function setFontFamily($family,$options=''){ if (!is_array($options)){ if ($family=='init'){ // set the known family groups // these font families will be used to enable bold and italic markers to be included // within text streams. html forms will be used... <b></b> <i></i> $this->fontFamilies['Helvetica.afm']=array( 'b'=>'Helvetica-Bold.afm' ,'i'=>'Helvetica-Oblique.afm' ,'bi'=>'Helvetica-BoldOblique.afm' ,'ib'=>'Helvetica-BoldOblique.afm' ); $this->fontFamilies['Courier.afm']=array( 'b'=>'Courier-Bold.afm' ,'i'=>'Courier-Oblique.afm' ,'bi'=>'Courier-BoldOblique.afm' ,'ib'=>'Courier-BoldOblique.afm' ); $this->fontFamilies['Times-Roman.afm']=array( 'b'=>'Times-Bold.afm' ,'i'=>'Times-Italic.afm' ,'bi'=>'Times-BoldItalic.afm' ,'ib'=>'Times-BoldItalic.afm' ); } } else { // the user is trying to set a font family // note that this can also be used to set the base ones to something else if (strlen($family)){ $this->fontFamilies[$family] = $options; } } } /** * used to add messages for use in debugging */ function addMessage($message){ $this->messages.=$message."\n"; } /** * a few functions which should allow the document to be treated transactionally. */ function transaction($action){ switch ($action){ case 'start': // store all the data away into the checkpoint variable $data = get_object_vars($this); $this->checkpoint = $data; unset($data); break; case 'commit': if (is_array($this->checkpoint) && isset($this->checkpoint['checkpoint'])){ $tmp = $this->checkpoint['checkpoint']; $this->checkpoint = $tmp; unset($tmp); } else { $this->checkpoint=''; } break; case 'rewind': // do not destroy the current checkpoint, but move us back to the state then, so that we can try again if (is_array($this->checkpoint)){ // can only abort if were inside a checkpoint $tmp = $this->checkpoint; foreach ($tmp as $k=>$v){ if ($k != 'checkpoint'){ $this->$k=$v; } } unset($tmp); } break; case 'abort': if (is_array($this->checkpoint)){ // can only abort if were inside a checkpoint $tmp = $this->checkpoint; foreach ($tmp as $k=>$v){ $this->$k=$v; } unset($tmp); } break; } } } // end of class ?>
euqip/glpi-smartcities
plugins/barcode/lib/ezpdf/class.pdf.php
PHP
gpl-2.0
100,847
class Component { /** * Generic constructor for all components * @constructor * @param {Element} el * @param {Object} options */ constructor(classDef, el, options) { // Display error if el is valid HTML Element if (!(el instanceof Element)) { console.error(Error(el + ' is not an HTML Element')); } // If exists, destroy and reinitialize in child let ins = classDef.getInstance(el); if (!!ins) { ins.destroy(); } this.el = el; this.$el = cash(el); } /** * Initializes components * @param {class} classDef * @param {Element | NodeList | jQuery} els * @param {Object} options */ static init(classDef, els, options) { let instances = null; if (els instanceof Element) { instances = new classDef(els, options); } else if (!!els && (els.jquery || els.cash || els instanceof NodeList)) { let instancesArr = []; for (let i = 0; i < els.length; i++) { instancesArr.push(new classDef(els[i], options)); } instances = instancesArr; } return instances; } }
5x5Game/5x5Game.github.io
node_modules/materialize-css/js/component.js
JavaScript
gpl-2.0
1,098
/* Measure bcopy functions. Copyright (C) 2013 Free Software Foundation, Inc. This file is part of the GNU C Library. The GNU C Library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2.1 of the License, or (at your option) any later version. The GNU C Library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with the GNU C Library; if not, see <http://www.gnu.org/licenses/>. */ #define TEST_BCOPY #include "bench-memmove.c"
SanDisk-Open-Source/SSD_Dashboard
uefi/userspace/glibc/benchtests/bench-bcopy.c
C
gpl-2.0
858
/* * Copyright (c) 2000, 2017, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. Oracle designates this * particular file as subject to the "Classpath" exception as provided * by Oracle in the LICENSE file that accompanied this code. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ package javax.print.attribute; import java.io.Serializable; /** * Class {@code Size2DSyntax} is an abstract base class providing the common * implementation of all attributes denoting a size in two dimensions. * <p> * A two-dimensional size attribute's value consists of two items, the {@code X} * dimension and the {@code Y} dimension. A two-dimensional size attribute may * be constructed by supplying the two values and indicating the units in which * the values are measured. Methods are provided to return a two-dimensional * size attribute's values, indicating the units in which the values are to be * returned. The two most common size units are inches (in) and millimeters * (mm), and exported constants {@link #INCH INCH} and {@link #MM MM} are * provided for indicating those units. * <p> * Once constructed, a two-dimensional size attribute's value is immutable. * <p> * <b>Design</b> * <p> * A two-dimensional size attribute's {@code X} and {@code Y} dimension values * are stored internally as integers in units of micrometers (&#181;m), where 1 * micrometer = 10<SUP>-6</SUP> meter = 1/1000 millimeter = 1/25400 inch. This * permits dimensions to be represented exactly to a precision of 1/1000 mm (= 1 * &#181;m) or 1/100 inch (= 254 &#181;m). If fractional inches are expressed in * negative powers of two, this permits dimensions to be represented exactly to * a precision of 1/8 inch (= 3175 &#181;m) but not 1/16 inch (because 1/16 inch * does not equal an integral number of &#181;m). * <p> * Storing the dimensions internally in common units of &#181;m lets two size * attributes be compared without regard to the units in which they were * created; for example, 8.5 in will compare equal to 215.9 mm, as they both are * stored as 215900 &#181;m. For example, a lookup service can match resolution * attributes based on equality of their serialized representations regardless * of the units in which they were created. Using integers for internal storage * allows precise equality comparisons to be done, which would not be guaranteed * if an internal floating point representation were used. Note that if you're * looking for {@code U.S. letter} sized media in metric units, you have to * search for a media size of 215.9 x 279.4 mm; rounding off to an integral * 216 x 279 mm will not match. * <p> * The exported constant {@link #INCH INCH} is actually the conversion factor by * which to multiply a value in inches to get the value in &#181;m. Likewise, * the exported constant {@link #MM MM} is the conversion factor by which to * multiply a value in mm to get the value in &#181;m. A client can specify a * resolution value in units other than inches or mm by supplying its own * conversion factor. However, since the internal units of &#181;m was chosen * with supporting only the external units of inch and mm in mind, there is no * guarantee that the conversion factor for the client's units will be an exact * integer. If the conversion factor isn't an exact integer, resolution values * in the client's units won't be stored precisely. * * @author Alan Kaminsky */ public abstract class Size2DSyntax implements Serializable, Cloneable { /** * Use serialVersionUID from JDK 1.4 for interoperability. */ private static final long serialVersionUID = 5584439964938660530L; /** * {@code X} dimension in units of micrometers (&#181;m). * * @serial */ private int x; /** * {@code Y} dimension in units of micrometers (&#181;m). * * @serial */ private int y; /** * Value to indicate units of inches (in). It is actually the conversion * factor by which to multiply inches to yield &#181;m (25400). */ public static final int INCH = 25400; /** * Value to indicate units of millimeters (mm). It is actually the * conversion factor by which to multiply mm to yield &#181;m (1000). */ public static final int MM = 1000; /** * Construct a new two-dimensional size attribute from the given * floating-point values. * * @param x {@code X} dimension * @param y {@code Y} dimension * @param units unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM} * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or * {@code units < 1} */ protected Size2DSyntax(float x, float y, int units) { if (x < 0.0f) { throw new IllegalArgumentException("x < 0"); } if (y < 0.0f) { throw new IllegalArgumentException("y < 0"); } if (units < 1) { throw new IllegalArgumentException("units < 1"); } this.x = (int) (x * units + 0.5f); this.y = (int) (y * units + 0.5f); } /** * Construct a new two-dimensional size attribute from the given integer * values. * * @param x {@code X} dimension * @param y {@code Y} dimension * @param units unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM} * @throws IllegalArgumentException if {@code x < 0} or {@code y < 0} or * {@code units < 1} */ protected Size2DSyntax(int x, int y, int units) { if (x < 0) { throw new IllegalArgumentException("x < 0"); } if (y < 0) { throw new IllegalArgumentException("y < 0"); } if (units < 1) { throw new IllegalArgumentException("units < 1"); } this.x = x * units; this.y = y * units; } /** * Convert a value from micrometers to some other units. The result is * returned as a floating-point number. * * @param x value (micrometers) to convert * @param units unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM} * @return the value of {@code x} converted to the desired units * @throws IllegalArgumentException if {@code units < 1} */ private static float convertFromMicrometers(int x, int units) { if (units < 1) { throw new IllegalArgumentException("units is < 1"); } return ((float)x) / ((float)units); } /** * Get this two-dimensional size attribute's dimensions in the given units * as floating-point values. * * @param units unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM} * @return a two-element array with the {@code X} dimension at index 0 and * the {@code Y} dimension at index 1 * @throws IllegalArgumentException if {@code units < 1} */ public float[] getSize(int units) { return new float[] {getX(units), getY(units)}; } /** * Returns this two-dimensional size attribute's {@code X} dimension in the * given units as a floating-point value. * * @param units unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM} * @return {@code X} dimension * @throws IllegalArgumentException if {@code units < 1} */ public float getX(int units) { return convertFromMicrometers(x, units); } /** * Returns this two-dimensional size attribute's {@code Y} dimension in the * given units as a floating-point value. * * @param units unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM} * @return {@code Y} dimension * @throws IllegalArgumentException if {@code units < 1} */ public float getY(int units) { return convertFromMicrometers(y, units); } /** * Returns a string version of this two-dimensional size attribute in the * given units. The string takes the form <code>"<i>X</i>x<i>Y</i> * <i>U</i>"</code>, where <i>X</i> is the {@code X} dimension, <i>Y</i> is * the {@code Y} dimension, and <i>U</i> is the units name. The values are * displayed in floating point. * * @param units unit conversion factor, e.g. {@link #INCH INCH} or * {@link #MM MM} * @param unitsName units name string, e.g. {@code in} or {@code mm}. If * {@code null}, no units name is appended to the result * @return {@code String} version of this two-dimensional size attribute * @throws IllegalArgumentException if {@code units < 1} */ public String toString(int units, String unitsName) { StringBuilder result = new StringBuilder(); result.append(getX (units)); result.append('x'); result.append(getY (units)); if (unitsName != null) { result.append(' '); result.append(unitsName); } return result.toString(); } /** * Returns whether this two-dimensional size attribute is equivalent to the * passed in object. To be equivalent, all of the following conditions must * be true: * <ol type=1> * <li>{@code object} is not {@code null}. * <li>{@code object} is an instance of class {@code Size2DSyntax} * <li>This attribute's {@code X} dimension is equal to {@code object}'s * {@code X} dimension. * <li>This attribute's {@code Y} dimension is equal to {@code object}'s * {@code Y} dimension. * </ol> * * @param object {@code Object} to compare to * @return {@code true} if {@code object} is equivalent to this * two-dimensional size attribute, {@code false} otherwise */ public boolean equals(Object object) { return(object != null && object instanceof Size2DSyntax && this.x == ((Size2DSyntax) object).x && this.y == ((Size2DSyntax) object).y); } /** * Returns a hash code value for this two-dimensional size attribute. */ public int hashCode() { return (((x & 0x0000FFFF) ) | ((y & 0x0000FFFF) << 16)); } /** * Returns a string version of this two-dimensional size attribute. The * string takes the form <code>"<i>X</i>x<i>Y</i> um"</code>, where <i>X</i> * is the {@code X} dimension and <i>Y</i> is the {@code Y} dimension. The * values are reported in the internal units of micrometers. */ public String toString() { StringBuilder result = new StringBuilder(); result.append(x); result.append('x'); result.append(y); result.append(" um"); return result.toString(); } /** * Returns this two-dimensional size attribute's {@code X} dimension in * units of micrometers (&#181;m). (For use in a subclass.) * * @return {@code X} dimension (&#181;m) */ protected int getXMicrometers(){ return x; } /** * Returns this two-dimensional size attribute's {@code Y} dimension in * units of micrometers (&#181;m). (For use in a subclass.) * * @return {@code Y} dimension (&#181;m) */ protected int getYMicrometers() { return y; } }
md-5/jdk10
src/java.desktop/share/classes/javax/print/attribute/Size2DSyntax.java
Java
gpl-2.0
12,328
<?php /** * @package Joomla.Libraries * @subpackage Less * * @copyright (C) 2014 Open Source Matters, Inc. <https://www.joomla.org> * @license GNU General Public License version 2 or later; see LICENSE.txt */ defined('JPATH_PLATFORM') or die; /** * Formatter ruleset for Joomla formatted CSS generated via LESS * * @package Joomla.Libraries * @subpackage Less * @since 3.4 * @deprecated 4.0 without replacement */ class JLessFormatterJoomla extends lessc_formatter_classic { public $disableSingle = true; public $breakSelectors = true; public $assignSeparator = ': '; public $selectorSeparator = ','; public $indentChar = "\t"; }
zero-24/joomla-cms
libraries/cms/less/formatter/joomla.php
PHP
gpl-2.0
678
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <title>Font Face Demo</title> <link rel="stylesheet" href="stylesheet.css" type="text/css" charset="utf-8"> <style type="text/css" media="screen"> h1.fontface {font: 60px/68px 'YanoneKaffeesatzRegular', Arial, sans-serif;letter-spacing: 0;} p.style1 {font: 18px/27px 'YanoneKaffeesatzThin', Arial, sans-serif;} p.style2 {font: 18px/27px 'YanoneKaffeesatzLight', Arial, sans-serif;} p.style3 {font: 18px/27px 'YanoneKaffeesatzRegular', Arial, sans-serif;} p.style4 {font: 18px/27px 'YanoneKaffeesatzBold', Arial, sans-serif;} #container { width: 800px; margin-left: auto; margin-right: auto; } </style> </head> <body> <div id="container"> <h1 class="fontface">Font-face Demo for the Yanone Kaffeesatz Font</h1> <p class="style1">Yanone Kaffeesatz Thin - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p class="style2">Yanone Kaffeesatz Light - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p class="style3">Yanone Kaffeesatz Regular - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> <p class="style4">Yanone Kaffeesatz Bold - Lorem ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p> </div> </body> </html>
RemanenceStudio/intuisens
wp-content/themes/intuisens/css/fonts/yanone/demo.html
HTML
gpl-2.0
3,034
/* Copyright (c) 2009, Code Aurora Forum. All rights reserved. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2 and * only version 2 as published by the Free Software Foundation. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA * 02110-1301, USA. * */ //FIXME: most allocations need not be GFP_ATOMIC /* FIXME: management of mutexes */ /* FIXME: msm_pmem_region_lookup return values */ /* FIXME: way too many copy to/from user */ /* FIXME: does region->active mean free */ /* FIXME: check limits on command lenghts passed from userspace */ /* FIXME: __msm_release: which queues should we flush when opencnt != 0 */ #include <linux/kernel.h> #include <linux/module.h> #include <linux/init.h> #include <mach/board.h> #include <linux/uaccess.h> #include <linux/fs.h> #include <linux/list.h> #include <linux/uaccess.h> #include <linux/android_pmem.h> #include <linux/poll.h> #include <media/msm_camera.h> #include <mach/camera.h> #if defined(CONFIG_MACH_TASS) || defined(CONFIG_MACH_TASSDT) #include "s5k5caff_rough.h" #endif//PCAM #include <linux/syscalls.h> #include <linux/hrtimer.h> DEFINE_MUTEX(hlist_mut); DEFINE_MUTEX(pp_prev_lock); DEFINE_MUTEX(pp_snap_lock); DEFINE_MUTEX(ctrl_cmd_lock); #define MSM_MAX_CAMERA_SENSORS 5 #define CAMERA_STOP_SNAPSHOT 42 #define ERR_USER_COPY(to) pr_err("%s(%d): copy %s user\n", \ __func__, __LINE__, ((to) ? "to" : "from")) #define ERR_COPY_FROM_USER() ERR_USER_COPY(0) #define ERR_COPY_TO_USER() ERR_USER_COPY(1) static struct class *msm_class; static dev_t msm_devno; static LIST_HEAD(msm_sensors); struct msm_control_device *g_v4l2_control_device; int g_v4l2_opencnt; #define __CONTAINS(r, v, l, field) ({ \ typeof(r) __r = r; \ typeof(v) __v = v; \ typeof(v) __e = __v + l; \ int res = __v >= __r->field && \ __e <= __r->field + __r->len; \ res; \ }) #define CONTAINS(r1, r2, field) ({ \ typeof(r2) __r2 = r2; \ __CONTAINS(r1, __r2->field, __r2->len, field); \ }) #define IN_RANGE(r, v, field) ({ \ typeof(r) __r = r; \ typeof(v) __vv = v; \ int res = ((__vv >= __r->field) && \ (__vv < (__r->field + __r->len))); \ res; \ }) #define OVERLAPS(r1, r2, field) ({ \ typeof(r1) __r1 = r1; \ typeof(r2) __r2 = r2; \ typeof(__r2->field) __v = __r2->field; \ typeof(__v) __e = __v + __r2->len - 1; \ int res = (IN_RANGE(__r1, __v, field) || \ IN_RANGE(__r1, __e, field)); \ res; \ }) static inline void free_qcmd(struct msm_queue_cmd *qcmd) { if (!qcmd || !atomic_read(&qcmd->on_heap)) return; if (!atomic_sub_return(1, &qcmd->on_heap)) kfree(qcmd); } static void msm_queue_init(struct msm_device_queue *queue, const char *name) { spin_lock_init(&queue->lock); queue->len = 0; queue->max = 0; queue->name = name; INIT_LIST_HEAD(&queue->list); init_waitqueue_head(&queue->wait); } static void msm_enqueue(struct msm_device_queue *queue, struct list_head *entry) { unsigned long flags; spin_lock_irqsave(&queue->lock, flags); queue->len++; if (queue->len > queue->max) { queue->max = queue->len; pr_info("%s: queue %s new max is %d\n", __func__, queue->name, queue->max); } list_add_tail(entry, &queue->list); wake_up(&queue->wait); CDBG("%s: woke up %s\n", __func__, queue->name); spin_unlock_irqrestore(&queue->lock, flags); } #define msm_dequeue(queue, member) ({ \ unsigned long flags; \ struct msm_device_queue *__q = (queue); \ struct msm_queue_cmd *qcmd = 0; \ spin_lock_irqsave(&__q->lock, flags); \ if (!list_empty(&__q->list)) { \ __q->len--; \ qcmd = list_first_entry(&__q->list, \ struct msm_queue_cmd, member); \ list_del_init(&qcmd->member); \ } \ spin_unlock_irqrestore(&__q->lock, flags); \ qcmd; \ }) #define msm_queue_drain(queue, member) do { \ unsigned long flags; \ struct msm_device_queue *__q = (queue); \ struct msm_queue_cmd *qcmd; \ spin_lock_irqsave(&__q->lock, flags); \ CDBG("%s: draining queue %s\n", __func__, __q->name); \ while (!list_empty(&__q->list)) { \ __q->len--; \ qcmd = list_first_entry(&__q->list, \ struct msm_queue_cmd, member); \ list_del_init(&qcmd->member); \ free_qcmd(qcmd); \ }; \ spin_unlock_irqrestore(&__q->lock, flags); \ } while (0) static int check_overlap(struct hlist_head *ptype, unsigned long paddr, unsigned long len) { struct msm_pmem_region *region; struct msm_pmem_region t = { .paddr = paddr, .len = len }; struct hlist_node *node; hlist_for_each_entry(region, node, ptype, list) { if (CONTAINS(region, &t, paddr) || CONTAINS(&t, region, paddr) || OVERLAPS(region, &t, paddr)) { CDBG(" region (PHYS %p len %ld)" " clashes with registered region" " (paddr %p len %ld)\n", (void *)t.paddr, t.len, (void *)region->paddr, region->len); return -1; } } return 0; } static int check_pmem_info(struct msm_pmem_info *info, int len) { if (info->offset < len && info->offset + info->len <= len && info->y_off < len && info->cbcr_off < len) return 0; pr_err("%s: check failed: off %d len %d y %d cbcr %d (total len %d)\n", __func__, info->offset, info->len, info->y_off, info->cbcr_off, len); return -EINVAL; } static int msm_pmem_table_add(struct hlist_head *ptype, struct msm_pmem_info *info) { struct file *file; unsigned long paddr; unsigned long kvstart; unsigned long len; int rc; struct msm_pmem_region *region; rc = get_pmem_file(info->fd, &paddr, &kvstart, &len, &file); if (rc < 0) { pr_err("%s: get_pmem_file fd %d error %d\n", __func__, info->fd, rc); return rc; } if (!info->len) info->len = len; rc = check_pmem_info(info, len); if (rc < 0) return rc; paddr += info->offset; len = info->len; if (check_overlap(ptype, paddr, len) < 0) return -EINVAL; CDBG("%s: type %d, paddr 0x%lx, vaddr 0x%lx\n", __func__, info->type, paddr, (unsigned long)info->vaddr); region = kmalloc(sizeof(struct msm_pmem_region), GFP_KERNEL); if (!region) return -ENOMEM; INIT_HLIST_NODE(&region->list); region->paddr = paddr; region->len = len; region->file = file; memcpy(&region->info, info, sizeof(region->info)); hlist_add_head(&(region->list), ptype); return 0; } /* return of 0 means failure */ static uint8_t msm_pmem_region_lookup(struct hlist_head *ptype, int pmem_type, struct msm_pmem_region *reg, uint8_t maxcount) { struct msm_pmem_region *region; struct msm_pmem_region *regptr; struct hlist_node *node, *n; uint8_t rc = 0; regptr = reg; mutex_lock(&hlist_mut); hlist_for_each_entry_safe(region, node, n, ptype, list) { if (region->info.type == pmem_type && region->info.active) { *regptr = *region; rc += 1; if (rc >= maxcount) break; regptr++; } } mutex_unlock(&hlist_mut); return rc; } static int msm_pmem_frame_ptov_lookup(struct msm_sync *sync, unsigned long pyaddr, unsigned long pcbcraddr, struct msm_pmem_info *pmem_info, int clear_active) { struct msm_pmem_region *region; struct hlist_node *node, *n; hlist_for_each_entry_safe(region, node, n, &sync->pmem_frames, list) { if (pyaddr == (region->paddr + region->info.y_off) && pcbcraddr == (region->paddr + region->info.cbcr_off) && region->info.active) { /* offset since we could pass vaddr inside * a registerd pmem buffer */ memcpy(pmem_info, &region->info, sizeof(*pmem_info)); if (clear_active) region->info.active = 0; return 0; } } return -EINVAL; } static unsigned long msm_pmem_stats_ptov_lookup(struct msm_sync *sync, unsigned long addr, int *fd) { struct msm_pmem_region *region; struct hlist_node *node, *n; hlist_for_each_entry_safe(region, node, n, &sync->pmem_stats, list) { if (addr == region->paddr && region->info.active) { /* offset since we could pass vaddr inside a * registered pmem buffer */ *fd = region->info.fd; region->info.active = 0; return (unsigned long)(region->info.vaddr); } } return 0; } static unsigned long msm_pmem_frame_vtop_lookup(struct msm_sync *sync, unsigned long buffer, uint32_t yoff, uint32_t cbcroff, int fd) { struct msm_pmem_region *region; struct hlist_node *node, *n; hlist_for_each_entry_safe(region, node, n, &sync->pmem_frames, list) { if (((unsigned long)(region->info.vaddr) == buffer) && (region->info.y_off == yoff) && (region->info.cbcr_off == cbcroff) && (region->info.fd == fd) && (region->info.active == 0)) { region->info.active = 1; return region->paddr; } } return 0; } static unsigned long msm_pmem_stats_vtop_lookup( struct msm_sync *sync, unsigned long buffer, int fd) { struct msm_pmem_region *region; struct hlist_node *node, *n; hlist_for_each_entry_safe(region, node, n, &sync->pmem_stats, list) { if (((unsigned long)(region->info.vaddr) == buffer) && (region->info.fd == fd) && region->info.active == 0) { region->info.active = 1; return region->paddr; } } return 0; } static int __msm_pmem_table_del(struct msm_sync *sync, struct msm_pmem_info *pinfo) { int rc = 0; struct msm_pmem_region *region; struct hlist_node *node, *n; switch (pinfo->type) { case MSM_PMEM_VIDEO: case MSM_PMEM_PREVIEW: case MSM_PMEM_THUMBNAIL: case MSM_PMEM_MAINIMG: case MSM_PMEM_RAW_MAINIMG: hlist_for_each_entry_safe(region, node, n, &sync->pmem_frames, list) { if (pinfo->type == region->info.type && pinfo->vaddr == region->info.vaddr && pinfo->fd == region->info.fd) { hlist_del(node); put_pmem_file(region->file); kfree(region); } } break; case MSM_PMEM_AEC_AWB: case MSM_PMEM_AF: hlist_for_each_entry_safe(region, node, n, &sync->pmem_stats, list) { if (pinfo->type == region->info.type && pinfo->vaddr == region->info.vaddr && pinfo->fd == region->info.fd) { hlist_del(node); put_pmem_file(region->file); kfree(region); } } break; default: rc = -EINVAL; break; } return rc; } static int msm_pmem_table_del(struct msm_sync *sync, void __user *arg) { struct msm_pmem_info info; if (copy_from_user(&info, arg, sizeof(info))) { ERR_COPY_FROM_USER(); return -EFAULT; } return __msm_pmem_table_del(sync, &info); } static int __msm_get_frame(struct msm_sync *sync, struct msm_frame *frame) { int rc = 0; struct msm_pmem_info pmem_info; struct msm_queue_cmd *qcmd = NULL; struct msm_vfe_resp *vdata; struct msm_vfe_phy_info *pphy; qcmd = msm_dequeue(&sync->frame_q, list_frame); if (!qcmd) { pr_err("%s: no preview frame.\n", __func__); return -EAGAIN; } vdata = (struct msm_vfe_resp *)(qcmd->command); pphy = &vdata->phy; rc = msm_pmem_frame_ptov_lookup(sync, pphy->y_phy, pphy->cbcr_phy, &pmem_info, 1); /* mark frame in use */ if (rc < 0) { pr_err("%s: cannot get frame, invalid lookup address " "y %x cbcr %x\n", __func__, pphy->y_phy, pphy->cbcr_phy); goto err; } frame->ts = qcmd->ts; frame->buffer = (unsigned long)pmem_info.vaddr; frame->y_off = pmem_info.y_off; frame->cbcr_off = pmem_info.cbcr_off; frame->fd = pmem_info.fd; frame->path = vdata->phy.output_id; CDBG("%s: y %x, cbcr %x, qcmd %x, virt_addr %x\n", __func__, pphy->y_phy, pphy->cbcr_phy, (int) qcmd, (int) frame->buffer); err: free_qcmd(qcmd); return rc; } static int msm_get_frame(struct msm_sync *sync, void __user *arg) { int rc = 0; struct msm_frame frame; if (copy_from_user(&frame, arg, sizeof(struct msm_frame))) { ERR_COPY_FROM_USER(); return -EFAULT; } rc = __msm_get_frame(sync, &frame); if (rc < 0) return rc; /* read the frame after the status has been read */ rmb(); if (sync->croplen) { if (frame.croplen != sync->croplen) { pr_err("%s: invalid frame croplen %d," "expecting %d\n", __func__, frame.croplen, sync->croplen); return -EINVAL; } if (copy_to_user((void *)frame.cropinfo, sync->cropinfo, sync->croplen)) { ERR_COPY_TO_USER(); return -EFAULT; } } if (copy_to_user((void *)arg, &frame, sizeof(struct msm_frame))) { ERR_COPY_TO_USER(); rc = -EFAULT; } CDBG("%s: got frame\n", __func__); return rc; } static int msm_enable_vfe(struct msm_sync *sync, void __user *arg) { int rc = -EIO; struct camera_enable_cmd cfg; if (copy_from_user(&cfg, arg, sizeof(struct camera_enable_cmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } if (sync->vfefn.vfe_enable) rc = sync->vfefn.vfe_enable(&cfg); CDBG("%s: rc %d\n", __func__, rc); return rc; } static int msm_disable_vfe(struct msm_sync *sync, void __user *arg) { int rc = -EIO; struct camera_enable_cmd cfg; if (copy_from_user(&cfg, arg, sizeof(struct camera_enable_cmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } if (sync->vfefn.vfe_disable) rc = sync->vfefn.vfe_disable(&cfg, NULL); CDBG("%s: rc %d\n", __func__, rc); return rc; } static struct msm_queue_cmd *__msm_control(struct msm_sync *sync, struct msm_device_queue *queue, struct msm_queue_cmd *qcmd, int timeout) { int rc; CDBG("Inside __msm_control\n"); msm_enqueue(&sync->event_q, &qcmd->list_config); /* wake up config thread */ if (!queue) return NULL; /* wait for config status */ CDBG("Waiting for config status \n"); rc = wait_event_interruptible_timeout( queue->wait, !list_empty_careful(&queue->list), timeout); CDBG("Waiting over for config status \n"); if (list_empty_careful(&queue->list)) { if (!rc) rc = -ETIMEDOUT; if (rc < 0) { pr_err("%s: wait_event error %d\n", __func__, rc); return ERR_PTR(rc); } } qcmd = msm_dequeue(queue, list_control); BUG_ON(!qcmd); CDBG("__msm_control done \n"); return qcmd; } static struct msm_queue_cmd *__msm_control_nb(struct msm_sync *sync, struct msm_queue_cmd *qcmd_to_copy) { /* Since this is a non-blocking command, we cannot use qcmd_to_copy and * its data, since they are on the stack. We replicate them on the heap * and mark them on_heap so that they get freed when the config thread * dequeues them. */ struct msm_ctrl_cmd *udata; struct msm_ctrl_cmd *udata_to_copy = qcmd_to_copy->command; struct msm_queue_cmd *qcmd = kmalloc(sizeof(*qcmd_to_copy) + sizeof(*udata_to_copy) + udata_to_copy->length, GFP_KERNEL); if (!qcmd) { pr_err("%s: out of memory\n", __func__); return ERR_PTR(-ENOMEM); } *qcmd = *qcmd_to_copy; udata = qcmd->command = qcmd + 1; memcpy(udata, udata_to_copy, sizeof(*udata)); udata->value = udata + 1; memcpy(udata->value, udata_to_copy->value, udata_to_copy->length); atomic_set(&qcmd->on_heap, 1); /* qcmd_resp will be set to NULL */ return __msm_control(sync, NULL, qcmd, 0); } static int msm_control(struct msm_control_device *ctrl_pmsm, int block, void __user *arg) { int rc = 0; struct msm_sync *sync = ctrl_pmsm->pmsm->sync; void __user *uptr; struct msm_ctrl_cmd udata; struct msm_queue_cmd qcmd; struct msm_queue_cmd *qcmd_resp = NULL; uint8_t data[max_control_command_size]; CDBG("Inside msm_control\n"); if (copy_from_user(&udata, arg, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_FROM_USER(); rc = -EFAULT; goto end; } uptr = udata.value; udata.value = data; if (udata.type == CAMERA_STOP_SNAPSHOT) sync->get_pic_abort = 1; atomic_set(&qcmd.on_heap, 0); qcmd.type = MSM_CAM_Q_CTRL; qcmd.command = &udata; if (udata.length) { if (udata.length > sizeof(data)) { pr_err("%s: user data too large (%d, max is %d)\n", __func__, udata.length, sizeof(data)); rc = -EIO; goto end; } if (copy_from_user(udata.value, uptr, udata.length)) { ERR_COPY_FROM_USER(); rc = -EFAULT; goto end; } } if (unlikely(!block)) { qcmd_resp = __msm_control_nb(sync, &qcmd); goto end; } qcmd_resp = __msm_control(sync, &ctrl_pmsm->ctrl_q, &qcmd, MAX_SCHEDULE_TIMEOUT); if (!qcmd_resp || IS_ERR(qcmd_resp)) { /* Do not free qcmd_resp here. If the config thread read it, * then it has already been freed, and we timed out because * we did not receive a MSM_CAM_IOCTL_CTRL_CMD_DONE. If the * config thread itself is blocked and not dequeueing commands, * then it will either eventually unblock and process them, * or when it is killed, qcmd will be freed in * msm_release_config. */ rc = PTR_ERR(qcmd_resp); qcmd_resp = NULL; goto end; } if (qcmd_resp->command) { udata = *(struct msm_ctrl_cmd *)qcmd_resp->command; if (udata.length > 0) { if (copy_to_user(uptr, udata.value, udata.length)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto end; } } udata.value = uptr; if (copy_to_user((void *)arg, &udata, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_TO_USER(); rc = -EFAULT; goto end; } } end: free_qcmd(qcmd_resp); CDBG(" msm_control done\n"); CDBG("%s: rc %d\n", __func__, rc); return rc; } /* Divert frames for post-processing by delivering them to the config thread; * when post-processing is done, it will return the frame to the frame thread. */ static int msm_divert_frame(struct msm_sync *sync, struct msm_vfe_resp *data, struct msm_stats_event_ctrl *se) { struct msm_pmem_info pinfo; struct msm_postproc buf; int rc; pr_info("%s: preview PP sync->pp_mask %d\n", __func__, sync->pp_mask); if (!(sync->pp_mask & PP_PREV)) { pr_err("%s: diverting preview frame but not in PP_PREV!\n", __func__); return -EINVAL; } rc = msm_pmem_frame_ptov_lookup(sync, data->phy.y_phy, data->phy.cbcr_phy, &pinfo, 0); /* do clear the active flag */ if (rc < 0) { CDBG("%s: msm_pmem_frame_ptov_lookup failed\n", __func__); return rc; } buf.fmain.buffer = (unsigned long)pinfo.vaddr; buf.fmain.y_off = pinfo.y_off; buf.fmain.cbcr_off = pinfo.cbcr_off; buf.fmain.fd = pinfo.fd; CDBG("%s: buf %ld fd %d\n", __func__, buf.fmain.buffer, buf.fmain.fd); if (copy_to_user((void *)(se->stats_event.data), &(buf.fmain), sizeof(struct msm_frame))) { ERR_COPY_TO_USER(); return -EFAULT; } return 0; } static int msm_divert_snapshot(struct msm_sync *sync, struct msm_vfe_resp *data, struct msm_stats_event_ctrl *se) { struct msm_postproc buf; struct msm_pmem_region region; CDBG("%s: preview PP sync->pp_mask %d\n", __func__, sync->pp_mask); if (!(sync->pp_mask & (PP_SNAP|PP_RAW_SNAP))) { pr_err("%s: diverting snapshot but not in PP_SNAP!\n", __func__); return -EINVAL; } memset(&region, 0, sizeof(region)); buf.fmnum = msm_pmem_region_lookup(&sync->pmem_frames, MSM_PMEM_THUMBNAIL, &region, 1); if (buf.fmnum == 1) { buf.fthumnail.buffer = (uint32_t)region.info.vaddr; buf.fthumnail.y_off = region.info.y_off; buf.fthumnail.cbcr_off = region.info.cbcr_off; buf.fthumnail.fd = region.info.fd; } buf.fmnum = msm_pmem_region_lookup(&sync->pmem_frames, MSM_PMEM_MAINIMG, &region, 1); if (buf.fmnum == 1) { buf.fmain.buffer = (uint32_t)region.info.vaddr; buf.fmain.y_off = region.info.y_off; buf.fmain.cbcr_off = region.info.cbcr_off; buf.fmain.fd = region.info.fd; goto end; } buf.fmnum = msm_pmem_region_lookup(&sync->pmem_frames, MSM_PMEM_RAW_MAINIMG, &region, 1); if (buf.fmnum == 1) { buf.fmain.path = MSM_FRAME_PREV_2; buf.fmain.buffer = (uint32_t)region.info.vaddr; buf.fmain.fd = region.info.fd; } else { pr_err("%s: pmem lookup fail (found %d)\n", __func__, buf.fmnum); return -EIO; } end: CDBG("%s: snapshot copy_to_user!\n", __func__); if (copy_to_user((void *)(se->stats_event.data), &buf, sizeof(buf))) { ERR_COPY_TO_USER(); return -EFAULT; } return 0; } static int msm_get_stats(struct msm_sync *sync, void __user *arg) { int timeout; int rc = 0; struct msm_stats_event_ctrl se; struct msm_queue_cmd *qcmd = NULL; struct msm_ctrl_cmd *ctrl = NULL; struct msm_vfe_resp *data = NULL; struct msm_stats_buf stats; if (copy_from_user(&se, arg, sizeof(struct msm_stats_event_ctrl))) { ERR_COPY_FROM_USER(); return -EFAULT; } timeout = (int)se.timeout_ms; CDBG("%s: timeout %d\n", __func__, timeout); rc = wait_event_interruptible_timeout( sync->event_q.wait, !list_empty_careful(&sync->event_q.list), msecs_to_jiffies(timeout)); if (list_empty_careful(&sync->event_q.list)) { if (rc == 0) rc = -ETIMEDOUT; if (rc < 0) { pr_err("%s: error %d\n", __func__, rc); return rc; } } CDBG("%s: returned from wait: %d\n", __func__, rc); rc = 0; qcmd = msm_dequeue(&sync->event_q, list_config); BUG_ON(!qcmd); CDBG("%s: received from DSP %d\n", __func__, qcmd->type); /* order the reads of stat/snapshot buffers */ rmb(); switch (qcmd->type) { case MSM_CAM_Q_VFE_EVT: case MSM_CAM_Q_VFE_MSG: data = (struct msm_vfe_resp *)(qcmd->command); /* adsp event and message */ se.resptype = MSM_CAM_RESP_STAT_EVT_MSG; /* 0 - msg from aDSP, 1 - event from mARM */ se.stats_event.type = data->evt_msg.type; se.stats_event.msg_id = data->evt_msg.msg_id; se.stats_event.len = data->evt_msg.len; CDBG("%s: qcmd->type %d length %d msd_id %d\n", __func__, qcmd->type, se.stats_event.len, se.stats_event.msg_id); if ((data->type >= VFE_MSG_STATS_AEC) && (data->type <= VFE_MSG_STATS_WE)) { /* the check above includes all stats type. */ stats.buffer = msm_pmem_stats_ptov_lookup(sync, data->phy.sbuf_phy, &(stats.fd)); if (!stats.buffer) { pr_err("%s: msm_pmem_stats_ptov_lookup error\n", __func__); rc = -EINVAL; goto failure; } if (copy_to_user((void *)(se.stats_event.data), &stats, sizeof(struct msm_stats_buf))) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } else if ((data->evt_msg.len > 0) && (data->type == VFE_MSG_GENERAL)) { if (copy_to_user((void *)(se.stats_event.data), data->evt_msg.data, data->evt_msg.len)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } else { if ((sync->pp_mask & PP_PREV) && (data->type == VFE_MSG_OUTPUT_P)) rc = msm_divert_frame(sync, data, &se); else if ((sync->pp_mask & (PP_SNAP|PP_RAW_SNAP)) && (data->type == VFE_MSG_SNAPSHOT || data->type == VFE_MSG_OUTPUT_S)) rc = msm_divert_snapshot(sync, data, &se); } break; case MSM_CAM_Q_CTRL: /* control command from control thread */ ctrl = (struct msm_ctrl_cmd *)(qcmd->command); CDBG("%s: qcmd->type %d length %d\n", __func__, qcmd->type, ctrl->length); if (ctrl->length > 0) { if (copy_to_user((void *)(se.ctrl_cmd.value), ctrl->value, ctrl->length)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } se.resptype = MSM_CAM_RESP_CTRL; /* what to control */ se.ctrl_cmd.type = ctrl->type; se.ctrl_cmd.length = ctrl->length; se.ctrl_cmd.resp_fd = ctrl->resp_fd; break; case MSM_CAM_Q_V4L2_REQ: /* control command from v4l2 client */ ctrl = (struct msm_ctrl_cmd *)(qcmd->command); if (ctrl->length > 0) { if (copy_to_user((void *)(se.ctrl_cmd.value), ctrl->value, ctrl->length)) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } } /* 2 tells config thread this is v4l2 request */ se.resptype = MSM_CAM_RESP_V4L2; /* what to control */ se.ctrl_cmd.type = ctrl->type; se.ctrl_cmd.length = ctrl->length; break; default: rc = -EFAULT; goto failure; } /* switch qcmd->type */ if (copy_to_user((void *)arg, &se, sizeof(se))) { ERR_COPY_TO_USER(); rc = -EFAULT; goto failure; } failure: free_qcmd(qcmd); CDBG("%s: %d\n", __func__, rc); return rc; } static int msm_ctrl_cmd_done(struct msm_control_device *ctrl_pmsm, void __user *arg) { void __user *uptr; struct msm_queue_cmd *qcmd = &ctrl_pmsm->qcmd; struct msm_ctrl_cmd *command = &ctrl_pmsm->ctrl; if (copy_from_user(command, arg, sizeof(*command))) { ERR_COPY_FROM_USER(); return -EFAULT; } atomic_set(&qcmd->on_heap, 0); qcmd->command = command; uptr = command->value; if (command->length > 0) { command->value = ctrl_pmsm->ctrl_data; if (command->length > sizeof(ctrl_pmsm->ctrl_data)) { pr_err("%s: user data %d is too big (max %d)\n", __func__, command->length, sizeof(ctrl_pmsm->ctrl_data)); return -EINVAL; } if (copy_from_user(command->value, uptr, command->length)) { ERR_COPY_FROM_USER(); return -EFAULT; } } else command->value = NULL; /* wake up control thread */ msm_enqueue(&ctrl_pmsm->ctrl_q, &qcmd->list_control); return 0; } static int msm_config_vfe(struct msm_sync *sync, void __user *arg) { struct msm_vfe_cfg_cmd cfgcmd; struct msm_pmem_region region[8]; struct axidata axi_data; if (!sync->vfefn.vfe_config) { pr_err("%s: no vfe_config!\n", __func__); return -EIO; } if (copy_from_user(&cfgcmd, arg, sizeof(cfgcmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } memset(&axi_data, 0, sizeof(axi_data)); CDBG("%s: cmd_type %d\n", __func__, cfgcmd.cmd_type); switch (cfgcmd.cmd_type) { case CMD_STATS_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AEC_AWB, &region[0], NUM_STAT_OUTPUT_BUFFERS); axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AF, &region[axi_data.bufnum1], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1 || !axi_data.bufnum2) { pr_err("%s: pmem region lookup error\n", __func__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AF_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AF, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AEC_AWB_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AEC_AWB, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AEC_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AEC, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_AWB_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_AWB, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_IHIST_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_IHIST, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_RS_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_RS, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_STATS_CS_ENABLE: axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, MSM_PMEM_CS, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; return sync->vfefn.vfe_config(&cfgcmd, &axi_data); case CMD_GENERAL: case CMD_STATS_DISABLE: return sync->vfefn.vfe_config(&cfgcmd, NULL); default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd.cmd_type); } return -EINVAL; } static int msm_frame_axi_cfg(struct msm_sync *sync, struct msm_vfe_cfg_cmd *cfgcmd) { int rc = -EIO; struct axidata axi_data; void *data = &axi_data; struct msm_pmem_region region[8]; int pmem_type; memset(&axi_data, 0, sizeof(axi_data)); switch (cfgcmd->cmd_type) { case CMD_AXI_CFG_PREVIEW: pmem_type = MSM_PMEM_PREVIEW; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error (empty %d)\n", __func__, __LINE__, hlist_empty(&sync->pmem_frames)); return -EINVAL; } break; case CMD_AXI_CFG_VIDEO: pmem_type = MSM_PMEM_PREVIEW; axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } pmem_type = MSM_PMEM_VIDEO; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[axi_data.bufnum1], (8-(axi_data.bufnum1))); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } break; case CMD_AXI_CFG_SNAP: pmem_type = MSM_PMEM_THUMBNAIL; axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } pmem_type = MSM_PMEM_MAINIMG; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[axi_data.bufnum1], (8-(axi_data.bufnum1))); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } break; case CMD_RAW_PICT_AXI_CFG: pmem_type = MSM_PMEM_RAW_MAINIMG; axi_data.bufnum2 = msm_pmem_region_lookup(&sync->pmem_frames, pmem_type, &region[0], 8); if (!axi_data.bufnum2) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } break; case CMD_GENERAL: data = NULL; break; default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd->cmd_type); return -EINVAL; } axi_data.region = &region[0]; /* send the AXI configuration command to driver */ if (sync->vfefn.vfe_config) rc = sync->vfefn.vfe_config(cfgcmd, data); return rc; } static int msm_get_sensor_info(struct msm_sync *sync, void __user *arg) { int rc = 0; struct msm_camsensor_info info; struct msm_camera_sensor_info *sdata; if (copy_from_user(&info, arg, sizeof(struct msm_camsensor_info))) { ERR_COPY_FROM_USER(); return -EFAULT; } sdata = sync->pdev->dev.platform_data; CDBG("%s: sensor_name %s\n", __func__, sdata->sensor_name); memcpy(&info.name[0], sdata->sensor_name, MAX_SENSOR_NAME); info.flash_enabled = sdata->flash_data->flash_type != MSM_CAMERA_FLASH_NONE; /* copy back to user space */ if (copy_to_user((void *)arg, &info, sizeof(struct msm_camsensor_info))) { ERR_COPY_TO_USER(); rc = -EFAULT; } return rc; } static int __msm_put_frame_buf(struct msm_sync *sync, struct msm_frame *pb) { unsigned long pphy; struct msm_vfe_cfg_cmd cfgcmd; int rc = -EIO; pphy = msm_pmem_frame_vtop_lookup(sync, pb->buffer, pb->y_off, pb->cbcr_off, pb->fd); if (pphy != 0) { CDBG("%s: rel: vaddr %lx, paddr %lx\n", __func__, pb->buffer, pphy); cfgcmd.cmd_type = CMD_FRAME_BUF_RELEASE; cfgcmd.value = (void *)pb; if (sync->vfefn.vfe_config) rc = sync->vfefn.vfe_config(&cfgcmd, &pphy); } else { pr_err("%s: msm_pmem_frame_vtop_lookup failed\n", __func__); rc = -EINVAL; } return rc; } static int msm_put_frame_buffer(struct msm_sync *sync, void __user *arg) { struct msm_frame buf_t; if (copy_from_user(&buf_t, arg, sizeof(struct msm_frame))) { ERR_COPY_FROM_USER(); return -EFAULT; } return __msm_put_frame_buf(sync, &buf_t); } static int __msm_register_pmem(struct msm_sync *sync, struct msm_pmem_info *pinfo) { int rc = 0; switch (pinfo->type) { case MSM_PMEM_VIDEO: case MSM_PMEM_PREVIEW: case MSM_PMEM_THUMBNAIL: case MSM_PMEM_MAINIMG: case MSM_PMEM_RAW_MAINIMG: rc = msm_pmem_table_add(&sync->pmem_frames, pinfo); break; case MSM_PMEM_AEC_AWB: case MSM_PMEM_AF: case MSM_PMEM_AEC: case MSM_PMEM_AWB: case MSM_PMEM_RS: case MSM_PMEM_CS: case MSM_PMEM_IHIST: case MSM_PMEM_SKIN: rc = msm_pmem_table_add(&sync->pmem_stats, pinfo); break; default: rc = -EINVAL; break; } return rc; } static int msm_register_pmem(struct msm_sync *sync, void __user *arg) { struct msm_pmem_info info; if (copy_from_user(&info, arg, sizeof(info))) { ERR_COPY_FROM_USER(); return -EFAULT; } return __msm_register_pmem(sync, &info); } static int msm_stats_axi_cfg(struct msm_sync *sync, struct msm_vfe_cfg_cmd *cfgcmd) { int rc = -EIO; struct axidata axi_data; void *data = &axi_data; struct msm_pmem_region region[3]; int pmem_type = MSM_PMEM_MAX; memset(&axi_data, 0, sizeof(axi_data)); switch (cfgcmd->cmd_type) { case CMD_STATS_AXI_CFG: pmem_type = MSM_PMEM_AEC_AWB; break; case CMD_STATS_AF_AXI_CFG: pmem_type = MSM_PMEM_AF; break; case CMD_GENERAL: data = NULL; break; default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd->cmd_type); return -EINVAL; } if (cfgcmd->cmd_type != CMD_GENERAL) { axi_data.bufnum1 = msm_pmem_region_lookup(&sync->pmem_stats, pmem_type, &region[0], NUM_STAT_OUTPUT_BUFFERS); if (!axi_data.bufnum1) { pr_err("%s %d: pmem region lookup error\n", __func__, __LINE__); return -EINVAL; } axi_data.region = &region[0]; } /* send the AEC/AWB STATS configuration command to driver */ if (sync->vfefn.vfe_config) rc = sync->vfefn.vfe_config(cfgcmd, &axi_data); return rc; } static int msm_put_stats_buffer(struct msm_sync *sync, void __user *arg) { int rc = -EIO; struct msm_stats_buf buf; unsigned long pphy; struct msm_vfe_cfg_cmd cfgcmd; if (copy_from_user(&buf, arg, sizeof(struct msm_stats_buf))) { ERR_COPY_FROM_USER(); return -EFAULT; } CDBG("%s\n", __func__); pphy = msm_pmem_stats_vtop_lookup(sync, buf.buffer, buf.fd); if (pphy != 0) { if (buf.type == STAT_AEAW) cfgcmd.cmd_type = CMD_STATS_BUF_RELEASE; else if (buf.type == STAT_AF) cfgcmd.cmd_type = CMD_STATS_AF_BUF_RELEASE; else if (buf.type == STAT_AEC) cfgcmd.cmd_type = CMD_STATS_AEC_BUF_RELEASE; else if (buf.type == STAT_AWB) cfgcmd.cmd_type = CMD_STATS_AWB_BUF_RELEASE; else if (buf.type == STAT_IHIST) cfgcmd.cmd_type = CMD_STATS_IHIST_BUF_RELEASE; else if (buf.type == STAT_RS) cfgcmd.cmd_type = CMD_STATS_RS_BUF_RELEASE; else if (buf.type == STAT_CS) cfgcmd.cmd_type = CMD_STATS_CS_BUF_RELEASE; else { pr_err("%s: invalid buf type %d\n", __func__, buf.type); rc = -EINVAL; goto put_done; } cfgcmd.value = (void *)&buf; if (sync->vfefn.vfe_config) { rc = sync->vfefn.vfe_config(&cfgcmd, &pphy); if (rc < 0) pr_err("%s: vfe_config error %d\n", __func__, rc); } else pr_err("%s: vfe_config is NULL\n", __func__); } else { pr_err("%s: NULL physical address\n", __func__); rc = -EINVAL; } put_done: return rc; } static int msm_axi_config(struct msm_sync *sync, void __user *arg) { struct msm_vfe_cfg_cmd cfgcmd; if (copy_from_user(&cfgcmd, arg, sizeof(cfgcmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } switch (cfgcmd.cmd_type) { case CMD_AXI_CFG_VIDEO: case CMD_AXI_CFG_PREVIEW: case CMD_AXI_CFG_SNAP: case CMD_RAW_PICT_AXI_CFG: return msm_frame_axi_cfg(sync, &cfgcmd); case CMD_STATS_AXI_CFG: case CMD_STATS_AF_AXI_CFG: return msm_stats_axi_cfg(sync, &cfgcmd); default: pr_err("%s: unknown command type %d\n", __func__, cfgcmd.cmd_type); return -EINVAL; } return 0; } static int __msm_get_pic(struct msm_sync *sync, struct msm_ctrl_cmd *ctrl) { int rc = 0; int tm; struct msm_queue_cmd *qcmd = NULL; tm = (int)ctrl->timeout_ms; rc = wait_event_interruptible_timeout( sync->pict_q.wait, !list_empty_careful( &sync->pict_q.list) || sync->get_pic_abort, msecs_to_jiffies(tm)); if (sync->get_pic_abort == 1) { sync->get_pic_abort = 0; return -ENODATA; } if (list_empty_careful(&sync->pict_q.list)) { if (rc == 0) return -ETIMEDOUT; if (rc < 0) { pr_err("%s: rc %d\n", __func__, rc); return rc; } } rc = 0; qcmd = msm_dequeue(&sync->pict_q, list_pict); BUG_ON(!qcmd); if (qcmd->command != NULL) { struct msm_ctrl_cmd *q = (struct msm_ctrl_cmd *)qcmd->command; ctrl->type = q->type; ctrl->status = q->status; } else { ctrl->type = -1; ctrl->status = -1; } free_qcmd(qcmd); return rc; } static int msm_get_pic(struct msm_sync *sync, void __user *arg) { struct msm_ctrl_cmd ctrlcmd_t; int rc; if (copy_from_user(&ctrlcmd_t, arg, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_FROM_USER(); return -EFAULT; } rc = __msm_get_pic(sync, &ctrlcmd_t); if (rc < 0) return rc; if (sync->croplen) { if (ctrlcmd_t.length != sync->croplen) { pr_err("%s: invalid len %d < %d\n", __func__, ctrlcmd_t.length, sync->croplen); return -EINVAL; } if (copy_to_user(ctrlcmd_t.value, sync->cropinfo, sync->croplen)) { ERR_COPY_TO_USER(); return -EFAULT; } } CDBG("%s: copy snapshot frame to user\n", __func__); if (copy_to_user((void *)arg, &ctrlcmd_t, sizeof(struct msm_ctrl_cmd))) { ERR_COPY_TO_USER(); return -EFAULT; } return 0; } static int msm_set_crop(struct msm_sync *sync, void __user *arg) { struct crop_info crop; if (copy_from_user(&crop, arg, sizeof(struct crop_info))) { ERR_COPY_FROM_USER(); return -EFAULT; } if (!sync->croplen) { sync->cropinfo = kmalloc(crop.len, GFP_KERNEL); if (!sync->cropinfo) return -ENOMEM; } else if (sync->croplen < crop.len) return -EINVAL; if (copy_from_user(sync->cropinfo, crop.info, crop.len)) { ERR_COPY_FROM_USER(); kfree(sync->cropinfo); return -EFAULT; } sync->croplen = crop.len; return 0; } static int msm_pp_grab(struct msm_sync *sync, void __user *arg) { uint32_t enable; if (copy_from_user(&enable, arg, sizeof(enable))) { ERR_COPY_FROM_USER(); return -EFAULT; } else { enable &= PP_MASK; if (enable & (enable - 1)) { pr_err("%s: error: more than one PP request!\n", __func__); return -EINVAL; } if (sync->pp_mask) { pr_err("%s: postproc %x is already enabled\n", __func__, sync->pp_mask & enable); return -EINVAL; } CDBG("%s: sync->pp_mask %d enable %d\n", __func__, sync->pp_mask, enable); sync->pp_mask |= enable; } return 0; } static int msm_pp_release(struct msm_sync *sync, void __user *arg) { uint32_t mask; if (copy_from_user(&mask, arg, sizeof(uint32_t))) { ERR_COPY_FROM_USER(); return -EFAULT; } mask &= PP_MASK; if (!sync->pp_mask) { pr_warning("%s: pp not in progress for %x\n", __func__, mask); return -EINVAL; } if (sync->pp_mask & PP_PREV) { if (mask & PP_PREV) { mutex_lock(&pp_prev_lock); if (!sync->pp_prev) { pr_err("%s: no preview frame to deliver!\n", __func__); mutex_unlock(&pp_prev_lock); return -EINVAL; } pr_info("%s: delivering pp_prev\n", __func__); msm_enqueue(&sync->frame_q, &sync->pp_prev->list_frame); sync->pp_prev = NULL; mutex_unlock(&pp_prev_lock); } else if (!(mask & PP_PREV)) { sync->pp_mask &= ~PP_PREV; } goto done; } if (((mask & PP_SNAP) && (sync->pp_mask & PP_SNAP)) || ((mask & PP_RAW_SNAP) && (sync->pp_mask & PP_RAW_SNAP))) { mutex_lock(&pp_snap_lock); if (!sync->pp_snap) { pr_err("%s: no snapshot to deliver!\n", __func__); mutex_unlock(&pp_snap_lock); return -EINVAL; } pr_info("%s: delivering pp_snap\n", __func__); msm_enqueue(&sync->pict_q, &sync->pp_snap->list_pict); sync->pp_snap = NULL; mutex_unlock(&pp_snap_lock); sync->pp_mask &= (mask & PP_SNAP) ? ~PP_SNAP : ~PP_RAW_SNAP; } done: return 0; } static long msm_ioctl_common(struct msm_device *pmsm, unsigned int cmd, void __user *argp) { CDBG("%s\n", __func__); switch (cmd) { case MSM_CAM_IOCTL_REGISTER_PMEM: return msm_register_pmem(pmsm->sync, argp); case MSM_CAM_IOCTL_UNREGISTER_PMEM: return msm_pmem_table_del(pmsm->sync, argp); default: return -EINVAL; } } static long msm_ioctl_config(struct file *filep, unsigned int cmd, unsigned long arg) { int rc = -EINVAL; void __user *argp = (void __user *)arg; struct msm_device *pmsm = filep->private_data; CDBG("%s: cmd %d\n", __func__, _IOC_NR(cmd)); switch (cmd) { case MSM_CAM_IOCTL_GET_SENSOR_INFO: rc = msm_get_sensor_info(pmsm->sync, argp); break; case MSM_CAM_IOCTL_CONFIG_VFE: /* Coming from config thread for update */ rc = msm_config_vfe(pmsm->sync, argp); break; case MSM_CAM_IOCTL_GET_STATS: /* Coming from config thread wait * for vfe statistics and control requests */ rc = msm_get_stats(pmsm->sync, argp); break; case MSM_CAM_IOCTL_ENABLE_VFE: /* This request comes from control thread: * enable either QCAMTASK or VFETASK */ rc = msm_enable_vfe(pmsm->sync, argp); break; case MSM_CAM_IOCTL_DISABLE_VFE: /* This request comes from control thread: * disable either QCAMTASK or VFETASK */ rc = msm_disable_vfe(pmsm->sync, argp); break; case MSM_CAM_IOCTL_VFE_APPS_RESET: msm_camio_vfe_blk_reset(); rc = 0; break; case MSM_CAM_IOCTL_RELEASE_STATS_BUFFER: rc = msm_put_stats_buffer(pmsm->sync, argp); break; case MSM_CAM_IOCTL_AXI_CONFIG: rc = msm_axi_config(pmsm->sync, argp); break; case MSM_CAM_IOCTL_SET_CROP: rc = msm_set_crop(pmsm->sync, argp); break; case MSM_CAM_IOCTL_PICT_PP: /* Grab one preview frame or one snapshot * frame. */ rc = msm_pp_grab(pmsm->sync, argp); break; case MSM_CAM_IOCTL_PICT_PP_DONE: /* Release the preview of snapshot frame * that was grabbed. */ rc = msm_pp_release(pmsm->sync, argp); break; case MSM_CAM_IOCTL_SENSOR_IO_CFG: rc = pmsm->sync->sctrl.s_config(argp); break; case MSM_CAM_IOCTL_FLASH_LED_CFG: { uint32_t led_state; if (copy_from_user(&led_state, argp, sizeof(led_state))) { ERR_COPY_FROM_USER(); rc = -EFAULT; } else rc = msm_camera_flash_set_led_state(pmsm->sync-> sdata->flash_data, led_state); break; } default: rc = msm_ioctl_common(pmsm, cmd, argp); break; } CDBG("%s: cmd %d DONE\n", __func__, _IOC_NR(cmd)); return rc; } static int msm_unblock_poll_frame(struct msm_sync *); static long msm_ioctl_frame(struct file *filep, unsigned int cmd, unsigned long arg) { int rc = -EINVAL; void __user *argp = (void __user *)arg; struct msm_device *pmsm = filep->private_data; switch (cmd) { case MSM_CAM_IOCTL_GETFRAME: /* Coming from frame thread to get frame * after SELECT is done */ rc = msm_get_frame(pmsm->sync, argp); break; case MSM_CAM_IOCTL_RELEASE_FRAME_BUFFER: rc = msm_put_frame_buffer(pmsm->sync, argp); break; case MSM_CAM_IOCTL_UNBLOCK_POLL_FRAME: rc = msm_unblock_poll_frame(pmsm->sync); break; default: break; } return rc; } static long msm_ioctl_control(struct file *filep, unsigned int cmd, unsigned long arg) { int rc = -EINVAL; void __user *argp = (void __user *)arg; struct msm_control_device *ctrl_pmsm = filep->private_data; struct msm_device *pmsm = ctrl_pmsm->pmsm; switch (cmd) { case MSM_CAM_IOCTL_CTRL_COMMAND: /* Coming from control thread, may need to wait for * command status */ CDBG("calling msm_control kernel msm_ioctl_control\n"); mutex_lock(&ctrl_cmd_lock); rc = msm_control(ctrl_pmsm, 1, argp); mutex_unlock(&ctrl_cmd_lock); break; case MSM_CAM_IOCTL_CTRL_COMMAND_2: /* Sends a message, returns immediately */ rc = msm_control(ctrl_pmsm, 0, argp); break; case MSM_CAM_IOCTL_CTRL_CMD_DONE: /* Config thread calls the control thread to notify it * of the result of a MSM_CAM_IOCTL_CTRL_COMMAND. */ rc = msm_ctrl_cmd_done(ctrl_pmsm, argp); break; case MSM_CAM_IOCTL_GET_PICTURE: rc = msm_get_pic(pmsm->sync, argp); break; case MSM_CAM_IOCTL_GET_SENSOR_INFO: rc = msm_get_sensor_info(pmsm->sync, argp); break; #if 1//PCAM case MSM_CAM_IOCTL_PCAM_CTRL_8BIT: sensor_rough_control(argp); rc = 0; break; #endif//PCAM default: rc = msm_ioctl_common(pmsm, cmd, argp); break; } return rc; } static int __msm_release(struct msm_sync *sync) { struct msm_pmem_region *region; struct hlist_node *hnode; struct hlist_node *n; mutex_lock(&sync->lock); if (sync->opencnt) sync->opencnt--; if (!sync->opencnt) { /*sensor release*/ sync->sctrl.s_release(); /* need to clean up system resource */ if (sync->vfefn.vfe_release) sync->vfefn.vfe_release(sync->pdev); kfree(sync->cropinfo); sync->cropinfo = NULL; sync->croplen = 0; hlist_for_each_entry_safe(region, hnode, n, &sync->pmem_frames, list) { hlist_del(hnode); put_pmem_file(region->file); kfree(region); } hlist_for_each_entry_safe(region, hnode, n, &sync->pmem_stats, list) { hlist_del(hnode); put_pmem_file(region->file); kfree(region); } msm_queue_drain(&sync->pict_q, list_pict); wake_unlock(&sync->wake_lock); sync->apps_id = NULL; CDBG("%s: completed\n", __func__); } mutex_unlock(&sync->lock); return 0; } static int msm_release_config(struct inode *node, struct file *filep) { int rc; struct msm_device *pmsm = filep->private_data; CDBG("%s: %s\n", __func__, filep->f_path.dentry->d_name.name); rc = __msm_release(pmsm->sync); if (!rc) { msm_queue_drain(&pmsm->sync->event_q, list_config); atomic_set(&pmsm->opened, 0); } return rc; } static int msm_release_control(struct inode *node, struct file *filep) { int rc; struct msm_control_device *ctrl_pmsm = filep->private_data; struct msm_device *pmsm = ctrl_pmsm->pmsm; CDBG("%s: %s\n", __func__, filep->f_path.dentry->d_name.name); g_v4l2_opencnt--; rc = __msm_release(pmsm->sync); if (!rc) { msm_queue_drain(&ctrl_pmsm->ctrl_q, list_control); kfree(ctrl_pmsm); } return rc; } static int msm_release_frame(struct inode *node, struct file *filep) { int rc; struct msm_device *pmsm = filep->private_data; CDBG("%s: %s\n", __func__, filep->f_path.dentry->d_name.name); rc = __msm_release(pmsm->sync); if (!rc) { msm_queue_drain(&pmsm->sync->frame_q, list_frame); atomic_set(&pmsm->opened, 0); } return rc; } static int msm_unblock_poll_frame(struct msm_sync *sync) { unsigned long flags; CDBG("%s\n", __func__); spin_lock_irqsave(&sync->frame_q.lock, flags); sync->unblock_poll_frame = 1; wake_up(&sync->frame_q.wait); spin_unlock_irqrestore(&sync->frame_q.lock, flags); return 0; } static unsigned int __msm_poll_frame(struct msm_sync *sync, struct file *filep, struct poll_table_struct *pll_table) { int rc = 0; unsigned long flags; poll_wait(filep, &sync->frame_q.wait, pll_table); spin_lock_irqsave(&sync->frame_q.lock, flags); if (!list_empty_careful(&sync->frame_q.list)) /* frame ready */ rc = POLLIN | POLLRDNORM; if (sync->unblock_poll_frame) { CDBG("%s: sync->unblock_poll_frame is true\n", __func__); rc |= POLLPRI; sync->unblock_poll_frame = 0; } spin_unlock_irqrestore(&sync->frame_q.lock, flags); return rc; } static unsigned int msm_poll_frame(struct file *filep, struct poll_table_struct *pll_table) { struct msm_device *pmsm = filep->private_data; return __msm_poll_frame(pmsm->sync, filep, pll_table); } /* * This function executes in interrupt context. */ static void *msm_vfe_sync_alloc(int size, void *syncdata __attribute__((unused)), gfp_t gfp) { struct msm_queue_cmd *qcmd = kmalloc(sizeof(struct msm_queue_cmd) + size, gfp); if (qcmd) { atomic_set(&qcmd->on_heap, 1); return qcmd + 1; } return NULL; } static void msm_vfe_sync_free(void *ptr) { if (ptr) { struct msm_queue_cmd *qcmd = (struct msm_queue_cmd *)ptr; qcmd--; if (atomic_read(&qcmd->on_heap)) kfree(qcmd); } } /* * This function executes in interrupt context. */ static void msm_vfe_sync(struct msm_vfe_resp *vdata, enum msm_queue qtype, void *syncdata, gfp_t gfp) { struct msm_queue_cmd *qcmd = NULL; struct msm_sync *sync = (struct msm_sync *)syncdata; if (!sync) { pr_err("%s: no context in dsp callback.\n", __func__); return; } qcmd = ((struct msm_queue_cmd *)vdata) - 1; qcmd->type = qtype; qcmd->command = vdata; ktime_get_ts(&(qcmd->ts)); if (qtype != MSM_CAM_Q_VFE_MSG) goto for_config; CDBG("%s: vdata->type %d\n", __func__, vdata->type); switch (vdata->type) { case VFE_MSG_OUTPUT_P: if (sync->pp_mask & PP_PREV) { CDBG("%s: PP_PREV in progress: phy_y %x phy_cbcr %x\n", __func__, vdata->phy.y_phy, vdata->phy.cbcr_phy); mutex_lock(&pp_prev_lock); if (sync->pp_prev) pr_warning("%s: overwriting pp_prev!\n", __func__); pr_info("%s: sending preview to config\n", __func__); sync->pp_prev = qcmd; mutex_unlock(&pp_prev_lock); break; } CDBG("%s: msm_enqueue frame_q\n", __func__); msm_enqueue(&sync->frame_q, &qcmd->list_frame); if (atomic_read(&qcmd->on_heap)) atomic_add(1, &qcmd->on_heap); break; case VFE_MSG_OUTPUT_V: CDBG("%s: msm_enqueue video frame_q\n", __func__); msm_enqueue(&sync->frame_q, &qcmd->list_frame); if (atomic_read(&qcmd->on_heap)) atomic_add(1, &qcmd->on_heap); break; case VFE_MSG_SNAPSHOT: if (sync->pp_mask & (PP_SNAP | PP_RAW_SNAP)) { CDBG("%s: PP_SNAP in progress: pp_mask %x\n", __func__, sync->pp_mask); mutex_lock(&pp_snap_lock); if (sync->pp_snap) pr_warning("%s: overwriting pp_snap!\n", __func__); pr_info("%s: sending snapshot to config\n", __func__); sync->pp_snap = qcmd; mutex_unlock(&pp_snap_lock); break; } msm_enqueue(&sync->pict_q, &qcmd->list_pict); if (atomic_read(&qcmd->on_heap)) atomic_add(1, &qcmd->on_heap); break; case VFE_MSG_STATS_AWB: CDBG("%s: qtype %d, AWB stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_AEC: CDBG("%s: qtype %d, AEC stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_IHIST: CDBG("%s: qtype %d, ihist stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_RS: CDBG("%s: qtype %d, rs stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_STATS_CS: CDBG("%s: qtype %d, cs stats, enqueue event_q.\n", __func__, vdata->type); break; case VFE_MSG_GENERAL: CDBG("%s: qtype %d, general msg, enqueue event_q.\n", __func__, vdata->type); break; default: CDBG("%s: qtype %d not handled\n", __func__, vdata->type); /* fall through, send to config. */ } for_config: CDBG("%s: msm_enqueue event_q\n", __func__); msm_enqueue(&sync->event_q, &qcmd->list_config); } static struct msm_vfe_callback msm_vfe_s = { .vfe_resp = msm_vfe_sync, .vfe_alloc = msm_vfe_sync_alloc, .vfe_free = msm_vfe_sync_free, }; static int __msm_open(struct msm_sync *sync, const char *const apps_id) { int rc = 0; mutex_lock(&sync->lock); if (sync->apps_id && strcmp(sync->apps_id, apps_id) && (!strcmp(MSM_APPS_ID_V4L2, apps_id))) { pr_err("%s(%s): sensor %s is already opened for %s\n", __func__, apps_id, sync->sdata->sensor_name, sync->apps_id); rc = -EBUSY; goto msm_open_done; } sync->apps_id = apps_id; if (!sync->opencnt) { wake_lock(&sync->wake_lock); #if 1//PCAM cam_pw(1); #endif//PCAM msm_camvfe_fn_init(&sync->vfefn, sync); if (sync->vfefn.vfe_init) { sync->get_pic_abort = 0; rc = sync->vfefn.vfe_init(&msm_vfe_s, sync->pdev); #if 1//PCAM printk("<=PCAM=> pre power init\n"); #endif//PCAM if (rc < 0) { pr_err("%s: vfe_init failed at %d\n", __func__, rc); goto msm_open_done; } rc = sync->sctrl.s_init(sync->sdata); if (rc < 0) { pr_err("%s: sensor init failed: %d\n", __func__, rc); goto msm_open_done; } } else { pr_err("%s: no sensor init func\n", __func__); rc = -ENODEV; goto msm_open_done; } if (rc >= 0) { INIT_HLIST_HEAD(&sync->pmem_frames); INIT_HLIST_HEAD(&sync->pmem_stats); sync->unblock_poll_frame = 0; } } sync->opencnt++; msm_open_done: mutex_unlock(&sync->lock); return rc; } static int msm_open_common(struct inode *inode, struct file *filep, int once) { int rc; struct msm_device *pmsm = container_of(inode->i_cdev, struct msm_device, cdev); CDBG("%s: open %s\n", __func__, filep->f_path.dentry->d_name.name); if (atomic_cmpxchg(&pmsm->opened, 0, 1) && once) { pr_err("%s: %s is already opened.\n", __func__, filep->f_path.dentry->d_name.name); return -EBUSY; } rc = nonseekable_open(inode, filep); if (rc < 0) { pr_err("%s: nonseekable_open error %d\n", __func__, rc); return rc; } rc = __msm_open(pmsm->sync, MSM_APPS_ID_PROP); if (rc < 0) return rc; filep->private_data = pmsm; CDBG("%s: rc %d\n", __func__, rc); return rc; } static int msm_open(struct inode *inode, struct file *filep) { return msm_open_common(inode, filep, 1); } static int msm_open_control(struct inode *inode, struct file *filep) { int rc; struct msm_control_device *ctrl_pmsm = kmalloc(sizeof(struct msm_control_device), GFP_KERNEL); if (!ctrl_pmsm) return -ENOMEM; rc = msm_open_common(inode, filep, 0); if (rc < 0) return rc; ctrl_pmsm->pmsm = filep->private_data; filep->private_data = ctrl_pmsm; msm_queue_init(&ctrl_pmsm->ctrl_q, "control"); if (!g_v4l2_opencnt) g_v4l2_control_device = ctrl_pmsm; g_v4l2_opencnt++; CDBG("%s: rc %d\n", __func__, rc); return rc; } static int __msm_v4l2_control(struct msm_sync *sync, struct msm_ctrl_cmd *out) { int rc = 0; struct msm_queue_cmd *qcmd = NULL, *rcmd = NULL; struct msm_ctrl_cmd *ctrl; struct msm_device_queue *v4l2_ctrl_q = &g_v4l2_control_device->ctrl_q; /* wake up config thread, 4 is for V4L2 application */ qcmd = kmalloc(sizeof(struct msm_queue_cmd), GFP_KERNEL); if (!qcmd) { pr_err("%s: cannot allocate buffer\n", __func__); rc = -ENOMEM; goto end; } qcmd->type = MSM_CAM_Q_V4L2_REQ; qcmd->command = out; atomic_set(&qcmd->on_heap, 1); if (out->type == V4L2_CAMERA_EXIT) { rcmd = __msm_control(sync, NULL, qcmd, out->timeout_ms); if (rcmd == NULL) { rc = PTR_ERR(rcmd); goto end; } } rcmd = __msm_control(sync, v4l2_ctrl_q, qcmd, out->timeout_ms); if (IS_ERR(rcmd)) { rc = PTR_ERR(rcmd); goto end; } ctrl = (struct msm_ctrl_cmd *)(rcmd->command); /* FIXME: we should just set out->length = ctrl->length; */ BUG_ON(out->length < ctrl->length); memcpy(out->value, ctrl->value, ctrl->length); end: free_qcmd(rcmd); CDBG("%s: rc %d\n", __func__, rc); return rc; } static const struct file_operations msm_fops_config = { .owner = THIS_MODULE, .open = msm_open, .unlocked_ioctl = msm_ioctl_config, .release = msm_release_config, }; static const struct file_operations msm_fops_control = { .owner = THIS_MODULE, .open = msm_open_control, .unlocked_ioctl = msm_ioctl_control, .release = msm_release_control, }; static const struct file_operations msm_fops_frame = { .owner = THIS_MODULE, .open = msm_open, .unlocked_ioctl = msm_ioctl_frame, .release = msm_release_frame, .poll = msm_poll_frame, }; static int msm_setup_cdev(struct msm_device *msm, int node, dev_t devno, const char *suffix, const struct file_operations *fops) { int rc = -ENODEV; struct device *device = device_create(msm_class, NULL, devno, NULL, "%s%d", suffix, node); if (IS_ERR(device)) { rc = PTR_ERR(device); pr_err("%s: error creating device: %d\n", __func__, rc); return rc; } cdev_init(&msm->cdev, fops); msm->cdev.owner = THIS_MODULE; rc = cdev_add(&msm->cdev, devno, 1); if (rc < 0) { pr_err("%s: error adding cdev: %d\n", __func__, rc); device_destroy(msm_class, devno); return rc; } return rc; } static int msm_tear_down_cdev(struct msm_device *msm, dev_t devno) { cdev_del(&msm->cdev); device_destroy(msm_class, devno); return 0; } int msm_v4l2_register(struct msm_v4l2_driver *drv) { /* FIXME: support multiple sensors */ if (list_empty(&msm_sensors)) return -ENODEV; drv->sync = list_first_entry(&msm_sensors, struct msm_sync, list); drv->open = __msm_open; drv->release = __msm_release; drv->ctrl = __msm_v4l2_control; drv->reg_pmem = __msm_register_pmem; drv->get_frame = __msm_get_frame; drv->put_frame = __msm_put_frame_buf; drv->get_pict = __msm_get_pic; drv->drv_poll = __msm_poll_frame; return 0; } EXPORT_SYMBOL(msm_v4l2_register); int msm_v4l2_unregister(struct msm_v4l2_driver *drv) { drv->sync = NULL; return 0; } EXPORT_SYMBOL(msm_v4l2_unregister); static int msm_sync_init(struct msm_sync *sync, struct platform_device *pdev, int (*sensor_probe)(const struct msm_camera_sensor_info *, struct msm_sensor_ctrl *)) { int rc = 0; struct msm_sensor_ctrl sctrl; sync->sdata = pdev->dev.platform_data; msm_queue_init(&sync->event_q, "event"); msm_queue_init(&sync->frame_q, "frame"); msm_queue_init(&sync->pict_q, "pict"); wake_lock_init(&sync->wake_lock, WAKE_LOCK_IDLE, "msm_camera"); rc = msm_camio_probe_on(pdev); if (rc < 0) return rc; rc = sensor_probe(sync->sdata, &sctrl); if (rc >= 0) { sync->pdev = pdev; sync->sctrl = sctrl; } msm_camio_probe_off(pdev); cam_pw(0);//PCAM if (rc < 0) { pr_err("%s: failed to initialize %s\n", __func__, sync->sdata->sensor_name); wake_lock_destroy(&sync->wake_lock); return rc; } sync->opencnt = 0; mutex_init(&sync->lock); CDBG("%s: initialized %s\n", __func__, sync->sdata->sensor_name); return rc; } static int msm_sync_destroy(struct msm_sync *sync) { wake_lock_destroy(&sync->wake_lock); return 0; } static int msm_device_init(struct msm_device *pmsm, struct msm_sync *sync, int node) { int dev_num = 3 * node; int rc = msm_setup_cdev(pmsm, node, MKDEV(MAJOR(msm_devno), dev_num), "control", &msm_fops_control); if (rc < 0) { pr_err("%s: error creating control node: %d\n", __func__, rc); return rc; } rc = msm_setup_cdev(pmsm + 1, node, MKDEV(MAJOR(msm_devno), dev_num + 1), "config", &msm_fops_config); if (rc < 0) { pr_err("%s: error creating config node: %d\n", __func__, rc); msm_tear_down_cdev(pmsm, MKDEV(MAJOR(msm_devno), dev_num)); return rc; } rc = msm_setup_cdev(pmsm + 2, node, MKDEV(MAJOR(msm_devno), dev_num + 2), "frame", &msm_fops_frame); if (rc < 0) { pr_err("%s: error creating frame node: %d\n", __func__, rc); msm_tear_down_cdev(pmsm, MKDEV(MAJOR(msm_devno), dev_num)); msm_tear_down_cdev(pmsm + 1, MKDEV(MAJOR(msm_devno), dev_num + 1)); return rc; } atomic_set(&pmsm[0].opened, 0); atomic_set(&pmsm[1].opened, 0); atomic_set(&pmsm[2].opened, 0); pmsm[0].sync = sync; pmsm[1].sync = sync; pmsm[2].sync = sync; return rc; } int msm_camera_drv_start(struct platform_device *dev, int (*sensor_probe)(const struct msm_camera_sensor_info *, struct msm_sensor_ctrl *)) { struct msm_device *pmsm = NULL; struct msm_sync *sync; int rc = -ENODEV; static int camera_node; if (camera_node >= MSM_MAX_CAMERA_SENSORS) { pr_err("%s: too many camera sensors\n", __func__); return rc; } if (!msm_class) { /* There are three device nodes per sensor */ rc = alloc_chrdev_region(&msm_devno, 0, 3 * MSM_MAX_CAMERA_SENSORS, "msm_camera"); if (rc < 0) { pr_err("%s: failed to allocate chrdev: %d\n", __func__, rc); return rc; } msm_class = class_create(THIS_MODULE, "msm_camera"); if (IS_ERR(msm_class)) { rc = PTR_ERR(msm_class); pr_err("%s: create device class failed: %d\n", __func__, rc); return rc; } } pmsm = kzalloc(sizeof(struct msm_device) * 3 + sizeof(struct msm_sync), GFP_ATOMIC); if (!pmsm) return -ENOMEM; sync = (struct msm_sync *)(pmsm + 3); rc = msm_sync_init(sync, dev, sensor_probe); if (rc < 0) { kfree(pmsm); return rc; } CDBG("%s: setting camera node %d\n", __func__, camera_node); rc = msm_device_init(pmsm, sync, camera_node); if (rc < 0) { msm_sync_destroy(sync); kfree(pmsm); return rc; } camera_node++; if (camera_node == 1) { rc = add_axi_qos(); if (rc < 0) { msm_sync_destroy(sync); kfree(pmsm); return rc; } } list_add(&sync->list, &msm_sensors); return rc; } EXPORT_SYMBOL(msm_camera_drv_start);
bebek15/samsung_kernel_msm7x27
drivers/media/video/msm/msm_camera_tass.c
C
gpl-2.0
61,108
/* * Asterisk -- An open source telephony toolkit. * * Copyright (C) 1999 - 2005, Digium, Inc. * * Martin Pycko <martinp@digium.com> * * See http://www.asterisk.org for more information about * the Asterisk project. Please do not directly contact * any of the maintainers of this project for assistance; * the project provides a web site, mailing lists and IRC * channels for your use. * * This program is free software, distributed under the terms of * the GNU General Public License Version 2. See the LICENSE file * at the top of the source tree. */ /*! \file * \brief Internal Asterisk hangup causes */ #ifndef _ASTERISK_CAUSES_H #define _ASTERISK_CAUSES_H /*! \page AstCauses Hangup Causes for Asterisk The Asterisk hangup causes are delivered to the dialplan in the ${HANGUPCAUSE} channel variable after a call (after execution of "dial"). In SIP, we have a conversion table to convert between SIP return codes and Q.931 both ways. This is to improve SIP/ISDN compatibility. These are the current codes, based on the Q.850/Q.931 specification: - AST_CAUSE_UNALLOCATED 1 - AST_CAUSE_NO_ROUTE_TRANSIT_NET 2 - AST_CAUSE_NO_ROUTE_DESTINATION 3 - AST_CAUSE_MISDIALLED_TRUNK_PREFIX 5 - AST_CAUSE_CHANNEL_UNACCEPTABLE 6 - AST_CAUSE_CALL_AWARDED_DELIVERED 7 - AST_CAUSE_PRE_EMPTED 8 - AST_CAUSE_NUMBER_PORTED_NOT_HERE 14 - AST_CAUSE_NORMAL_CLEARING 16 - AST_CAUSE_USER_BUSY 17 - AST_CAUSE_NO_USER_RESPONSE 18 - AST_CAUSE_NO_ANSWER 19 - AST_CAUSE_CALL_REJECTED 21 - AST_CAUSE_NUMBER_CHANGED 22 - AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION 23 - AST_CAUSE_ANSWERED_ELSEWHERE 26 - AST_CAUSE_DESTINATION_OUT_OF_ORDER 27 - AST_CAUSE_INVALID_NUMBER_FORMAT 28 - AST_CAUSE_FACILITY_REJECTED 29 - AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY 30 - AST_CAUSE_NORMAL_UNSPECIFIED 31 - AST_CAUSE_NORMAL_CIRCUIT_CONGESTION 34 - AST_CAUSE_NETWORK_OUT_OF_ORDER 38 - AST_CAUSE_NORMAL_TEMPORARY_FAILURE 41 - AST_CAUSE_SWITCH_CONGESTION 42 - AST_CAUSE_ACCESS_INFO_DISCARDED 43 - AST_CAUSE_REQUESTED_CHAN_UNAVAIL 44 - AST_CAUSE_FACILITY_NOT_SUBSCRIBED 50 - AST_CAUSE_OUTGOING_CALL_BARRED 52 - AST_CAUSE_INCOMING_CALL_BARRED 54 - AST_CAUSE_BEARERCAPABILITY_NOTAUTH 57 - AST_CAUSE_BEARERCAPABILITY_NOTAVAIL 58 - AST_CAUSE_BEARERCAPABILITY_NOTIMPL 65 - AST_CAUSE_CHAN_NOT_IMPLEMENTED 66 - AST_CAUSE_FACILITY_NOT_IMPLEMENTED 69 - AST_CAUSE_INVALID_CALL_REFERENCE 81 - AST_CAUSE_INCOMPATIBLE_DESTINATION 88 - AST_CAUSE_INVALID_MSG_UNSPECIFIED 95 - AST_CAUSE_MANDATORY_IE_MISSING 96 - AST_CAUSE_MESSAGE_TYPE_NONEXIST 97 - AST_CAUSE_WRONG_MESSAGE 98 - AST_CAUSE_IE_NONEXIST 99 - AST_CAUSE_INVALID_IE_CONTENTS 100 - AST_CAUSE_WRONG_CALL_STATE 101 - AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE 102 - AST_CAUSE_MANDATORY_IE_LENGTH_ERROR 103 - AST_CAUSE_PROTOCOL_ERROR 111 - AST_CAUSE_INTERWORKING 127 For more information: - \ref app_dial.c */ /*! \name Causes for disconnection (from Q.850/Q.931) * These are the internal cause codes used in Asterisk. * \ref AstCauses */ /*@{ */ #define AST_CAUSE_UNALLOCATED 1 #define AST_CAUSE_NO_ROUTE_TRANSIT_NET 2 #define AST_CAUSE_NO_ROUTE_DESTINATION 3 #define AST_CAUSE_MISDIALLED_TRUNK_PREFIX 5 #define AST_CAUSE_CHANNEL_UNACCEPTABLE 6 #define AST_CAUSE_CALL_AWARDED_DELIVERED 7 #define AST_CAUSE_PRE_EMPTED 8 #define AST_CAUSE_NUMBER_PORTED_NOT_HERE 14 #define AST_CAUSE_NORMAL_CLEARING 16 #define AST_CAUSE_USER_BUSY 17 #define AST_CAUSE_NO_USER_RESPONSE 18 #define AST_CAUSE_NO_ANSWER 19 #define AST_CAUSE_SUBSCRIBER_ABSENT 20 #define AST_CAUSE_CALL_REJECTED 21 #define AST_CAUSE_NUMBER_CHANGED 22 #define AST_CAUSE_REDIRECTED_TO_NEW_DESTINATION 23 #define AST_CAUSE_ANSWERED_ELSEWHERE 26 #define AST_CAUSE_DESTINATION_OUT_OF_ORDER 27 #define AST_CAUSE_INVALID_NUMBER_FORMAT 28 #define AST_CAUSE_FACILITY_REJECTED 29 #define AST_CAUSE_RESPONSE_TO_STATUS_ENQUIRY 30 #define AST_CAUSE_NORMAL_UNSPECIFIED 31 #define AST_CAUSE_NORMAL_CIRCUIT_CONGESTION 34 #define AST_CAUSE_NETWORK_OUT_OF_ORDER 38 #define AST_CAUSE_NORMAL_TEMPORARY_FAILURE 41 #define AST_CAUSE_SWITCH_CONGESTION 42 #define AST_CAUSE_ACCESS_INFO_DISCARDED 43 #define AST_CAUSE_REQUESTED_CHAN_UNAVAIL 44 #define AST_CAUSE_FACILITY_NOT_SUBSCRIBED 50 #define AST_CAUSE_OUTGOING_CALL_BARRED 52 #define AST_CAUSE_INCOMING_CALL_BARRED 54 #define AST_CAUSE_BEARERCAPABILITY_NOTAUTH 57 #define AST_CAUSE_BEARERCAPABILITY_NOTAVAIL 58 #define AST_CAUSE_BEARERCAPABILITY_NOTIMPL 65 #define AST_CAUSE_CHAN_NOT_IMPLEMENTED 66 #define AST_CAUSE_FACILITY_NOT_IMPLEMENTED 69 #define AST_CAUSE_INVALID_CALL_REFERENCE 81 #define AST_CAUSE_INCOMPATIBLE_DESTINATION 88 #define AST_CAUSE_INVALID_MSG_UNSPECIFIED 95 #define AST_CAUSE_MANDATORY_IE_MISSING 96 #define AST_CAUSE_MESSAGE_TYPE_NONEXIST 97 #define AST_CAUSE_WRONG_MESSAGE 98 #define AST_CAUSE_IE_NONEXIST 99 #define AST_CAUSE_INVALID_IE_CONTENTS 100 #define AST_CAUSE_WRONG_CALL_STATE 101 #define AST_CAUSE_RECOVERY_ON_TIMER_EXPIRE 102 #define AST_CAUSE_MANDATORY_IE_LENGTH_ERROR 103 #define AST_CAUSE_PROTOCOL_ERROR 111 #define AST_CAUSE_INTERWORKING 127 /* Special Asterisk aliases */ #define AST_CAUSE_BUSY AST_CAUSE_USER_BUSY #define AST_CAUSE_FAILURE AST_CAUSE_NETWORK_OUT_OF_ORDER #define AST_CAUSE_NORMAL AST_CAUSE_NORMAL_CLEARING #define AST_CAUSE_NOANSWER AST_CAUSE_NO_ANSWER #define AST_CAUSE_CONGESTION AST_CAUSE_NORMAL_CIRCUIT_CONGESTION #define AST_CAUSE_UNREGISTERED AST_CAUSE_SUBSCRIBER_ABSENT #define AST_CAUSE_NOTDEFINED 0 #define AST_CAUSE_NOSUCHDRIVER AST_CAUSE_CHAN_NOT_IMPLEMENTED /*@} */ #endif /* _ASTERISK_CAUSES_H */
mehulsbhatt/asterisk
include/asterisk/causes.h
C
gpl-2.0
6,559
<?php /** * @package Joomla.Test * @subpackage AcceptanceTester.Page * * @copyright Copyright (C) 2005 - 2016 Open Source Matters, Inc. All rights reserved. * @license GNU General Public License version 2 or later; see LICENSE.txt */ namespace Page\Acceptance\Administrator; /** * Acceptance Page object class to define Control Panel page objects. * * @package Page\Acceptance\Administrator * * @since __DEPLOY_VERSION__ */ class ControlPanelPage extends AdminPage { /** * Link to the administrator control panel url. * * @var string * @since __DEPLOY_VERSION__ */ public static $url = "/administrator/index.php"; /** * Name of the text to identify the control panel. * * @var string * @since __DEPLOY_VERSION__ */ public static $pageTitle = 'Control Panel'; }
jatitoam/gsoc16_browser-automated-tests
tests/codeception/_support/Page/Acceptance/Administrator/ControlPanelPage.php
PHP
gpl-2.0
823
base-feature ============ Base Feature
electricthread/naacc
sites/all/modules/_features/d7_base_feature/README.md
Markdown
gpl-2.0
39
/* BGP Extended Communities Attribute. Copyright (C) 2000 Kunihiro Ishiguro <kunihiro@zebra.org> This file is part of GNU Zebra. GNU Zebra is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2, or (at your option) any later version. GNU Zebra is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with GNU Zebra; see the file COPYING. If not, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ /* High-order octet of the Extended Communities type field. */ #define ECOMMUNITY_ENCODE_AS 0x00 #define ECOMMUNITY_ENCODE_IP 0x01 /* Low-order octet of the Extended Communityes type field. */ #define ECOMMUNITY_ROUTE_TARGET 0x02 #define ECOMMUNITY_SITE_ORIGIN 0x03 /* Extended communities attribute string format. */ #define ECOMMUNITY_FORMAT_ROUTE_MAP 0 #define ECOMMUNITY_FORMAT_COMMUNITY_LIST 1 #define ECOMMUNITY_FORMAT_DISPLAY 2 /* Extended Communities value is eight octet long. */ #define ECOMMUNITY_SIZE 8 /* Extended Communities attribute. */ struct ecommunity { /* Reference counter. */ unsigned long refcnt; /* Size of Extended Communities attribute. */ int size; /* Extended Communities value. */ u_char *val; /* Human readable format string. */ char *str; }; /* Extended community value is eight octet. */ struct ecommunity_val { char val[ECOMMUNITY_SIZE]; }; #define ecom_length(X) ((X)->size * ECOMMUNITY_SIZE) void ecommunity_init (void); void ecommunity_free (struct ecommunity *); struct ecommunity *ecommunity_new (void); struct ecommunity *ecommunity_parse (char *, u_short); struct ecommunity *ecommunity_dup (struct ecommunity *); struct ecommunity *ecommunity_merge (struct ecommunity *, struct ecommunity *); struct ecommunity *ecommunity_intern (struct ecommunity *); int ecommunity_cmp (struct ecommunity *, struct ecommunity *); void ecommunity_unintern (struct ecommunity *); unsigned int ecommunity_hash_make (struct ecommunity *); struct ecommunity *ecommunity_str2com (char *, int, int); char *ecommunity_ecom2str (struct ecommunity *, int); int ecommunity_match (struct ecommunity *, struct ecommunity *); char *ecommunity_str (struct ecommunity *);
robacklin/uclinux-users
zebra/bgpd/bgp_ecommunity.h
C
gpl-2.0
2,647
var searchData= [ ['_7emd_5fmax72xx',['~MD_MAX72XX',['../class_m_d___m_a_x72_x_x.html#afffa5b85187905f713477435187b3759',1,'MD_MAX72XX']]] ];
Jaeger87/OpenBasiligotchi
BasilicoWiFi/libraries/MD_MAX72xx/doc/html/search/functions_9.js
JavaScript
gpl-3.0
144
----------------------------------- -- Area: Garlaige Citadel -- MOB: Over Weapon ----------------------------------- require("scripts/globals/groundsofvalor"); ----------------------------------- -- onMobDeath ----------------------------------- function onMobDeath(mob,killer,ally) checkGoVregime(ally,mob,705,1); checkGoVregime(ally,mob,708,1); end;
nesstea/darkstar
scripts/zones/Garlaige_Citadel/mobs/Over_Weapon.lua
Lua
gpl-3.0
364
<a href="#<%= id %>" class="figure_reference"><%= title %></a>
aic-collections/OSCI-Toolkit-Frontend
js/oscitk/templates/figure-reference.tpl.html
HTML
gpl-3.0
62
#!/usr/bin/python # # Copyright 2016 Red Hat | Ansible # # This file is part of Ansible # # Ansible is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation, either version 3 of the License, or # (at your option) any later version. # # Ansible is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with Ansible. If not, see <http://www.gnu.org/licenses/>. ANSIBLE_METADATA = {'status': ['preview'], 'supported_by': 'committer', 'version': '1.0'} DOCUMENTATION = ''' --- module: docker_image short_description: Manage docker images. version_added: "1.5" description: - Build, load or pull an image, making the image available for creating containers. Also supports tagging an image into a repository and archiving an image to a .tar file. options: archive_path: description: - Use with state C(present) to archive an image to a .tar file. required: false version_added: "2.1" load_path: description: - Use with state C(present) to load an image from a .tar file. required: false version_added: "2.2" dockerfile: description: - Use with state C(present) to provide an alternate name for the Dockerfile to use when building an image. default: Dockerfile required: false version_added: "2.0" force: description: - Use with state I(absent) to un-tag and remove all images matching the specified name. Use with state C(present) to build, load or pull an image when the image already exists. default: false required: false version_added: "2.1" http_timeout: description: - Timeout for HTTP requests during the image build operation. Provide a positive integer value for the number of seconds. required: false version_added: "2.1" name: description: - "Image name. Name format will be one of: name, repository/name, registry_server:port/name. When pushing or pulling an image the name can optionally include the tag by appending ':tag_name'." required: true path: description: - Use with state 'present' to build an image. Will be the path to a directory containing the context and Dockerfile for building an image. aliases: - build_path required: false pull: description: - When building an image downloads any updates to the FROM image in Dockerfile. default: true required: false version_added: "2.1" push: description: - Push the image to the registry. Specify the registry as part of the I(name) or I(repository) parameter. default: false required: false version_added: "2.2" rm: description: - Remove intermediate containers after build. default: true required: false version_added: "2.1" nocache: description: - Do not use cache when building an image. default: false required: false repository: description: - Full path to a repository. Use with state C(present) to tag the image into the repository. Expects format I(repository:tag). If no tag is provided, will use the value of the C(tag) parameter or I(latest). required: false version_added: "2.1" state: description: - Make assertions about the state of an image. - When C(absent) an image will be removed. Use the force option to un-tag and remove all images matching the provided name. - When C(present) check if an image exists using the provided name and tag. If the image is not found or the force option is used, the image will either be pulled, built or loaded. By default the image will be pulled from Docker Hub. To build the image, provide a path value set to a directory containing a context and Dockerfile. To load an image, specify load_path to provide a path to an archive file. To tag an image to a repository, provide a repository path. If the name contains a repository path, it will be pushed. - "NOTE: C(build) is DEPRECATED and will be removed in release 2.3. Specifying C(build) will behave the same as C(present)." required: false default: present choices: - absent - present - build tag: description: - Used to select an image when pulling. Will be added to the image when pushing, tagging or building. Defaults to I(latest). - If C(name) parameter format is I(name:tag), then tag value from C(name) will take precedence. default: latest required: false buildargs: description: - Provide a dictionary of C(key:value) build arguments that map to Dockerfile ARG directive. - Docker expects the value to be a string. For convenience any non-string values will be converted to strings. - Requires Docker API >= 1.21 and docker-py >= 1.7.0. type: complex required: false version_added: "2.2" container_limits: description: - A dictionary of limits applied to each container created by the build process. required: false version_added: "2.1" type: complex contains: memory: description: Set memory limit for build type: int memswap: description: Total memory (memory + swap), -1 to disable swap type: int cpushares: description: CPU shares (relative weight) type: int cpusetcpus: description: CPUs in which to allow execution, e.g., "0-3", "0,1" type: str use_tls: description: - "DEPRECATED. Whether to use tls to connect to the docker server. Set to C(no) when TLS will not be used. Set to C(encrypt) to use TLS. And set to C(verify) to use TLS and verify that the server's certificate is valid for the server. NOTE: If you specify this option, it will set the value of the tls or tls_verify parameters." choices: - no - encrypt - verify default: no required: false version_added: "2.0" extends_documentation_fragment: - docker requirements: - "python >= 2.6" - "docker-py >= 1.7.0" - "Docker API >= 1.20" authors: - Pavel Antonov (@softzilla) - Chris Houseknecht (@chouseknecht) - James Tanner (@jctanner) ''' EXAMPLES = ''' - name: pull an image docker_image: name: pacur/centos-7 - name: Tag and push to docker hub docker_image: name: pacur/centos-7 repository: dcoppenhagan/myimage tag: 7.0 push: yes - name: Tag and push to local registry docker_image: name: centos repository: localhost:5000/centos tag: 7 push: yes - name: Remove image docker_image: state: absent name: registry.ansible.com/chouseknecht/sinatra tag: v1 - name: Build an image and push it to a private repo docker_image: path: ./sinatra name: registry.ansible.com/chouseknecht/sinatra tag: v1 push: yes - name: Archive image docker_image: name: registry.ansible.com/chouseknecht/sinatra tag: v1 archive_path: my_sinatra.tar - name: Load image from archive and push to a private registry docker_image: name: localhost:5000/myimages/sinatra tag: v1 push: yes load_path: my_sinatra.tar - name: Build image and with buildargs docker_image: path: /path/to/build/dir name: myimage buildargs: log_volume: /var/log/myapp listen_port: 8080 ''' RETURN = ''' image: description: Image inspection results for the affected image. returned: success type: complex sample: {} ''' from ansible.module_utils.docker_common import * try: from docker.auth.auth import resolve_repository_name from docker.utils.utils import parse_repository_tag except ImportError: # missing docker-py handled in docker_common pass class ImageManager(DockerBaseClass): def __init__(self, client, results): super(ImageManager, self).__init__() self.client = client self.results = results parameters = self.client.module.params self.check_mode = self.client.check_mode self.archive_path = parameters.get('archive_path') self.container_limits = parameters.get('container_limits') self.dockerfile = parameters.get('dockerfile') self.force = parameters.get('force') self.load_path = parameters.get('load_path') self.name = parameters.get('name') self.nocache = parameters.get('nocache') self.path = parameters.get('path') self.pull = parameters.get('pull') self.repository = parameters.get('repository') self.rm = parameters.get('rm') self.state = parameters.get('state') self.tag = parameters.get('tag') self.http_timeout = parameters.get('http_timeout') self.push = parameters.get('push') self.buildargs = parameters.get('buildargs') # If name contains a tag, it takes precedence over tag parameter. repo, repo_tag = parse_repository_tag(self.name) if repo_tag: self.name = repo self.tag = repo_tag if self.state in ['present', 'build']: self.present() elif self.state == 'absent': self.absent() def fail(self, msg): self.client.fail(msg) def present(self): ''' Handles state = 'present', which includes building, loading or pulling an image, depending on user provided parameters. :returns None ''' image = self.client.find_image(name=self.name, tag=self.tag) if not image or self.force: if self.path: # Build the image if not os.path.isdir(self.path): self.fail("Requested build path %s could not be found or you do not have access." % self.path) image_name = self.name if self.tag: image_name = "%s:%s" % (self.name, self.tag) self.log("Building image %s" % image_name) self.results['actions'].append("Built image %s from %s" % (image_name, self.path)) self.results['changed'] = True if not self.check_mode: self.results['image'] = self.build_image() elif self.load_path: # Load the image from an archive if not os.path.isfile(self.load_path): self.fail("Error loading image %s. Specified path %s does not exist." % (self.name, self.load_path)) image_name = self.name if self.tag: image_name = "%s:%s" % (self.name, self.tag) self.results['actions'].append("Loaded image %s from %s" % (image_name, self.load_path)) self.results['changed'] = True if not self.check_mode: self.results['image'] = self.load_image() else: # pull the image self.results['actions'].append('Pulled image %s:%s' % (self.name, self.tag)) self.results['changed'] = True if not self.check_mode: self.results['image'] = self.client.pull_image(self.name, tag=self.tag) if self.archive_path: self.archive_image(self.name, self.tag) if self.push and not self.repository: self.push_image(self.name, self.tag) elif self.repository: self.tag_image(self.name, self.tag, self.repository, force=self.force, push=self.push) def absent(self): ''' Handles state = 'absent', which removes an image. :return None ''' image = self.client.find_image(self.name, self.tag) if image: name = self.name if self.tag: name = "%s:%s" % (self.name, self.tag) if not self.check_mode: try: self.client.remove_image(name, force=self.force) except Exception as exc: self.fail("Error removing image %s - %s" % (name, str(exc))) self.results['changed'] = True self.results['actions'].append("Removed image %s" % (name)) self.results['image']['state'] = 'Deleted' def archive_image(self, name, tag): ''' Archive an image to a .tar file. Called when archive_path is passed. :param name - name of the image. Type: str :return None ''' if not tag: tag = "latest" image = self.client.find_image(name=name, tag=tag) if not image: self.log("archive image: image %s:%s not found" % (name, tag)) return image_name = "%s:%s" % (name, tag) self.results['actions'].append('Archived image %s to %s' % (image_name, self.archive_path)) self.results['changed'] = True if not self.check_mode: self.log("Getting archive of image %s" % image_name) try: image = self.client.get_image(image_name) except Exception as exc: self.fail("Error getting image %s - %s" % (image_name, str(exc))) try: image_tar = open(self.archive_path, 'w') image_tar.write(image.data) image_tar.close() except Exception as exc: self.fail("Error writing image archive %s - %s" % (self.archive_path, str(exc))) image = self.client.find_image(name=name, tag=tag) if image: self.results['image'] = image def push_image(self, name, tag=None): ''' If the name of the image contains a repository path, then push the image. :param name Name of the image to push. :param tag Use a specific tag. :return: None ''' repository = name if not tag: repository, tag = parse_repository_tag(name) registry, repo_name = resolve_repository_name(repository) self.log("push %s to %s/%s:%s" % (self.name, registry, repo_name, tag)) if registry: self.results['actions'].append("Pushed image %s to %s/%s:%s" % (self.name, registry, repo_name, tag)) self.results['changed'] = True if not self.check_mode: status = None try: for line in self.client.push(repository, tag=tag, stream=True, decode=True): self.log(line, pretty_print=True) if line.get('errorDetail'): raise Exception(line['errorDetail']['message']) status = line.get('status') except Exception as exc: if re.search('unauthorized', str(exc)): if re.search('authentication required', str(exc)): self.fail("Error pushing image %s/%s:%s - %s. Try logging into %s first." % (registry, repo_name, tag, str(exc), registry)) else: self.fail("Error pushing image %s/%s:%s - %s. Does the repository exist?" % (registry, repo_name, tag, str(exc))) self.fail("Error pushing image %s: %s" % (repository, str(exc))) self.results['image'] = self.client.find_image(name=repository, tag=tag) if not self.results['image']: self.results['image'] = dict() self.results['image']['push_status'] = status def tag_image(self, name, tag, repository, force=False, push=False): ''' Tag an image into a repository. :param name: name of the image. required. :param tag: image tag. :param repository: path to the repository. required. :param force: bool. force tagging, even it image already exists with the repository path. :param push: bool. push the image once it's tagged. :return: None ''' repo, repo_tag = parse_repository_tag(repository) if not repo_tag: repo_tag = "latest" if tag: repo_tag = tag image = self.client.find_image(name=repo, tag=repo_tag) found = 'found' if image else 'not found' self.log("image %s was %s" % (repo, found)) if not image or force: self.log("tagging %s:%s to %s:%s" % (name, tag, repo, repo_tag)) self.results['changed'] = True self.results['actions'].append("Tagged image %s:%s to %s:%s" % (name, tag, repo, repo_tag)) if not self.check_mode: try: # Finding the image does not always work, especially running a localhost registry. In those # cases, if we don't set force=True, it errors. image_name = name if tag and not re.search(tag, name): image_name = "%s:%s" % (name, tag) tag_status = self.client.tag(image_name, repo, tag=repo_tag, force=True) if not tag_status: raise Exception("Tag operation failed.") except Exception as exc: self.fail("Error: failed to tag image - %s" % str(exc)) self.results['image'] = self.client.find_image(name=repo, tag=repo_tag) if push: self.push_image(repo, repo_tag) def build_image(self): ''' Build an image :return: image dict ''' params = dict( path=self.path, tag=self.name, rm=self.rm, nocache=self.nocache, stream=True, timeout=self.http_timeout, pull=self.pull, forcerm=self.rm, dockerfile=self.dockerfile, decode=True ) if self.tag: params['tag'] = "%s:%s" % (self.name, self.tag) if self.container_limits: params['container_limits'] = self.container_limits if self.buildargs: for key, value in self.buildargs.items(): if not isinstance(value, basestring): self.buildargs[key] = str(value) params['buildargs'] = self.buildargs for line in self.client.build(**params): # line = json.loads(line) self.log(line, pretty_print=True) if line.get('error'): if line.get('errorDetail'): errorDetail = line.get('errorDetail') self.fail("Error building %s - code: %s message: %s" % (self.name, errorDetail.get('code'), errorDetail.get('message'))) else: self.fail("Error building %s - %s" % (self.name, line.get('error'))) return self.client.find_image(name=self.name, tag=self.tag) def load_image(self): ''' Load an image from a .tar archive :return: image dict ''' try: self.log("Opening image %s" % self.load_path) image_tar = open(self.load_path, 'r') except Exception as exc: self.fail("Error opening image %s - %s" % (self.load_path, str(exc))) try: self.log("Loading image from %s" % self.load_path) self.client.load_image(image_tar) except Exception as exc: self.fail("Error loading image %s - %s" % (self.name, str(exc))) try: image_tar.close() except Exception as exc: self.fail("Error closing image %s - %s" % (self.name, str(exc))) return self.client.find_image(self.name, self.tag) def main(): argument_spec = dict( archive_path=dict(type='path'), container_limits=dict(type='dict'), dockerfile=dict(type='str'), force=dict(type='bool', default=False), http_timeout=dict(type='int'), load_path=dict(type='path'), name=dict(type='str', required=True), nocache=dict(type='str', default=False), path=dict(type='path', aliases=['build_path']), pull=dict(type='bool', default=True), push=dict(type='bool', default=False), repository=dict(type='str'), rm=dict(type='bool', default=True), state=dict(type='str', choices=['absent', 'present', 'build'], default='present'), tag=dict(type='str', default='latest'), use_tls=dict(type='str', default='no', choices=['no', 'encrypt', 'verify']), buildargs=dict(type='dict', default=None), ) client = AnsibleDockerClient( argument_spec=argument_spec, supports_check_mode=True, ) results = dict( changed=False, actions=[], image={} ) ImageManager(client, results) client.module.exit_json(**results) # import module snippets from ansible.module_utils.basic import * if __name__ == '__main__': main()
ColOfAbRiX/ansible
lib/ansible/modules/cloud/docker/docker_image.py
Python
gpl-3.0
21,614
<html lang="en"> <head> <title>Z8000-Regs - Using as</title> <meta http-equiv="Content-Type" content="text/html"> <meta name="description" content="Using as"> <meta name="generator" content="makeinfo 4.13"> <link title="Top" rel="start" href="index.html#Top"> <link rel="up" href="Z8000-Syntax.html#Z8000-Syntax" title="Z8000 Syntax"> <link rel="prev" href="Z8000_002dChars.html#Z8000_002dChars" title="Z8000-Chars"> <link rel="next" href="Z8000_002dAddressing.html#Z8000_002dAddressing" title="Z8000-Addressing"> <link href="http://www.gnu.org/software/texinfo/" rel="generator-home" title="Texinfo Homepage"> <!-- This file documents the GNU Assembler "as". Copyright (C) 1991-2013 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with no Invariant Sections, with no Front-Cover Texts, and with no Back-Cover Texts. A copy of the license is included in the section entitled ``GNU Free Documentation License''. --> <meta http-equiv="Content-Style-Type" content="text/css"> <style type="text/css"><!-- pre.display { font-family:inherit } pre.format { font-family:inherit } pre.smalldisplay { font-family:inherit; font-size:smaller } pre.smallformat { font-family:inherit; font-size:smaller } pre.smallexample { font-size:smaller } pre.smalllisp { font-size:smaller } span.sc { font-variant:small-caps } span.roman { font-family:serif; font-weight:normal; } span.sansserif { font-family:sans-serif; font-weight:normal; } --></style> </head> <body> <div class="node"> <a name="Z8000-Regs"></a> <a name="Z8000_002dRegs"></a> <p> Next:&nbsp;<a rel="next" accesskey="n" href="Z8000_002dAddressing.html#Z8000_002dAddressing">Z8000-Addressing</a>, Previous:&nbsp;<a rel="previous" accesskey="p" href="Z8000_002dChars.html#Z8000_002dChars">Z8000-Chars</a>, Up:&nbsp;<a rel="up" accesskey="u" href="Z8000-Syntax.html#Z8000-Syntax">Z8000 Syntax</a> <hr> </div> <h5 class="subsubsection">9.47.2.2 Register Names</h5> <p><a name="index-Z8000-registers-2179"></a><a name="index-registers_002c-Z8000-2180"></a>The Z8000 has sixteen 16 bit registers, numbered 0 to 15. You can refer to different sized groups of registers by register number, with the prefix &lsquo;<samp><span class="samp">r</span></samp>&rsquo; for 16 bit registers, &lsquo;<samp><span class="samp">rr</span></samp>&rsquo; for 32 bit registers and &lsquo;<samp><span class="samp">rq</span></samp>&rsquo; for 64 bit registers. You can also refer to the contents of the first eight (of the sixteen 16 bit registers) by bytes. They are named &lsquo;<samp><span class="samp">rl</span><var>n</var></samp>&rsquo; and &lsquo;<samp><span class="samp">rh</span><var>n</var></samp>&rsquo;. <pre class="smallexample"><br><em>byte registers</em><br> rl0 rh0 rl1 rh1 rl2 rh2 rl3 rh3 rl4 rh4 rl5 rh5 rl6 rh6 rl7 rh7 <br><em>word registers</em><br> r0 r1 r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 <br><em>long word registers</em><br> rr0 rr2 rr4 rr6 rr8 rr10 rr12 rr14 <br><em>quad word registers</em><br> rq0 rq4 rq8 rq12 </pre> </body></html>
darth-vader-lg/glcncrpi
tools/arm-bcm2708/gcc-linaro-arm-none-eabi-4.8-2014.04/share/doc/gcc-linaro-arm-none-eabi/html/as.html/Z8000_002dRegs.html
HTML
gpl-3.0
3,257
/*-------------------------------------------------------------------------*/ /** @file iniparser.c @author N. Devillard @brief Parser for ini files. */ /*--------------------------------------------------------------------------*/ /*---------------------------- Includes ------------------------------------*/ #include <ctype.h> #include "iniparser.h" /*---------------------------- Defines -------------------------------------*/ #define ASCIILINESZ (1024) #define INI_INVALID_KEY ((char*)-1) /*--------------------------------------------------------------------------- Private to this module ---------------------------------------------------------------------------*/ /** * This enum stores the status for each parsed line (internal use only). */ typedef enum _line_status_ { LINE_UNPROCESSED, LINE_ERROR, LINE_EMPTY, LINE_COMMENT, LINE_SECTION, LINE_VALUE } line_status ; /*-------------------------------------------------------------------------*/ /** @brief Convert a string to lowercase. @param in String to convert. @param out Output buffer. @param len Size of the out buffer. @return ptr to the out buffer or NULL if an error occured. This function convert a string into lowercase. At most len - 1 elements of the input string will be converted. */ /*--------------------------------------------------------------------------*/ static const char * strlwc(const char * in, char *out, unsigned len) { unsigned i ; if (in==NULL || out == NULL || len==0) return NULL ; i=0 ; while (in[i] != '\0' && i < len-1) { out[i] = (char)tolower((int)in[i]); i++ ; } out[i] = '\0'; return out ; } /*-------------------------------------------------------------------------*/ /** @brief Duplicate a string @param s String to duplicate @return Pointer to a newly allocated string, to be freed with free() This is a replacement for strdup(). This implementation is provided for systems that do not have it. */ /*--------------------------------------------------------------------------*/ static char * xstrdup(const char * s) { char * t ; size_t len ; if (!s) return NULL ; len = strlen(s) + 1 ; t = (char*) malloc(len) ; if (t) { memcpy(t, s, len) ; } return t ; } /*-------------------------------------------------------------------------*/ /** @brief Remove blanks at the beginning and the end of a string. @param str String to parse and alter. @return unsigned New size of the string. */ /*--------------------------------------------------------------------------*/ unsigned strstrip(char * s) { char *last = NULL ; char *dest = s; if (s==NULL) return 0; last = s + strlen(s); while (isspace((int)*s) && *s) s++; while (last > s) { if (!isspace((int)*(last-1))) break ; last -- ; } *last = (char)0; memmove(dest,s,last - s + 1); return last - s; } /*-------------------------------------------------------------------------*/ /** @brief Get number of sections in a dictionary @param d Dictionary to examine @return int Number of sections found in dictionary This function returns the number of sections found in a dictionary. The test to recognize sections is done on the string stored in the dictionary: a section name is given as "section" whereas a key is stored as "section:key", thus the test looks for entries that do not contain a colon. This clearly fails in the case a section name contains a colon, but this should simply be avoided. This function returns -1 in case of error. */ /*--------------------------------------------------------------------------*/ int iniparser_getnsec(const dictionary * d) { int i ; int nsec ; if (d==NULL) return -1 ; nsec=0 ; for (i=0 ; i<d->size ; i++) { if (d->key[i]==NULL) continue ; if (strchr(d->key[i], ':')==NULL) { nsec ++ ; } } return nsec ; } /*-------------------------------------------------------------------------*/ /** @brief Get name for section n in a dictionary. @param d Dictionary to examine @param n Section number (from 0 to nsec-1). @return Pointer to char string This function locates the n-th section in a dictionary and returns its name as a pointer to a string statically allocated inside the dictionary. Do not free or modify the returned string! This function returns NULL in case of error. */ /*--------------------------------------------------------------------------*/ const char * iniparser_getsecname(const dictionary * d, int n) { int i ; int foundsec ; if (d==NULL || n<0) return NULL ; foundsec=0 ; for (i=0 ; i<d->size ; i++) { if (d->key[i]==NULL) continue ; if (strchr(d->key[i], ':')==NULL) { foundsec++ ; if (foundsec>n) break ; } } if (foundsec<=n) { return NULL ; } return d->key[i] ; } /*-------------------------------------------------------------------------*/ /** @brief Dump a dictionary to an opened file pointer. @param d Dictionary to dump. @param f Opened file pointer to dump to. @return void This function prints out the contents of a dictionary, one element by line, onto the provided file pointer. It is OK to specify @c stderr or @c stdout as output files. This function is meant for debugging purposes mostly. */ /*--------------------------------------------------------------------------*/ void iniparser_dump(const dictionary * d, FILE * f) { int i ; if (d==NULL || f==NULL) return ; for (i=0 ; i<d->size ; i++) { if (d->key[i]==NULL) continue ; if (d->val[i]!=NULL) { fprintf(f, "[%s]=[%s]\n", d->key[i], d->val[i]); } else { fprintf(f, "[%s]=UNDEF\n", d->key[i]); } } return ; } /*-------------------------------------------------------------------------*/ /** @brief Save a dictionary to a loadable ini file @param d Dictionary to dump @param f Opened file pointer to dump to @return void This function dumps a given dictionary into a loadable ini file. It is Ok to specify @c stderr or @c stdout as output files. */ /*--------------------------------------------------------------------------*/ void iniparser_dump_ini(const dictionary * d, FILE * f) { int i ; int nsec ; const char * secname ; if (d==NULL || f==NULL) return ; nsec = iniparser_getnsec(d); if (nsec<1) { /* No section in file: dump all keys as they are */ for (i=0 ; i<d->size ; i++) { if (d->key[i]==NULL) continue ; fprintf(f, "%s = %s\n", d->key[i], d->val[i]); } return ; } for (i=0 ; i<nsec ; i++) { secname = iniparser_getsecname(d, i) ; iniparser_dumpsection_ini(d, secname, f); } fprintf(f, "\n"); return ; } /*-------------------------------------------------------------------------*/ /** @brief Save a dictionary section to a loadable ini file @param d Dictionary to dump @param s Section name of dictionary to dump @param f Opened file pointer to dump to @return void This function dumps a given section of a given dictionary into a loadable ini file. It is Ok to specify @c stderr or @c stdout as output files. */ /*--------------------------------------------------------------------------*/ void iniparser_dumpsection_ini(const dictionary * d, const char * s, FILE * f) { int j ; char keym[ASCIILINESZ+1]; int seclen ; if (d==NULL || f==NULL) return ; if (! iniparser_find_entry(d, s)) return ; seclen = (int)strlen(s); fprintf(f, "\n[%s]\n", s); sprintf(keym, "%s:", s); for (j=0 ; j<d->size ; j++) { if (d->key[j]==NULL) continue ; if (!strncmp(d->key[j], keym, seclen+1)) { fprintf(f, "%-30s = %s\n", d->key[j]+seclen+1, d->val[j] ? d->val[j] : ""); } } fprintf(f, "\n"); return ; } /*-------------------------------------------------------------------------*/ /** @brief Get the number of keys in a section of a dictionary. @param d Dictionary to examine @param s Section name of dictionary to examine @return Number of keys in section */ /*--------------------------------------------------------------------------*/ int iniparser_getsecnkeys(const dictionary * d, const char * s) { int seclen, nkeys ; char keym[ASCIILINESZ+1]; int j ; nkeys = 0; if (d==NULL) return nkeys; if (! iniparser_find_entry(d, s)) return nkeys; seclen = (int)strlen(s); sprintf(keym, "%s:", s); for (j=0 ; j<d->size ; j++) { if (d->key[j]==NULL) continue ; if (!strncmp(d->key[j], keym, seclen+1)) nkeys++; } return nkeys; } /*-------------------------------------------------------------------------*/ /** @brief Get the number of keys in a section of a dictionary. @param d Dictionary to examine @param s Section name of dictionary to examine @param keys Already allocated array to store the keys in @return The pointer passed as `keys` argument or NULL in case of error This function queries a dictionary and finds all keys in a given section. The keys argument should be an array of pointers which size has been determined by calling `iniparser_getsecnkeys` function prior to this one. Each pointer in the returned char pointer-to-pointer is pointing to a string allocated in the dictionary; do not free or modify them. */ /*--------------------------------------------------------------------------*/ const char ** iniparser_getseckeys(const dictionary * d, const char * s, const char ** keys) { int i, j, seclen ; char keym[ASCIILINESZ+1]; if (d==NULL || keys==NULL) return NULL; if (! iniparser_find_entry(d, s)) return NULL; seclen = (int)strlen(s); sprintf(keym, "%s:", s); i = 0; for (j=0 ; j<d->size ; j++) { if (d->key[j]==NULL) continue ; if (!strncmp(d->key[j], keym, seclen+1)) { keys[i] = d->key[j]; i++; } } return keys; } /*-------------------------------------------------------------------------*/ /** @brief Get the string associated to a key @param d Dictionary to search @param key Key string to look for @param def Default value to return if key not found. @return pointer to statically allocated character string This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the pointer passed as 'def' is returned. The returned char pointer is pointing to a string allocated in the dictionary, do not free or modify it. */ /*--------------------------------------------------------------------------*/ const char * iniparser_getstring(const dictionary * d, const char * key, const char * def) { const char * lc_key ; const char * sval ; char tmp_str[ASCIILINESZ+1]; if (d==NULL || key==NULL) return def ; lc_key = strlwc(key, tmp_str, sizeof(tmp_str)); sval = dictionary_get(d, lc_key, def); return sval ; } /*-------------------------------------------------------------------------*/ /** @brief Get the string associated to a key, convert to an int @param d Dictionary to search @param key Key string to look for @param notfound Value to return in case of error @return integer This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the notfound value is returned. Supported values for integers include the usual C notation so decimal, octal (starting with 0) and hexadecimal (starting with 0x) are supported. Examples: "42" -> 42 "042" -> 34 (octal -> decimal) "0x42" -> 66 (hexa -> decimal) Warning: the conversion may overflow in various ways. Conversion is totally outsourced to strtol(), see the associated man page for overflow handling. Credits: Thanks to A. Becker for suggesting strtol() */ /*--------------------------------------------------------------------------*/ int iniparser_getint(const dictionary * d, const char * key, int notfound) { const char * str ; str = iniparser_getstring(d, key, INI_INVALID_KEY); if (str==INI_INVALID_KEY) return notfound ; return (int)strtol(str, NULL, 0); } /*-------------------------------------------------------------------------*/ /** @brief Get the string associated to a key, convert to a double @param d Dictionary to search @param key Key string to look for @param notfound Value to return in case of error @return double This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the notfound value is returned. */ /*--------------------------------------------------------------------------*/ double iniparser_getdouble(const dictionary * d, const char * key, double notfound) { const char * str ; str = iniparser_getstring(d, key, INI_INVALID_KEY); if (str==INI_INVALID_KEY) return notfound ; return atof(str); } /*-------------------------------------------------------------------------*/ /** @brief Get the string associated to a key, convert to a boolean @param d Dictionary to search @param key Key string to look for @param notfound Value to return in case of error @return integer This function queries a dictionary for a key. A key as read from an ini file is given as "section:key". If the key cannot be found, the notfound value is returned. A true boolean is found if one of the following is matched: - A string starting with 'y' - A string starting with 'Y' - A string starting with 't' - A string starting with 'T' - A string starting with '1' A false boolean is found if one of the following is matched: - A string starting with 'n' - A string starting with 'N' - A string starting with 'f' - A string starting with 'F' - A string starting with '0' The notfound value returned if no boolean is identified, does not necessarily have to be 0 or 1. */ /*--------------------------------------------------------------------------*/ int iniparser_getboolean(const dictionary * d, const char * key, int notfound) { int ret ; const char * c ; c = iniparser_getstring(d, key, INI_INVALID_KEY); if (c==INI_INVALID_KEY) return notfound ; if (c[0]=='y' || c[0]=='Y' || c[0]=='1' || c[0]=='t' || c[0]=='T') { ret = 1 ; } else if (c[0]=='n' || c[0]=='N' || c[0]=='0' || c[0]=='f' || c[0]=='F') { ret = 0 ; } else { ret = notfound ; } return ret; } /*-------------------------------------------------------------------------*/ /** @brief Finds out if a given entry exists in a dictionary @param ini Dictionary to search @param entry Name of the entry to look for @return integer 1 if entry exists, 0 otherwise Finds out if a given entry exists in the dictionary. Since sections are stored as keys with NULL associated values, this is the only way of querying for the presence of sections in a dictionary. */ /*--------------------------------------------------------------------------*/ int iniparser_find_entry(const dictionary * ini, const char * entry) { int found=0 ; if (iniparser_getstring(ini, entry, INI_INVALID_KEY)!=INI_INVALID_KEY) { found = 1 ; } return found ; } /*-------------------------------------------------------------------------*/ /** @brief Set an entry in a dictionary. @param ini Dictionary to modify. @param entry Entry to modify (entry name) @param val New value to associate to the entry. @return int 0 if Ok, -1 otherwise. If the given entry can be found in the dictionary, it is modified to contain the provided value. If it cannot be found, the entry is created. It is Ok to set val to NULL. */ /*--------------------------------------------------------------------------*/ int iniparser_set(dictionary * ini, const char * entry, const char * val) { char tmp_str[ASCIILINESZ+1]; return dictionary_set(ini, strlwc(entry, tmp_str, sizeof(tmp_str)), val) ; } /*-------------------------------------------------------------------------*/ /** @brief Delete an entry in a dictionary @param ini Dictionary to modify @param entry Entry to delete (entry name) @return void If the given entry can be found, it is deleted from the dictionary. */ /*--------------------------------------------------------------------------*/ void iniparser_unset(dictionary * ini, const char * entry) { char tmp_str[ASCIILINESZ+1]; dictionary_unset(ini, strlwc(entry, tmp_str, sizeof(tmp_str))); } /*-------------------------------------------------------------------------*/ /** @brief Load a single line from an INI file @param input_line Input line, may be concatenated multi-line input @param section Output space to store section @param key Output space to store key @param value Output space to store value @return line_status value */ /*--------------------------------------------------------------------------*/ static line_status iniparser_line( const char * input_line, char * section, char * key, char * value) { line_status sta ; char * line = NULL; size_t len ; line = xstrdup(input_line); len = strstrip(line); sta = LINE_UNPROCESSED ; if (len<1) { /* Empty line */ sta = LINE_EMPTY ; } else if (line[0]=='#' || line[0]==';') { /* Comment line */ sta = LINE_COMMENT ; } else if (line[0]=='[' && line[len-1]==']') { /* Section name */ sscanf(line, "[%[^]]", section); strstrip(section); strlwc(section, section, len); sta = LINE_SECTION ; } else if (sscanf (line, "%[^=] = \"%[^\"]\"", key, value) == 2 || sscanf (line, "%[^=] = '%[^\']'", key, value) == 2) { /* Usual key=value with quotes, with or without comments */ strstrip(key); strlwc(key, key, len); /* Don't strip spaces from values surrounded with quotes */ /* * sscanf cannot handle '' or "" as empty values * this is done here */ if (!strcmp(value, "\"\"") || (!strcmp(value, "''"))) { value[0]=0 ; } sta = LINE_VALUE ; } else if (sscanf (line, "%[^=] = %[^;#]", key, value) == 2) { /* Usual key=value without quotes, with or without comments */ strstrip(key); strlwc(key, key, len); strstrip(value); sta = LINE_VALUE ; } else if (sscanf(line, "%[^=] = %[;#]", key, value)==2 || sscanf(line, "%[^=] %[=]", key, value) == 2) { /* * Special cases: * key= * key=; * key=# */ strstrip(key); strlwc(key, key, len); value[0]=0 ; sta = LINE_VALUE ; } else { /* Generate syntax error */ sta = LINE_ERROR ; } free(line); return sta ; } /*-------------------------------------------------------------------------*/ /** @brief Parse an ini file and return an allocated dictionary object @param ininame Name of the ini file to read. @return Pointer to newly allocated dictionary This is the parser for ini files. This function is called, providing the name of the file to be read. It returns a dictionary object that should not be accessed directly, but through accessor functions instead. The returned dictionary must be freed using iniparser_freedict(). */ /*--------------------------------------------------------------------------*/ dictionary * iniparser_load(const char * ininame) { FILE * in ; char line [ASCIILINESZ+1] ; char section [ASCIILINESZ+1] ; char key [ASCIILINESZ+1] ; char tmp [(ASCIILINESZ * 2) + 1] ; char val [ASCIILINESZ+1] ; int last=0 ; int len ; int lineno=0 ; int errs=0; dictionary * dict ; if ((in=fopen(ininame, "r"))==NULL) { fprintf(stderr, "iniparser: cannot open %s\n", ininame); return NULL ; } dict = dictionary_new(0) ; if (!dict) { fclose(in); return NULL ; } memset(line, 0, ASCIILINESZ); memset(section, 0, ASCIILINESZ); memset(key, 0, ASCIILINESZ); memset(val, 0, ASCIILINESZ); last=0 ; while (fgets(line+last, ASCIILINESZ-last, in)!=NULL) { lineno++ ; len = (int)strlen(line)-1; if (len==0) continue; /* Safety check against buffer overflows */ if (line[len]!='\n' && !feof(in)) { fprintf(stderr, "iniparser: input line too long in %s (%d)\n", ininame, lineno); dictionary_del(dict); fclose(in); return NULL ; } /* Get rid of \n and spaces at end of line */ while ((len>=0) && ((line[len]=='\n') || (isspace(line[len])))) { line[len]=0 ; len-- ; } if (len < 0) { /* Line was entirely \n and/or spaces */ len = 0; } /* Detect multi-line */ if (line[len]=='\\') { /* Multi-line value */ last=len ; continue ; } else { last=0 ; } switch (iniparser_line(line, section, key, val)) { case LINE_EMPTY: case LINE_COMMENT: break ; case LINE_SECTION: errs = dictionary_set(dict, section, NULL); break ; case LINE_VALUE: sprintf(tmp, "%s:%s", section, key); errs = dictionary_set(dict, tmp, val) ; break ; case LINE_ERROR: fprintf(stderr, "iniparser: syntax error in %s (%d):\n", ininame, lineno); fprintf(stderr, "-> %s\n", line); errs++ ; break; default: break ; } memset(line, 0, ASCIILINESZ); last=0; if (errs<0) { fprintf(stderr, "iniparser: memory allocation failure\n"); break ; } } if (errs) { dictionary_del(dict); dict = NULL ; } fclose(in); return dict ; } /*-------------------------------------------------------------------------*/ /** @brief Free all memory associated to an ini dictionary @param d Dictionary to free @return void Free all memory associated to an ini dictionary. It is mandatory to call this function before the dictionary object gets out of the current context. */ /*--------------------------------------------------------------------------*/ void iniparser_freedict(dictionary * d) { dictionary_del(d); }
ekapujiw2002/rpi-mmedia-ex4
xkeys/iniparser.c
C
gpl-3.0
23,614
test_name 'Windows ACL Module - Deny "read, execute" Rights for Identity on File' confine(:to, :platform => 'windows') #Globals rights = "'read','execute'" target_parent = 'c:/temp' target = "c:/temp/deny_re_rights_file.txt" user_id = "bob" file_content = 'Your forcefield is good, but my teleporting is better.' verify_content_command = "cat /cygdrive/c/temp/deny_re_rights_file.txt" file_content_regex = /\A#{file_content}\z/ verify_acl_command = "icacls #{target}" acl_regex = /.*\\bob:\(DENY\)\(RX\)/ #Manifest acl_manifest = <<-MANIFEST file { '#{target_parent}': ensure => directory } file { '#{target}': ensure => file, content => '#{file_content}', require => File['#{target_parent}'] } user { '#{user_id}': ensure => present, groups => 'Users', managehome => true, password => "L0v3Pupp3t!" } acl { '#{target}': permissions => [ { identity => '#{user_id}', perm_type => 'deny', rights => [#{rights}] }, ], } MANIFEST #Tests agents.each do |agent| step "Execute Manifest" on(agent, puppet('apply', '--debug'), :stdin => acl_manifest) do |result| assert_no_match(/Error:/, result.stderr, 'Unexpected error was detected!') end step "Verify that ACL Rights are Correct" on(agent, verify_acl_command) do |result| assert_match(acl_regex, result.stdout, 'Expected ACL was not present!') end step "Verify File Data Integrity" on(agent, verify_content_command) do |result| assert_match(file_content_regex, result.stdout, 'File content is invalid!') end end
nauskis/Puppet-for-dummies
windowsia/puppet/modules/acl/acceptance/tests/access_rights_file/deny_re_rights_file.rb
Ruby
gpl-3.0
1,534
/* This file is part of GEGL * * GEGL is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 3 of the License, or (at your option) any later version. * * GEGL is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with GEGL; if not, see <http://www.gnu.org/licenses/>. * * Copyright 2003 Calvin Williamson * 2005-2008 Øyvind Kolås */ #ifndef __GEGL_OPERATIONS_H__ #define __GEGL_OPERATIONS_H__ #include <glib-object.h> /* Used to look up the gtype when changing the type of operation associated * a GeglNode using just a string with the registered name. */ GType gegl_operation_gtype_from_name (const gchar *name); gchar ** gegl_list_operations (guint *n_operations_p); void gegl_operation_gtype_cleanup (void); #endif
rggjan/gegl-global-matting
gegl/operation/gegl-operations.h
C
gpl-3.0
1,177
/**************************************************************************** ** ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies). ** All rights reserved. ** Contact: Nokia Corporation (qt-info@nokia.com) ** ** This file is part of the plugins of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** GNU Lesser General Public License Usage ** This file may be used under the terms of the GNU Lesser General Public ** License version 2.1 as published by the Free Software Foundation and ** appearing in the file LICENSE.LGPL included in the packaging of this ** file. Please review the following information to ensure the GNU Lesser ** General Public License version 2.1 requirements will be met: ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Nokia gives you certain additional ** rights. These rights are described in the Nokia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU General ** Public License version 3.0 as published by the Free Software Foundation ** and appearing in the file LICENSE.GPL included in the packaging of this ** file. Please review the following information to ensure the GNU General ** Public License version 3.0 requirements will be met: ** http://www.gnu.org/copyleft/gpl.html. ** ** Other Usage ** Alternatively, this file may be used in accordance with the terms and ** conditions contained in a signed written agreement between you and Nokia. ** ** ** ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #ifndef QMOUSELINUXINPUT_QWS_H #define QMOUSELINUXINPUT_QWS_H #include <QtGui/QWSCalibratedMouseHandler> QT_BEGIN_HEADER QT_BEGIN_NAMESPACE QT_MODULE(Gui) #ifndef QT_NO_QWS_MOUSE_LINUXINPUT class QWSLinuxInputMousePrivate; class QWSLinuxInputMouseHandler : public QWSCalibratedMouseHandler { public: QWSLinuxInputMouseHandler(const QString &); ~QWSLinuxInputMouseHandler(); void suspend(); void resume(); private: QWSLinuxInputMousePrivate *d; friend class QWSLinuxInputMousePrivate; }; #endif // QT_NO_QWS_MOUSE_LINUXINPUT QT_END_NAMESPACE QT_END_HEADER #endif // QMOUSELINUXINPUT_QWS_H
kleiinnn/LinkJVM
tools/kar-gen/qt4/QtGui/qmouselinuxinput_qws.h
C
gpl-3.0
2,337
/* * Licensed to the Apache Software Foundation (ASF) under one or more * contributor license agreements. See the NOTICE file distributed with * this work for additional information regarding copyright ownership. * The ASF licenses this file to You under the Apache License, Version 2.0 * (the "License"); you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * */ package org.zeroturnaround.zip.extra; import static org.zeroturnaround.zip.extra.ZipConstants.BYTE_MASK; import static org.zeroturnaround.zip.extra.ZipConstants.WORD; /** * This is a class that has been made significantly smaller (deleted a bunch of methods) and originally * is from the Apache Ant Project (http://ant.apache.org), org.apache.tools.zip package. * All license and other documentation is intact. * * Utility class that represents a four byte integer with conversion * rules for the big endian byte order of ZIP files. * */ public final class ZipLong implements Cloneable { // private static final int BYTE_BIT_SIZE = 8; private static final int BYTE_1 = 1; private static final int BYTE_1_MASK = 0xFF00; private static final int BYTE_1_SHIFT = 8; private static final int BYTE_2 = 2; private static final int BYTE_2_MASK = 0xFF0000; private static final int BYTE_2_SHIFT = 16; private static final int BYTE_3 = 3; private static final long BYTE_3_MASK = 0xFF000000L; private static final int BYTE_3_SHIFT = 24; private final long value; /** Central File Header Signature */ public static final ZipLong CFH_SIG = new ZipLong(0X02014B50L); /** Local File Header Signature */ public static final ZipLong LFH_SIG = new ZipLong(0X04034B50L); /** * Data Descriptor signature */ public static final ZipLong DD_SIG = new ZipLong(0X08074B50L); /** * Value stored in size and similar fields if ZIP64 extensions are * used. */ static final ZipLong ZIP64_MAGIC = new ZipLong(ZipConstants.ZIP64_MAGIC); /** * Create instance from a number. * * @param value the long to store as a ZipLong * @since 1.1 */ public ZipLong(long value) { this.value = value; } /** * Create instance from bytes. * * @param bytes the bytes to store as a ZipLong * @since 1.1 */ public ZipLong(byte[] bytes) { this(bytes, 0); } /** * Create instance from the four bytes starting at offset. * * @param bytes the bytes to store as a ZipLong * @param offset the offset to start * @since 1.1 */ public ZipLong(byte[] bytes, int offset) { value = ZipLong.getValue(bytes, offset); } /** * Get value as four bytes in big endian byte order. * * @since 1.1 * @return value as four bytes in big endian order */ public byte[] getBytes() { return ZipLong.getBytes(value); } /** * Get value as Java long. * * @since 1.1 * @return value as a long */ public long getValue() { return value; } /** * Get value as four bytes in big endian byte order. * * @param value the value to convert * @return value as four bytes in big endian byte order */ public static byte[] getBytes(long value) { byte[] result = new byte[WORD]; result[0] = (byte) ((value & BYTE_MASK)); result[BYTE_1] = (byte) ((value & BYTE_1_MASK) >> BYTE_1_SHIFT); result[BYTE_2] = (byte) ((value & BYTE_2_MASK) >> BYTE_2_SHIFT); result[BYTE_3] = (byte) ((value & BYTE_3_MASK) >> BYTE_3_SHIFT); return result; } /** * Helper method to get the value as a Java long from four bytes starting at given array offset * * @param bytes the array of bytes * @param offset the offset to start * @return the corresponding Java long value */ public static long getValue(byte[] bytes, int offset) { long value = (bytes[offset + BYTE_3] << BYTE_3_SHIFT) & BYTE_3_MASK; value += (bytes[offset + BYTE_2] << BYTE_2_SHIFT) & BYTE_2_MASK; value += (bytes[offset + BYTE_1] << BYTE_1_SHIFT) & BYTE_1_MASK; value += (bytes[offset] & BYTE_MASK); return value; } /** * Helper method to get the value as a Java long from a four-byte array * * @param bytes the array of bytes * @return the corresponding Java long value */ public static long getValue(byte[] bytes) { return getValue(bytes, 0); } /** * Override to make two instances with same value equal. * * @param o an object to compare * @return true if the objects are equal * @since 1.1 */ @Override public boolean equals(Object o) { if (o == null || !(o instanceof ZipLong)) { return false; } return value == ((ZipLong) o).getValue(); } /** * Override to make two instances with same value equal. * * @return the value stored in the ZipLong * @since 1.1 */ @Override public int hashCode() { return (int) value; } @Override public Object clone() { try { return super.clone(); } catch (CloneNotSupportedException cnfe) { // impossible throw new RuntimeException(cnfe); } } @Override public String toString() { return "ZipLong value: " + value; } }
OhmGeek/ThanCue
src/org/zeroturnaround/zip/extra/ZipLong.java
Java
gpl-3.0
5,578
package org.openpnp.vision.pipeline.stages; import java.util.ArrayList; import java.util.List; import org.opencv.core.Mat; import org.opencv.imgproc.Imgproc; import org.openpnp.vision.pipeline.CvPipeline; import org.openpnp.vision.pipeline.CvStage; import org.openpnp.vision.pipeline.Property; import org.openpnp.vision.pipeline.Stage; import org.simpleframework.xml.Attribute; import org.simpleframework.xml.Root; @Stage(category="Image Processing", description="Performs adaptive thresholding on the working image.") public class ThresholdAdaptive extends CvStage { public enum AdaptiveMethod { Mean(Imgproc.ADAPTIVE_THRESH_MEAN_C), Gaussian(Imgproc.ADAPTIVE_THRESH_GAUSSIAN_C); private int code; AdaptiveMethod(int code) { this.code = code; } public int getCode() { return code; } } @Attribute @Property(description="Adaptive thresholding algorithm to use: 'Mean' is a mean of the (blockSize x blockSize) neighborhood of a pixel minus cParm. 'Gaussian' is a weighted sum (cross-correlation with a Gaussian window) of the (blockSize x blockSize) neighborhood of a pixel minus cParm") private AdaptiveMethod adaptiveMethod = AdaptiveMethod.Mean; public AdaptiveMethod getAdaptiveMethod() { return adaptiveMethod; } public void setAdaptiveMethod(AdaptiveMethod adaptiveMethod) { this.adaptiveMethod = adaptiveMethod; } @Attribute @Property(description="Thresholding type that must be either binary (default) or inverted binary") private boolean invert = false; public boolean isInvert() { return invert; } public void setInvert(boolean invert) { this.invert = invert; } @Attribute @Property(description="Size of a pixel neighborhood that is used to calculate a threshold value for the pixel. Should be and odd number greater than or equal to 3") private int blockSize = 127; public void setBlockSize(int blocksize) { this.blockSize = 2 * (blocksize / 2) + 1; this.blockSize = this.blockSize < 3 ? 3 : this.blockSize; } public int getBlockSize() { return blockSize; } @Attribute @Property(description="Constant subtracted from the mean or weighted mean. Can take negative values too.") private int cParm = 80; public void setcParm(int cparm) { this.cParm = cparm; } public int getcParm() { return cParm; } @Override public Result process(CvPipeline pipeline) throws Exception { Mat mat = pipeline.getWorkingImage(); Imgproc.adaptiveThreshold(mat, mat, 255, adaptiveMethod.getCode(), invert ? Imgproc.THRESH_BINARY_INV : Imgproc.THRESH_BINARY, blockSize, cParm); return null; } }
richard-sim/openpnp
src/main/java/org/openpnp/vision/pipeline/stages/ThresholdAdaptive.java
Java
gpl-3.0
2,829
/* * Copyright 2020 Free Software Foundation, Inc. * * This file is part of GNU Radio * * SPDX-License-Identifier: GPL-3.0-or-later * */ #include "pydoc_macros.h" #define D(...) DOC(gr, blocks, __VA_ARGS__) /* This file contains placeholders for docstrings for the Python bindings. Do not edit! These were automatically extracted during the binding process and will be overwritten during the build process */ static const char* __doc_gr_blocks_keep_one_in_n = R"doc()doc"; static const char* __doc_gr_blocks_keep_one_in_n_keep_one_in_n_0 = R"doc()doc"; static const char* __doc_gr_blocks_keep_one_in_n_keep_one_in_n_1 = R"doc()doc"; static const char* __doc_gr_blocks_keep_one_in_n_make = R"doc()doc"; static const char* __doc_gr_blocks_keep_one_in_n_set_n = R"doc()doc";
mbr0wn/gnuradio
gr-blocks/python/blocks/bindings/docstrings/keep_one_in_n_pydoc_template.h
C
gpl-3.0
796
<?php namespace Alchemy\Tests\Phrasea\Controller\Admin; /** * @group functional * @group legacy * @group authenticated * @group web */ class ConnectedUserTest extends \PhraseanetAuthenticatedWebTestCase { protected $client; /** * @covers \Alchemy\Phrasea\Controller\Admin\ConnectedUsers::connect */ public function testgetSlash() { self::$DI['client']->request('GET', '/admin/connected-users/'); $this->assertTrue(self::$DI['client']->getResponse()->isOk()); } }
kwemi/Phraseanet
tests/Alchemy/Tests/Phrasea/Controller/Admin/ConnectedUserTest.php
PHP
gpl-3.0
517
<?php require_once __DIR__ . '/../../Bridge_datas.inc'; /** * @group functional * @group legacy */ class Bridge_Api_Dailymotion_ContainerTest extends \PhraseanetTestCase { /** * @var Bridge_Api_Dailymotion_Container */ protected $object; public function setUp() { parent::setUp(); $this->test = [ 'id' => '01234567' , 'description' => 'one description' , 'name' => 'hello container' ]; } public function testGet_created_on() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertNull($this->object->get_created_on()); } public function testGet_description() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertEquals($this->test['description'], $this->object->get_description()); unset($this->test["description"]); $this->object = new Bridge_Api_Dailymotion_Element($this->test, 'blabla'); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_STRING, $this->object->get_description()); $this->assertEmpty($this->object->get_description()); } public function testGet_id() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertEquals($this->test['id'], $this->object->get_id()); unset($this->test["id"]); $this->object = new Bridge_Api_Dailymotion_Element($this->test, 'blabla'); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_STRING, $this->object->get_id()); $this->assertEmpty($this->object->get_id()); } public function testGet_thumbnail() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertEquals('thumb', $this->object->get_thumbnail()); } public function testGet_title() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertEquals($this->test['name'], $this->object->get_title()); unset($this->test["name"]); $this->object = new Bridge_Api_Dailymotion_Element($this->test, 'blabla'); $this->assertInternalType(PHPUnit_Framework_Constraint_IsType::TYPE_STRING, $this->object->get_title()); $this->assertEmpty($this->object->get_title()); } public function testGet_type() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertEquals('playlist', $this->object->get_type()); } public function testGet_updated_on() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertNull($this->object->get_updated_on()); } public function testGet_url() { $this->object = new Bridge_Api_Dailymotion_Container($this->test, 'playlist', 'thumb', 'url'); $this->assertEquals('url', $this->object->get_url()); } }
kwemi/Phraseanet
tests/classes/Bridge/Api/Dailymotion/ContainerTest.php
PHP
gpl-3.0
3,169
package egoscale import ( "net" ) // Nic represents a Network Interface Controller (NIC) // // See: http://docs.cloudstack.apache.org/projects/cloudstack-administration/en/latest/networking_and_traffic.html#configuring-multiple-ip-addresses-on-a-single-nic type Nic struct { BroadcastURI string `json:"broadcasturi,omitempty" doc:"the broadcast uri of the nic"` DeviceID *UUID `json:"deviceid,omitempty" doc:"device id for the network when plugged into the virtual machine"` Gateway net.IP `json:"gateway,omitempty" doc:"the gateway of the nic"` ID *UUID `json:"id,omitempty" doc:"the ID of the nic"` IP6Address net.IP `json:"ip6address,omitempty" doc:"the IPv6 address of network"` IP6CIDR *CIDR `json:"ip6cidr,omitempty" doc:"the cidr of IPv6 network"` IP6Gateway net.IP `json:"ip6gateway,omitempty" doc:"the gateway of IPv6 network"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"the ip address of the nic"` IsDefault bool `json:"isdefault,omitempty" doc:"true if nic is default, false otherwise"` IsolationURI string `json:"isolationuri,omitempty" doc:"the isolation uri of the nic"` MACAddress MACAddress `json:"macaddress,omitempty" doc:"true if nic is default, false otherwise"` Netmask net.IP `json:"netmask,omitempty" doc:"the netmask of the nic"` NetworkID *UUID `json:"networkid,omitempty" doc:"the ID of the corresponding network"` NetworkName string `json:"networkname,omitempty" doc:"the name of the corresponding network"` ReverseDNS []ReverseDNS `json:"reversedns,omitempty" doc:"the list of PTR record(s) associated with the virtual machine"` SecondaryIP []NicSecondaryIP `json:"secondaryip,omitempty" doc:"the Secondary ipv4 addr of nic"` TrafficType string `json:"traffictype,omitempty" doc:"the traffic type of the nic"` Type string `json:"type,omitempty" doc:"the type of the nic"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"Id of the vm to which the nic belongs"` } // ListRequest build a ListNics request from the given Nic func (nic Nic) ListRequest() (ListCommand, error) { req := &ListNics{ VirtualMachineID: nic.VirtualMachineID, NicID: nic.ID, NetworkID: nic.NetworkID, } return req, nil } // NicSecondaryIP represents a link between NicID and IPAddress type NicSecondaryIP struct { ID *UUID `json:"id,omitempty" doc:"the ID of the secondary private IP addr"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"Secondary IP address"` NetworkID *UUID `json:"networkid,omitempty" doc:"the ID of the network"` NicID *UUID `json:"nicid,omitempty" doc:"the ID of the nic"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"the ID of the vm"` } //go:generate go run generate/main.go -interface=Listable ListNics // ListNics represents the NIC search type ListNics struct { Keyword string `json:"keyword,omitempty" doc:"List by keyword"` NetworkID *UUID `json:"networkid,omitempty" doc:"list nic of the specific vm's network"` NicID *UUID `json:"nicid,omitempty" doc:"the ID of the nic to to list IPs"` Page int `json:"page,omitempty"` PageSize int `json:"pagesize,omitempty"` VirtualMachineID *UUID `json:"virtualmachineid,omitempty" doc:"the ID of the vm"` _ bool `name:"listNics" description:"list the vm nics IP to NIC"` } // ListNicsResponse represents a list of templates type ListNicsResponse struct { Count int `json:"count"` Nic []Nic `json:"nic"` } // AddIPToNic (Async) represents the assignation of a secondary IP type AddIPToNic struct { NicID *UUID `json:"nicid" doc:"the ID of the nic to which you want to assign private IP"` IPAddress net.IP `json:"ipaddress,omitempty" doc:"Secondary IP Address"` _ bool `name:"addIpToNic" description:"Assigns secondary IP to NIC"` } // Response returns the struct to unmarshal func (AddIPToNic) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (AddIPToNic) AsyncResponse() interface{} { return new(NicSecondaryIP) } // RemoveIPFromNic (Async) represents a deletion request type RemoveIPFromNic struct { ID *UUID `json:"id" doc:"the ID of the secondary ip address to nic"` _ bool `name:"removeIpFromNic" description:"Removes secondary IP from the NIC."` } // Response returns the struct to unmarshal func (RemoveIPFromNic) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (RemoveIPFromNic) AsyncResponse() interface{} { return new(BooleanResponse) } // ActivateIP6 (Async) activates the IP6 on the given NIC // // Exoscale specific API: https://community.exoscale.ch/api/compute/#activateip6_GET type ActivateIP6 struct { NicID *UUID `json:"nicid" doc:"the ID of the nic to which you want to assign the IPv6"` _ bool `name:"activateIp6" description:"Activate the IPv6 on the VM's nic"` } // Response returns the struct to unmarshal func (ActivateIP6) Response() interface{} { return new(AsyncJobResult) } // AsyncResponse returns the struct to unmarshal the async job func (ActivateIP6) AsyncResponse() interface{} { return new(Nic) }
dave2/packer
vendor/github.com/exoscale/egoscale/nics.go
GO
mpl-2.0
5,529
<!DOCTYPE html> <html lang="en" > <head> <meta charset="utf-8"/> <title>CSS3 Text, linebreaks: 2030 PER MILLE SIGN (normal,ja)</title> <link rel='author' title='Richard Ishida' href='mailto:ishida@w3.org'> <link rel='help' href='https://drafts.csswg.org/css-text-3/#line-break'> <link rel="match" href="reference/css3-text-line-break-jazh-254-ref.html"> <meta name='flags' content=''> <meta name="assert" content="The browser will NOT allow 2030 PER MILLE SIGN at the beginning of a line."> <style type='text/css'> @font-face { font-family: 'mplus-1p-regular'; src: url('/fonts/mplus-1p-regular.woff') format('woff'); /* filesize: 803K */ } .test, .ref { font-size: 30px; font-family: mplus-1p-regular, sans-serif; width: 93px; padding: 0; border: 1px solid orange; line-height: 1em; } .name { font-size: 10px; } .test { line-break: normal; } </style> </head> <body> <p class='instructions'>Test passes if the two orange boxes are identical.</p> <div class='test' lang='ja'>中中中&#x2030;文</div> <div class='ref'>中中<br/>中&#x2030;文</div></div> <!--Notes: <p class='notes'>For more information about expected line break behavior and line break classes, see <a href='http://www.unicode.org/reports/tr14/'>Unicode Standard Annex #14 Line Breaking Properties</a>. --> </body> </html>
canaltinova/servo
tests/wpt/web-platform-tests/css/css-text/i18n/css3-text-line-break-jazh-254.html
HTML
mpl-2.0
1,310
<!DOCTYPE HTML> <html> <head> <title>Pixel rounding testcase</title> <style type="text/css"> html, body { margin: 0; border: none; padding: 0; } div { position: absolute; height: 10px; width: 11px; } div.i1 { top: 10px; background-image: url(blue-1x1.png); } div.i3 { top: 30px; background-image: url(blue-3x3.png); } div.i5 { top: 50px; background-image: url(blue-5x5.png); } div.i25 { top: 70px; background-image: url(blue-25x25.png); } div.p1 { left: 9.5px; background-position: top left; } div.p2 { left: 29.5px; background-position: top; } div.p3 { left: 49.5px; background-position: top right; } div.p4 { left: 69.5px; background-position: left; } div.p5 { left: 89.5px; background-position: center; } div.p6 { left: 109.5px; background-position: right; } div.p7 { left: 129.5px; background-position: bottom left; } div.p8 { left: 149.5px; background-position: bottom; } div.p9 { left: 169.5px; background-position: bottom right; } </style> </head> <body> <div class="i1 p1"></div> <div class="i1 p2"></div> <div class="i1 p3"></div> <div class="i1 p4"></div> <div class="i1 p5"></div> <div class="i1 p6"></div> <div class="i1 p7"></div> <div class="i1 p8"></div> <div class="i1 p9"></div> <div class="i3 p1"></div> <div class="i3 p2"></div> <div class="i3 p3"></div> <div class="i3 p4"></div> <div class="i3 p5"></div> <div class="i3 p6"></div> <div class="i3 p7"></div> <div class="i3 p8"></div> <div class="i3 p9"></div> <div class="i5 p1"></div> <div class="i5 p2"></div> <div class="i5 p3"></div> <div class="i5 p4"></div> <div class="i5 p5"></div> <div class="i5 p6"></div> <div class="i5 p7"></div> <div class="i5 p8"></div> <div class="i5 p9"></div> <div class="i25 p1"></div> <div class="i25 p2"></div> <div class="i25 p3"></div> <div class="i25 p4"></div> <div class="i25 p5"></div> <div class="i25 p6"></div> <div class="i25 p7"></div> <div class="i25 p8"></div> <div class="i25 p9"></div> </body> </html>
Yukarumya/Yukarum-Redfoxes
layout/reftests/pixel-rounding/background-image-left-width-5.html
HTML
mpl-2.0
1,935
package org.mozilla.osmdroid.contributor; /** * Copyright by Christof Dallermassl * This program is free software and licensed under GPL. * * Original JAVA-Code ported for Android compatibility by Nicolas 'plusminus' Gramlich. */ import org.mozilla.osmdroid.contributor.util.RecordedGeoPoint; import org.mozilla.osmdroid.contributor.util.RecordedRouteGPXFormatter; import org.mozilla.osmdroid.contributor.util.Util; import org.mozilla.osmdroid.contributor.util.constants.OpenStreetMapContributorConstants; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; import java.io.ByteArrayInputStream; import java.io.DataOutputStream; import java.io.IOException; import java.io.InputStream; import java.net.HttpURLConnection; import java.net.URL; import java.text.SimpleDateFormat; import java.util.ArrayList; import java.util.GregorianCalendar; /** * Small java class that allows to upload gpx files to www.openstreetmap.org via its api call. * * @author cdaller * @author Nicolas Gramlich */ public class OSMUploader implements OpenStreetMapContributorConstants { // =========================================================== // Constants // =========================================================== public static final String API_VERSION = "0.5"; public static final SimpleDateFormat pseudoFileNameFormat = new SimpleDateFormat( "yyyyMMdd'_'HHmmss'_'SSS"); private static final int BUFFER_SIZE = 65535; private static final String BASE64_ENC = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/"; private static final String BOUNDARY = "----------------------------d10f7aa230e8"; private static final String LINE_END = "\r\n"; private static final String DEFAULT_DESCRIPTION = "AndNav - automatically created route."; private static final String DEFAULT_TAGS = "AndNav"; private static final SimpleDateFormat autoTagFormat = new SimpleDateFormat("MMMM yyyy"); // =========================================================== // Fields // =========================================================== // =========================================================== // Constructors // =========================================================== /** * This is a utility class with only static members. */ private OSMUploader() { } // =========================================================== // Methods // =========================================================== /** * Uses OSMConstants.OSM_USERNAME and OSMConstants.OSM_PASSWORD as username/password. * Description will be <code>DEFAULT_DESCRIPTION</code>, tags will be automatically generated * (i.e. "<code>October 2008</code>") NOTE: This method is not blocking! * * @param gpxInputStream the InputStream containing the gpx-data. * @throws IOException */ public static void uploadAsync(final ArrayList<RecordedGeoPoint> recordedGeoPoints) { uploadAsync(DEFAULT_DESCRIPTION, DEFAULT_TAGS, true, recordedGeoPoints); } /** * Uses OSMConstants.OSM_USERNAME and OSMConstants.OSM_PASSWORD as username/password. The * 'filename' will be the current <code>timestamp.gpx</code> (i.e. "20081231_234815_912.gpx") * NOTE: This method is not blocking! * * @param description <code>not null</code> * @param tags <code>not null</code> * @param addDateTags adds Date Tags to the existing Tags (i.e. "October 2008") * @param gpxInputStreaman the InputStream containing the gpx-data. * @throws IOException */ public static void uploadAsync(final String description, final String tags, final boolean addDateTags, final ArrayList<RecordedGeoPoint> recordedGeoPoints) { uploadAsync(OSM_USERNAME, OSM_PASSWORD, description, tags, addDateTags, recordedGeoPoints, pseudoFileNameFormat.format(new GregorianCalendar().getTime()) + "_" + OSM_USERNAME + ".gpx"); } /** * NOTE: This method is not blocking! (Code runs in thread) * * @param username <code>not null</code> and <code>not empty</code>. Valid OSM-username * @param password <code>not null</code> and <code>not empty</code>. Valid password to the * OSM-username. * @param description <code>not null</code> * @param tags if <code>null</code> addDateTags is treated as <code>true</code> * @param addDateTags adds Date Tags to the existing Tags (i.e. "<code>October 2008</code>") * @param gpxInputStream the InputStream containing the gpx-data. * @param pseudoFileName ending with "<code>.gpx</code>" * @throws IOException */ public static void uploadAsync(final String username, final String password, final String description, final String tags, final boolean addDateTags, final ArrayList<RecordedGeoPoint> recordedGeoPoints, final String pseudoFileName) { if (username == null || username.length() == 0) return; if (password == null || password.length() == 0) return; if (description == null || description.length() == 0) return; if (tags == null || tags.length() == 0) return; if (pseudoFileName == null || pseudoFileName.endsWith(".gpx")) return; new Thread(new Runnable() { @Override public void run() { if (!Util.isSufficienDataForUpload(recordedGeoPoints)) return; final InputStream gpxInputStream = new ByteArrayInputStream( RecordedRouteGPXFormatter.create(recordedGeoPoints).getBytes()); String tagsToUse = tags; if (addDateTags || tagsToUse == null) if (tagsToUse == null) tagsToUse = autoTagFormat.format(new GregorianCalendar().getTime()); else tagsToUse = tagsToUse + " " + autoTagFormat.format(new GregorianCalendar().getTime()); // Log.d(LOG_TAG, "Uploading " + pseudoFileName + " to openstreetmap.org"); try { // String urlGpxName = URLEncoder.encode(gpxName.replaceAll("\\.;&?,/","_"), // "UTF-8"); final String urlDesc = (description == null) ? DEFAULT_DESCRIPTION : description.replaceAll("\\.;&?,/", "_"); final String urlTags = (tagsToUse == null) ? DEFAULT_TAGS : tagsToUse.replaceAll("\\\\.;&?,/", "_"); final URL url = new URL("http://www.openstreetmap.org/api/" + API_VERSION + "/gpx/create"); // Log.d(LOG_TAG, "Destination Url: " + url); final HttpURLConnection con = (HttpURLConnection) url.openConnection(); con.setConnectTimeout(15000); con.setRequestMethod("POST"); con.setDoOutput(true); con.addRequestProperty("Authorization", "Basic " + encodeBase64(username + ":" + password)); con.addRequestProperty("Content-Type", "multipart/form-data; boundary=" + BOUNDARY); con.addRequestProperty("Connection", "close"); // counterpart of keep-alive con.addRequestProperty("Expect", ""); con.connect(); final DataOutputStream out = new DataOutputStream(new BufferedOutputStream( con.getOutputStream())); // DataOutputStream out = new DataOutputStream(System.out); writeContentDispositionFile(out, "file", gpxInputStream, pseudoFileName); writeContentDisposition(out, "description", urlDesc); writeContentDisposition(out, "tags", urlTags); writeContentDisposition(out, "public", "1"); out.writeBytes("--" + BOUNDARY + "--" + LINE_END); out.flush(); final int retCode = con.getResponseCode(); String retMsg = con.getResponseMessage(); // Log.d(LOG_TAG, "\nreturn code: "+retCode + " " + retMsg); if (retCode != 200) { // Look for a detailed error message from the server if (con.getHeaderField("Error") != null) retMsg += "\n" + con.getHeaderField("Error"); con.disconnect(); throw new RuntimeException(retCode + " " + retMsg); } out.close(); con.disconnect(); } catch (final Exception e) { // Log.e(LOG_TAG, "OSMUpload Error", e); } } }, "OSMUpload-Thread").start(); } public static void upload(final String username, final String password, final String description, final String tags, final boolean addDateTags, final ArrayList<RecordedGeoPoint> recordedGeoPoints, final String pseudoFileName) throws IOException { uploadAsync(username, password, description, tags, addDateTags, recordedGeoPoints, pseudoFileName); } /** * @param out * @param string * @param gpxFile * @throws IOException */ private static void writeContentDispositionFile(final DataOutputStream out, final String name, final InputStream gpxInputStream, final String pseudoFileName) throws IOException { out.writeBytes("--" + BOUNDARY + LINE_END); out.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"; filename=\"" + pseudoFileName + "\"" + LINE_END); out.writeBytes("Content-Type: application/octet-stream" + LINE_END); out.writeBytes(LINE_END); final byte[] buffer = new byte[BUFFER_SIZE]; // int fileLen = (int)gpxFile.length(); int read; int sumread = 0; final InputStream in = new BufferedInputStream(gpxInputStream); // Log.d(LOG_TAG, "Transferring data to server"); while ((read = in.read(buffer)) >= 0) { out.write(buffer, 0, read); out.flush(); sumread += read; } in.close(); out.writeBytes(LINE_END); } /** * @param string * @param urlDesc * @throws IOException */ private static void writeContentDisposition(final DataOutputStream out, final String name, final String value) throws IOException { out.writeBytes("--" + BOUNDARY + LINE_END); out.writeBytes("Content-Disposition: form-data; name=\"" + name + "\"" + LINE_END); out.writeBytes(LINE_END); out.writeBytes(value + LINE_END); } private static String encodeBase64(final String s) { final StringBuilder out = new StringBuilder(); for (int i = 0; i < (s.length() + 2) / 3; ++i) { final int l = Math.min(3, s.length() - i * 3); final String buf = s.substring(i * 3, i * 3 + l); out.append(BASE64_ENC.charAt(buf.charAt(0) >> 2)); out.append(BASE64_ENC.charAt((buf.charAt(0) & 0x03) << 4 | (l == 1 ? 0 : (buf.charAt(1) & 0xf0) >> 4))); out.append(l > 1 ? BASE64_ENC.charAt((buf.charAt(1) & 0x0f) << 2 | (l == 2 ? 0 : (buf.charAt(2) & 0xc0) >> 6)) : '='); out.append(l > 2 ? BASE64_ENC.charAt(buf.charAt(2) & 0x3f) : '='); } return out.toString(); } }
petercpg/MozStumbler
android/src/main/java/org/mozilla/osmdroid/contributor/OSMUploader.java
Java
mpl-2.0
12,085
; ; Copyright (c) 2010 The WebM project authors. All Rights Reserved. ; ; Use of this source code is governed by a BSD-style license ; that can be found in the LICENSE file in the root of the source ; tree. An additional intellectual property rights grant can be found ; in the file PATENTS. All contributing project authors may ; be found in the AUTHORS file in the root of the source tree. ; %include "vpx_ports/x86_abi_support.asm" %macro STACK_FRAME_CREATE 0 %if ABI_IS_32BIT %define input rsi %define output rdi %define pitch rax push rbp mov rbp, rsp GET_GOT rbx push rsi push rdi ; end prolog mov rsi, arg(0) mov rdi, arg(1) movsxd rax, dword ptr arg(2) lea rcx, [rsi + rax*2] %else %if LIBVPX_YASM_WIN64 %define input rcx %define output rdx %define pitch r8 SAVE_XMM 7, u %else %define input rdi %define output rsi %define pitch rdx %endif %endif %endmacro %macro STACK_FRAME_DESTROY 0 %define input %define output %define pitch %if ABI_IS_32BIT pop rdi pop rsi RESTORE_GOT pop rbp %else %if LIBVPX_YASM_WIN64 RESTORE_XMM %endif %endif ret %endmacro SECTION .text ;void vp8_short_fdct4x4_sse2(short *input, short *output, int pitch) global sym(vp8_short_fdct4x4_sse2) PRIVATE sym(vp8_short_fdct4x4_sse2): STACK_FRAME_CREATE movq xmm0, MMWORD PTR[input ] ;03 02 01 00 movq xmm2, MMWORD PTR[input+ pitch] ;13 12 11 10 lea input, [input+2*pitch] movq xmm1, MMWORD PTR[input ] ;23 22 21 20 movq xmm3, MMWORD PTR[input+ pitch] ;33 32 31 30 punpcklqdq xmm0, xmm2 ;13 12 11 10 03 02 01 00 punpcklqdq xmm1, xmm3 ;33 32 31 30 23 22 21 20 movdqa xmm2, xmm0 punpckldq xmm0, xmm1 ;23 22 03 02 21 20 01 00 punpckhdq xmm2, xmm1 ;33 32 13 12 31 30 11 10 movdqa xmm1, xmm0 punpckldq xmm0, xmm2 ;31 21 30 20 11 10 01 00 pshufhw xmm1, xmm1, 0b1h ;22 23 02 03 xx xx xx xx pshufhw xmm2, xmm2, 0b1h ;32 33 12 13 xx xx xx xx punpckhdq xmm1, xmm2 ;32 33 22 23 12 13 02 03 movdqa xmm3, xmm0 paddw xmm0, xmm1 ;b1 a1 b1 a1 b1 a1 b1 a1 psubw xmm3, xmm1 ;c1 d1 c1 d1 c1 d1 c1 d1 psllw xmm0, 3 ;b1 <<= 3 a1 <<= 3 psllw xmm3, 3 ;c1 <<= 3 d1 <<= 3 movdqa xmm1, xmm0 pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 movdqa xmm4, xmm3 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)];d1*2217 - c1*5352 paddd xmm3, XMMWORD PTR[GLOBAL(_14500)] paddd xmm4, XMMWORD PTR[GLOBAL(_7500)] psrad xmm3, 12 ;(c1 * 2217 + d1 * 5352 + 14500)>>12 psrad xmm4, 12 ;(d1 * 2217 - c1 * 5352 + 7500)>>12 packssdw xmm0, xmm1 ;op[2] op[0] packssdw xmm3, xmm4 ;op[3] op[1] ; 23 22 21 20 03 02 01 00 ; ; 33 32 31 30 13 12 11 10 ; movdqa xmm2, xmm0 punpcklqdq xmm0, xmm3 ;13 12 11 10 03 02 01 00 punpckhqdq xmm2, xmm3 ;23 22 21 20 33 32 31 30 movdqa xmm3, xmm0 punpcklwd xmm0, xmm2 ;32 30 22 20 12 10 02 00 punpckhwd xmm3, xmm2 ;33 31 23 21 13 11 03 01 movdqa xmm2, xmm0 punpcklwd xmm0, xmm3 ;13 12 11 10 03 02 01 00 punpckhwd xmm2, xmm3 ;33 32 31 30 23 22 21 20 movdqa xmm5, XMMWORD PTR[GLOBAL(_7)] pshufd xmm2, xmm2, 04eh movdqa xmm3, xmm0 paddw xmm0, xmm2 ;b1 b1 b1 b1 a1 a1 a1 a1 psubw xmm3, xmm2 ;c1 c1 c1 c1 d1 d1 d1 d1 pshufd xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 b1 a1 a1 movdqa xmm2, xmm3 ;save d1 for compare pshufd xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 c1 d1 d1 pshuflw xmm0, xmm0, 0d8h ;b1 b1 a1 a1 b1 a1 b1 a1 pshuflw xmm3, xmm3, 0d8h ;c1 c1 d1 d1 c1 d1 c1 d1 pshufhw xmm0, xmm0, 0d8h ;b1 a1 b1 a1 b1 a1 b1 a1 pshufhw xmm3, xmm3, 0d8h ;c1 d1 c1 d1 c1 d1 c1 d1 movdqa xmm1, xmm0 pmaddwd xmm0, XMMWORD PTR[GLOBAL(_mult_add)] ;a1 + b1 pmaddwd xmm1, XMMWORD PTR[GLOBAL(_mult_sub)] ;a1 - b1 pxor xmm4, xmm4 ;zero out for compare paddd xmm0, xmm5 paddd xmm1, xmm5 pcmpeqw xmm2, xmm4 psrad xmm0, 4 ;(a1 + b1 + 7)>>4 psrad xmm1, 4 ;(a1 - b1 + 7)>>4 pandn xmm2, XMMWORD PTR[GLOBAL(_cmp_mask)] ;clear upper, ;and keep bit 0 of lower movdqa xmm4, xmm3 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_5352_2217)] ;c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL(_2217_neg5352)] ;d1*2217 - c1*5352 paddd xmm3, XMMWORD PTR[GLOBAL(_12000)] paddd xmm4, XMMWORD PTR[GLOBAL(_51000)] packssdw xmm0, xmm1 ;op[8] op[0] psrad xmm3, 16 ;(c1 * 2217 + d1 * 5352 + 12000)>>16 psrad xmm4, 16 ;(d1 * 2217 - c1 * 5352 + 51000)>>16 packssdw xmm3, xmm4 ;op[12] op[4] movdqa xmm1, xmm0 paddw xmm3, xmm2 ;op[4] += (d1!=0) punpcklqdq xmm0, xmm3 ;op[4] op[0] punpckhqdq xmm1, xmm3 ;op[12] op[8] movdqa XMMWORD PTR[output + 0], xmm0 movdqa XMMWORD PTR[output + 16], xmm1 STACK_FRAME_DESTROY ;void vp8_short_fdct8x4_sse2(short *input, short *output, int pitch) global sym(vp8_short_fdct8x4_sse2) PRIVATE sym(vp8_short_fdct8x4_sse2): STACK_FRAME_CREATE ; read the input data movdqa xmm0, [input ] movdqa xmm2, [input+ pitch] lea input, [input+2*pitch] movdqa xmm4, [input ] movdqa xmm3, [input+ pitch] ; transpose for the first stage movdqa xmm1, xmm0 ; 00 01 02 03 04 05 06 07 movdqa xmm5, xmm4 ; 20 21 22 23 24 25 26 27 punpcklwd xmm0, xmm2 ; 00 10 01 11 02 12 03 13 punpckhwd xmm1, xmm2 ; 04 14 05 15 06 16 07 17 punpcklwd xmm4, xmm3 ; 20 30 21 31 22 32 23 33 punpckhwd xmm5, xmm3 ; 24 34 25 35 26 36 27 37 movdqa xmm2, xmm0 ; 00 10 01 11 02 12 03 13 punpckldq xmm0, xmm4 ; 00 10 20 30 01 11 21 31 punpckhdq xmm2, xmm4 ; 02 12 22 32 03 13 23 33 movdqa xmm4, xmm1 ; 04 14 05 15 06 16 07 17 punpckldq xmm4, xmm5 ; 04 14 24 34 05 15 25 35 punpckhdq xmm1, xmm5 ; 06 16 26 36 07 17 27 37 movdqa xmm3, xmm2 ; 02 12 22 32 03 13 23 33 punpckhqdq xmm3, xmm1 ; 03 13 23 33 07 17 27 37 punpcklqdq xmm2, xmm1 ; 02 12 22 32 06 16 26 36 movdqa xmm1, xmm0 ; 00 10 20 30 01 11 21 31 punpcklqdq xmm0, xmm4 ; 00 10 20 30 04 14 24 34 punpckhqdq xmm1, xmm4 ; 01 11 21 32 05 15 25 35 ; xmm0 0 ; xmm1 1 ; xmm2 2 ; xmm3 3 ; first stage movdqa xmm5, xmm0 movdqa xmm4, xmm1 paddw xmm0, xmm3 ; a1 = 0 + 3 paddw xmm1, xmm2 ; b1 = 1 + 2 psubw xmm4, xmm2 ; c1 = 1 - 2 psubw xmm5, xmm3 ; d1 = 0 - 3 psllw xmm5, 3 psllw xmm4, 3 psllw xmm0, 3 psllw xmm1, 3 ; output 0 and 2 movdqa xmm2, xmm0 ; a1 paddw xmm0, xmm1 ; op[0] = a1 + b1 psubw xmm2, xmm1 ; op[2] = a1 - b1 ; output 1 and 3 ; interleave c1, d1 movdqa xmm1, xmm5 ; d1 punpcklwd xmm1, xmm4 ; c1 d1 punpckhwd xmm5, xmm4 ; c1 d1 movdqa xmm3, xmm1 movdqa xmm4, xmm5 pmaddwd xmm1, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 pmaddwd xmm5, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 paddd xmm1, XMMWORD PTR[GLOBAL(_14500)] paddd xmm4, XMMWORD PTR[GLOBAL(_14500)] paddd xmm3, XMMWORD PTR[GLOBAL(_7500)] paddd xmm5, XMMWORD PTR[GLOBAL(_7500)] psrad xmm1, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 psrad xmm4, 12 ; (c1 * 2217 + d1 * 5352 + 14500)>>12 psrad xmm3, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 psrad xmm5, 12 ; (d1 * 2217 - c1 * 5352 + 7500)>>12 packssdw xmm1, xmm4 ; op[1] packssdw xmm3, xmm5 ; op[3] ; done with vertical ; transpose for the second stage movdqa xmm4, xmm0 ; 00 10 20 30 04 14 24 34 movdqa xmm5, xmm2 ; 02 12 22 32 06 16 26 36 punpcklwd xmm0, xmm1 ; 00 01 10 11 20 21 30 31 punpckhwd xmm4, xmm1 ; 04 05 14 15 24 25 34 35 punpcklwd xmm2, xmm3 ; 02 03 12 13 22 23 32 33 punpckhwd xmm5, xmm3 ; 06 07 16 17 26 27 36 37 movdqa xmm1, xmm0 ; 00 01 10 11 20 21 30 31 punpckldq xmm0, xmm2 ; 00 01 02 03 10 11 12 13 punpckhdq xmm1, xmm2 ; 20 21 22 23 30 31 32 33 movdqa xmm2, xmm4 ; 04 05 14 15 24 25 34 35 punpckldq xmm2, xmm5 ; 04 05 06 07 14 15 16 17 punpckhdq xmm4, xmm5 ; 24 25 26 27 34 35 36 37 movdqa xmm3, xmm1 ; 20 21 22 23 30 31 32 33 punpckhqdq xmm3, xmm4 ; 30 31 32 33 34 35 36 37 punpcklqdq xmm1, xmm4 ; 20 21 22 23 24 25 26 27 movdqa xmm4, xmm0 ; 00 01 02 03 10 11 12 13 punpcklqdq xmm0, xmm2 ; 00 01 02 03 04 05 06 07 punpckhqdq xmm4, xmm2 ; 10 11 12 13 14 15 16 17 ; xmm0 0 ; xmm1 4 ; xmm2 1 ; xmm3 3 movdqa xmm5, xmm0 movdqa xmm2, xmm1 paddw xmm0, xmm3 ; a1 = 0 + 3 paddw xmm1, xmm4 ; b1 = 1 + 2 psubw xmm4, xmm2 ; c1 = 1 - 2 psubw xmm5, xmm3 ; d1 = 0 - 3 pxor xmm6, xmm6 ; zero out for compare pcmpeqw xmm6, xmm5 ; d1 != 0 pandn xmm6, XMMWORD PTR[GLOBAL(_cmp_mask8x4)] ; clear upper, ; and keep bit 0 of lower ; output 0 and 2 movdqa xmm2, xmm0 ; a1 paddw xmm0, xmm1 ; a1 + b1 psubw xmm2, xmm1 ; a1 - b1 paddw xmm0, XMMWORD PTR[GLOBAL(_7w)] paddw xmm2, XMMWORD PTR[GLOBAL(_7w)] psraw xmm0, 4 ; op[0] = (a1 + b1 + 7)>>4 psraw xmm2, 4 ; op[8] = (a1 - b1 + 7)>>4 ; output 1 and 3 ; interleave c1, d1 movdqa xmm1, xmm5 ; d1 punpcklwd xmm1, xmm4 ; c1 d1 punpckhwd xmm5, xmm4 ; c1 d1 movdqa xmm3, xmm1 movdqa xmm4, xmm5 pmaddwd xmm1, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm4, XMMWORD PTR[GLOBAL (_5352_2217)] ; c1*2217 + d1*5352 pmaddwd xmm3, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 pmaddwd xmm5, XMMWORD PTR[GLOBAL(_2217_neg5352)] ; d1*2217 - c1*5352 paddd xmm1, XMMWORD PTR[GLOBAL(_12000)] paddd xmm4, XMMWORD PTR[GLOBAL(_12000)] paddd xmm3, XMMWORD PTR[GLOBAL(_51000)] paddd xmm5, XMMWORD PTR[GLOBAL(_51000)] psrad xmm1, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 psrad xmm4, 16 ; (c1 * 2217 + d1 * 5352 + 14500)>>16 psrad xmm3, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 psrad xmm5, 16 ; (d1 * 2217 - c1 * 5352 + 7500)>>16 packssdw xmm1, xmm4 ; op[4] packssdw xmm3, xmm5 ; op[12] paddw xmm1, xmm6 ; op[4] += (d1!=0) movdqa xmm4, xmm0 movdqa xmm5, xmm2 punpcklqdq xmm0, xmm1 punpckhqdq xmm4, xmm1 punpcklqdq xmm2, xmm3 punpckhqdq xmm5, xmm3 movdqa XMMWORD PTR[output + 0 ], xmm0 movdqa XMMWORD PTR[output + 16], xmm2 movdqa XMMWORD PTR[output + 32], xmm4 movdqa XMMWORD PTR[output + 48], xmm5 STACK_FRAME_DESTROY SECTION_RODATA align 16 _5352_2217: dw 5352 dw 2217 dw 5352 dw 2217 dw 5352 dw 2217 dw 5352 dw 2217 align 16 _2217_neg5352: dw 2217 dw -5352 dw 2217 dw -5352 dw 2217 dw -5352 dw 2217 dw -5352 align 16 _mult_add: times 8 dw 1 align 16 _cmp_mask: times 4 dw 1 times 4 dw 0 align 16 _cmp_mask8x4: times 8 dw 1 align 16 _mult_sub: dw 1 dw -1 dw 1 dw -1 dw 1 dw -1 dw 1 dw -1 align 16 _7: times 4 dd 7 align 16 _7w: times 8 dw 7 align 16 _14500: times 4 dd 14500 align 16 _7500: times 4 dd 7500 align 16 _12000: times 4 dd 12000 align 16 _51000: times 4 dd 51000
artclarke/humble-video
humble-video-captive/src/main/gnu/libvpx/csrc/vp8/encoder/x86/dct_sse2.asm
Assembly
agpl-3.0
15,141
(function($) { $.fn.tweet = function(o){ var s = $.extend({ username: ["seaofclouds"], // [string] required, unless you want to display our tweets. :) it can be an array, just do ["username1","username2","etc"] list: null, // [string] optional name of list belonging to username favorites: false, // [boolean] display the user's favorites instead of his tweets avatar_size: null, // [integer] height and width of avatar if displayed (48px max) count: 3, // [integer] how many tweets to display? fetch: null, // [integer] how many tweets to fetch via the API (set this higher than 'count' if using the 'filter' option) retweets: true, // [boolean] whether to show retweets (not supported in all display modes) intro_text: null, // [string] do you want text BEFORE your your tweets? outro_text: null, // [string] do you want text AFTER your tweets? join_text: null, // [string] optional text in between date and tweet, try setting to "auto" auto_join_text_default: "i said,", // [string] auto text for non verb: "i said" bullocks auto_join_text_ed: "i", // [string] auto text for past tense: "i" surfed auto_join_text_ing: "i am", // [string] auto tense for present tense: "i was" surfing auto_join_text_reply: "i replied to", // [string] auto tense for replies: "i replied to" @someone "with" auto_join_text_url: "i was looking at", // [string] auto tense for urls: "i was looking at" http:... loading_text: null, // [string] optional loading text, displayed while tweets load query: null, // [string] optional search query refresh_interval: null , // [integer] optional number of seconds after which to reload tweets twitter_url: "twitter.com", // [string] custom twitter url, if any (apigee, etc.) twitter_api_url: "api.twitter.com", // [string] custom twitter api url, if any (apigee, etc.) twitter_search_url: "search.twitter.com", // [string] custom twitter search url, if any (apigee, etc.) template: "{avatar}{time}{join}{text}", // [string or function] template used to construct each tweet <li> - see code for available vars comparator: function(tweet1, tweet2) { // [function] comparator used to sort tweets (see Array.sort) return tweet2["tweet_time"] - tweet1["tweet_time"]; }, filter: function(tweet) { // [function] whether or not to include a particular tweet (be sure to also set 'fetch') return true; } }, o); $.fn.extend({ linkUrl: function() { var returning = []; // See http://daringfireball.net/2010/07/improved_regex_for_matching_urls var regexp = /\b((?:[a-z][\w-]+:(?:\/{1,3}|[a-z0-9%])|www\d{0,3}[.]|[a-z0-9.\-]+[.][a-z]{2,4}\/)(?:[^\s()<>]+|\(([^\s()<>]+|(\([^\s()<>]+\)))*\))+(?:\(([^\s()<>]+|(\([^\s()<>]+\)))*\)|[^\s`!()\[\]{};:'".,<>?«»“”‘’]))/gi; this.each(function() { returning.push(this.replace(regexp, function(match) { var url = (/^[a-z]+:/i).test(match) ? match : "http://"+match; return "<a href=\""+url+"\">"+match+"</a>"; })); }); return $(returning); }, linkUser: function() { var returning = []; var regexp = /[\@]+([A-Za-z0-9-_]+)/gi; this.each(function() { returning.push(this.replace(regexp,"<a href=\"http://"+s.twitter_url+"/$1\">@$1</a>")); }); return $(returning); }, linkHash: function() { var returning = []; var regexp = /(?:^| )[\#]+([A-Za-z0-9-_]+)/gi; this.each(function() { returning.push(this.replace(regexp, ' <a href="http://'+s.twitter_search_url+'/search?q=&tag=$1&lang=all&from='+s.username.join("%2BOR%2B")+'">#$1</a>')); }); return $(returning); }, capAwesome: function() { var returning = []; this.each(function() { returning.push(this.replace(/\b(awesome)\b/gi, '<span class="awesome">$1</span>')); }); return $(returning); }, capEpic: function() { var returning = []; this.each(function() { returning.push(this.replace(/\b(epic)\b/gi, '<span class="epic">$1</span>')); }); return $(returning); }, makeHeart: function() { var returning = []; this.each(function() { returning.push(this.replace(/(&lt;)+[3]/gi, "<tt class='heart'>&#x2665;</tt>")); }); return $(returning); } }); function parse_date(date_str) { // The non-search twitter APIs return inconsistently-formatted dates, which Date.parse // cannot handle in IE. We therefore perform the following transformation: // "Wed Apr 29 08:53:31 +0000 2009" => "Wed, Apr 29 2009 08:53:31 +0000" return Date.parse(date_str.replace(/^([a-z]{3})( [a-z]{3} \d\d?)(.*)( \d{4})$/i, '$1,$2$4$3')); } function relative_time(date) { var relative_to = (arguments.length > 1) ? arguments[1] : new Date(); var delta = parseInt((relative_to.getTime() - date) / 1000, 10); var r = ''; if (delta < 60) { r = delta + ' seconds ago'; } else if(delta < 120) { r = 'a minute ago'; } else if(delta < (45*60)) { r = (parseInt(delta / 60, 10)).toString() + ' minutes ago'; } else if(delta < (2*60*60)) { r = 'an hour ago'; } else if(delta < (24*60*60)) { r = '' + (parseInt(delta / 3600, 10)).toString() + ' hours ago'; } else if(delta < (48*60*60)) { r = 'a day ago'; } else { r = (parseInt(delta / 86400, 10)).toString() + ' days ago'; } return 'about ' + r; } function build_url() { var proto = ('https:' == document.location.protocol ? 'https:' : 'http:'); var count = (s.fetch === null) ? s.count : s.fetch; if (s.list) { return proto+"//"+s.twitter_api_url+"/1/"+s.username[0]+"/lists/"+s.list+"/statuses.json?per_page="+count+"&callback=?"; } else if (s.favorites) { return proto+"//"+s.twitter_api_url+"/favorites/"+s.username[0]+".json?count="+s.count+"&callback=?"; } else if (s.query === null && s.username.length == 1) { return proto+'//'+s.twitter_api_url+'/1/statuses/user_timeline.json?screen_name='+s.username[0]+'&count='+count+(s.retweets ? '&include_rts=1' : '')+'&callback=?'; } else { var query = (s.query || 'from:'+s.username.join(' OR from:')); return proto+'//'+s.twitter_search_url+'/search.json?&q='+encodeURIComponent(query)+'&rpp='+count+'&callback=?'; } } return this.each(function(i, widget){ var list = $('<ul class="tweet_list">').appendTo(widget); var intro = '<p class="tweet_intro">'+s.intro_text+'</p>'; var outro = '<p class="tweet_outro">'+s.outro_text+'</p>'; var loading = $('<p class="loading">'+s.loading_text+'</p>'); if(typeof(s.username) == "string"){ s.username = [s.username]; } var expand_template = function(info) { if (typeof s.template === "string") { var result = s.template; for(var key in info) result = result.replace(new RegExp('{'+key+'}','g'), info[key]); return result; } else return s.template(info); }; if (s.loading_text) $(widget).append(loading); $(widget).bind("load", function(){ $.getJSON(build_url(), function(data){ if (s.loading_text) loading.remove(); if (s.intro_text) list.before(intro); list.empty(); var tweets = $.map(data.results || data, function(item){ var join_text = s.join_text; // auto join text based on verb tense and content if (s.join_text == "auto") { if (item.text.match(/^(@([A-Za-z0-9-_]+)) .*/i)) { join_text = s.auto_join_text_reply; } else if (item.text.match(/(^\w+:\/\/[A-Za-z0-9-_]+\.[A-Za-z0-9-_:%&\?\/.=]+) .*/i)) { join_text = s.auto_join_text_url; } else if (item.text.match(/^((\w+ed)|just) .*/im)) { join_text = s.auto_join_text_ed; } else if (item.text.match(/^(\w*ing) .*/i)) { join_text = s.auto_join_text_ing; } else { join_text = s.auto_join_text_default; } } // Basic building blocks for constructing tweet <li> using a template var screen_name = item.from_user || item.user.screen_name; var source = item.source; var user_url = "http://"+s.twitter_url+"/"+screen_name; var avatar_size = s.avatar_size; var avatar_url = item.profile_image_url || item.user.profile_image_url; var tweet_url = "http://"+s.twitter_url+"/"+screen_name+"/statuses/"+item.id_str; var tweet_time = parse_date(item.created_at); var tweet_relative_time = relative_time(tweet_time); var tweet_raw_text = item.text; var tweet_text = $([tweet_raw_text]).linkUrl().linkUser().linkHash()[0]; // Default spans, and pre-formatted blocks for common layouts var user = '<a class="tweet_user" href="'+user_url+'">'+screen_name+'</a>'; var join = ((s.join_text) ? ('<span class="tweet_join"> '+join_text+' </span>') : ' '); var avatar = (avatar_size ? ('<a class="tweet_avatar" href="'+user_url+'"><img src="'+avatar_url+ '" height="'+avatar_size+'" width="'+avatar_size+ '" alt="'+screen_name+'\'s avatar" title="'+screen_name+'\'s avatar" border="0"/></a>') : ''); var time = '<span class="tweet_time"><a href="'+tweet_url+'" title="view tweet on twitter">'+tweet_relative_time+'</a></span>'; var text = '<span class="tweet_text">'+$([tweet_text]).makeHeart().capAwesome().capEpic()[0]+ '</span>'; return { item: item, // For advanced users who want to dig out other info screen_name: screen_name, user_url: user_url, avatar_size: avatar_size, avatar_url: avatar_url, source: source, tweet_url: tweet_url, tweet_time: tweet_time, tweet_relative_time: tweet_relative_time, tweet_raw_text: tweet_raw_text, tweet_text: tweet_text, user: user, join: join, avatar: avatar, time: time, text: text }; }); tweets = $.grep(tweets, s.filter).slice(0, s.count); list.append($.map(tweets.sort(s.comparator), function(t) { return "<li>" + expand_template(t) + "</li>"; }).join('')). children('li:first').addClass('tweet_first').end(). children('li:odd').addClass('tweet_even').end(). children('li:even').addClass('tweet_odd'); if (s.outro_text) list.after(outro); $(widget).trigger("loaded").trigger((tweets.length === 0 ? "empty" : "full")); if (s.refresh_interval) { window.setTimeout(function() { $(widget).trigger("load"); }, 1000 * s.refresh_interval); } }); }).trigger("load"); }); }; })(jQuery);
richhl/kalturaCE
package/app/app/api_v3/web/testme/js/jquery.tweet.js
JavaScript
agpl-3.0
12,076
<?php return array( 'a_user_canceled' => '用户已取消物品申请', 'a_user_requested' => '用户已申请物品', 'accessory_name' => '配件名称:', 'additional_notes' => '备注:', 'admin_has_created' => '管理员已在 :web 为您新增帐号。', 'asset' => '资产:', 'asset_name' => '资产名称:', 'asset_requested' => '已申请资产', 'asset_tag' => '资产标签:', 'assets_warrantee_expiring' => '{1} 资产保修将在60天内到期。|[2,Inf]资产保修将在60天内到期。', 'assigned_to' => '已分配给', 'best_regards' => '此致', 'canceled' => '已取消:', 'checkin_date' => '交回日期:', 'checkout_date' => '借出日期:', 'click_to_confirm' => '请点击链接启用您在 :web 的帐号:', 'click_on_the_link_accessory' => '请点击链接确认您已经收到配件。', 'click_on_the_link_asset' => '请点击链接确认您已经收到资产。', 'Confirm_Asset_Checkin' => '确认资产收回', 'Confirm_Accessory_Checkin' => '确认配件收回', 'Confirm_accessory_delivery' => '确认配件交付。', 'Confirm_asset_delivery' => '确认资产交付。', 'Confirm_consumable_delivery' => '确认耗材交付。', 'current_QTY' => '目前数量', 'Days' => '天', 'days' => '天', 'expecting_checkin_date' => '预计归还日期:', 'expires' => '过期', 'Expiring_Assets_Report' => '过期资产报告', 'Expiring_Licenses_Report' => '过期许可证报告', 'hello' => '您好', 'hi' => '您好', 'i_have_read' => '我同意使用条款并确认已收到物品。', 'item' => '项目:', 'items_below_minimum' => '{1} 数量已低于最小库存量,或即将低于最小库存量。|[2,Inf] 数量已低于最小库存量,或即将低于最小库存量', 'Item_Request_Canceled' => '已取消申领物品', 'Item_Requested' => '已申领物品', 'licenses_expiring' => '{1} 许可证将在60天内到期。|[2,Inf] 许可证将在60天内到期。', 'link_to_update_password' => '请点击以下链接以更新 :web 的密码:', 'login_first_admin' => '请使用以下凭据登录新安装的 Snipe-IT:', 'login' => '登录:', 'Low_Inventory_Report' => '低库存报告', 'min_QTY' => '最小数量', 'name' => '名字', 'new_item_checked' => '一项新物品已分配至您的名下,详细信息如下。', 'password' => '密码', 'password_reset' => '密码重置', 'read_the_terms' => '请阅读以下使用条款', 'read_the_terms_and_click' => '请阅读使用条款,点击下方链接确认您已阅读并同意使用条款,并已收到资产。', 'requested' => '已申请', 'reset_link' => '您的密码重置链接', 'reset_password' => '请点击重置您的密码', 'serial' => '序列号', 'supplier' => '供应商', 'tag' => '标签', 'test_email' => 'Snipe-IT 测试邮件', 'test_mail_text' => '这是一封 Snipe-IT 资产管理系统的测试电子邮件,如果您收到,表示邮件通知正常运作 :)', 'the_following_item' => '以下项目已交回:', 'There_are' => '{1} 这|[2,Inf] 这些', 'to_reset' => '要重置 :web 的密码,请完成此表格:', 'type' => '类型', 'user' => '用户:', 'username' => '用户名:', 'welcome' => '欢迎您,:name', 'welcome_to' => '欢迎来到 :web!', 'your_credentials' => '您的 Snipe-IT 登录凭据', );
kpawelski/ITManager
resources/lang/zh-CN/mail.php
PHP
agpl-3.0
3,541
package com.android.uiautomator; class UiAutomatorViewer { class AttributeTableEditingSupport { int mViewer; } int mDy; int mDx; int mScale; int mTableViewer; int mToggleNafAction; int mScreenshotAction; int mExpandAllAction; int mOpenFilesAction; int mTreeViewer; int mScreenshotCanvas; int IMG_BORDER; } class UiAutomatorModel { class MinAreaFindNodeListener { int mNode; } int mShowNafNodes; int mExploreMode; int mNafNodes; int mCurrentDrawingRect; int mSelectedNode; int mRootNode; int mScreenshot; int mView; int mXmlDumpFile; int mScreenshotFile; int inst; } class OpenDialog { int mOkButton; int mFileChanged; int mXmlDumpFile; int mScreenshotFile; int mXmlText; int mScreenshotText; int DEFAULT_LAYOUT_SPACING; int FIXED_TEXT_FIELD_WIDTH; }
mutantzombie/pfff
data/java_stdlib/android/com.android.uiautomator.java
Java
lgpl-2.1
826
/* GStreamer * Copyright (C) <1999> Erik Walthinsen <omega@cse.ogi.edu> * Copyright (C) <2004> Jan Schmidt <thaytan@mad.scientist.com> * Copyright (C) <2004> Tim-Philipp Mueller <t.i.m@orange.net> * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include "config.h" #endif #include <pixbufscale.h> #include <gst/video/video.h> #include <gdk-pixbuf/gdk-pixbuf.h> #define ROUND_UP_2(x) (((x)+1)&~1) #define ROUND_UP_4(x) (((x)+3)&~3) #define ROUND_UP_8(x) (((x)+7)&~7) /* These match the ones gstffmpegcolorspace uses (Tim) */ #define GST_RGB24_ROWSTRIDE(width) (ROUND_UP_4 ((width)*3)) #define GST_RGB24_SIZE(width,height) ((height)*GST_RGB24_ROWSTRIDE(width)) GST_DEBUG_CATEGORY_STATIC (pixbufscale_debug); #define GST_CAT_DEFAULT pixbufscale_debug /* GstPixbufScale signals and args */ enum { /* FILL ME */ LAST_SIGNAL }; enum { ARG_0, ARG_METHOD /* FILL ME */ }; static GstStaticPadTemplate gst_pixbufscale_src_template = GST_STATIC_PAD_TEMPLATE ("src", GST_PAD_SRC, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB) ); static GstStaticPadTemplate gst_pixbufscale_sink_template = GST_STATIC_PAD_TEMPLATE ("sink", GST_PAD_SINK, GST_PAD_ALWAYS, GST_STATIC_CAPS (GST_VIDEO_CAPS_RGB) ); #define GST_TYPE_PIXBUFSCALE_METHOD (gst_pixbufscale_method_get_type()) static GType gst_pixbufscale_method_get_type (void) { static GType pixbufscale_method_type = 0; static const GEnumValue pixbufscale_methods[] = { {GST_PIXBUFSCALE_NEAREST, "0", "Nearest Neighbour"}, {GST_PIXBUFSCALE_TILES, "1", "Tiles"}, {GST_PIXBUFSCALE_BILINEAR, "2", "Bilinear"}, {GST_PIXBUFSCALE_HYPER, "3", "Hyper"}, {0, NULL, NULL}, }; if (!pixbufscale_method_type) { pixbufscale_method_type = g_enum_register_static ("GstPixbufScaleMethod", pixbufscale_methods); } return pixbufscale_method_type; } static void gst_pixbufscale_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec); static void gst_pixbufscale_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec); static GstCaps *gst_pixbufscale_transform_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps); static gboolean gst_pixbufscale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out); static gboolean gst_pixbufscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps, guint * size); static void gst_pixbufscale_fixate_caps (GstBaseTransform * base, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps); static GstFlowReturn gst_pixbufscale_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out); static gboolean gst_pixbufscale_handle_src_event (GstPad * pad, GstEvent * event); static gboolean parse_caps (GstCaps * caps, gint * width, gint * height); GST_BOILERPLATE (GstPixbufScale, gst_pixbufscale, GstBaseTransform, GST_TYPE_BASE_TRANSFORM); static void gst_pixbufscale_base_init (gpointer g_class) { GstElementClass *element_class = GST_ELEMENT_CLASS (g_class); gst_element_class_set_details_simple (element_class, "GdkPixbuf image scaler", "Filter/Effect/Video", "Resizes video", "Jan Schmidt <thaytan@mad.scientist.com>, " "Wim Taymans <wim.taymans@chello.be>, " "Renato Filho <renato.filho@indt.org.br>"); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_pixbufscale_src_template)); gst_element_class_add_pad_template (element_class, gst_static_pad_template_get (&gst_pixbufscale_sink_template)); } static void gst_pixbufscale_class_init (GstPixbufScaleClass * klass) { GObjectClass *gobject_class; GstBaseTransformClass *trans_class; gobject_class = (GObjectClass *) klass; trans_class = (GstBaseTransformClass *) klass; gobject_class->set_property = gst_pixbufscale_set_property; gobject_class->get_property = gst_pixbufscale_get_property; g_object_class_install_property (gobject_class, ARG_METHOD, g_param_spec_enum ("method", "method", "method", GST_TYPE_PIXBUFSCALE_METHOD, GST_PIXBUFSCALE_BILINEAR, G_PARAM_READWRITE | G_PARAM_STATIC_STRINGS)); trans_class->transform_caps = GST_DEBUG_FUNCPTR (gst_pixbufscale_transform_caps); trans_class->set_caps = GST_DEBUG_FUNCPTR (gst_pixbufscale_set_caps); trans_class->get_unit_size = GST_DEBUG_FUNCPTR (gst_pixbufscale_get_unit_size); trans_class->transform = GST_DEBUG_FUNCPTR (gst_pixbufscale_transform); trans_class->fixate_caps = GST_DEBUG_FUNCPTR (gst_pixbufscale_fixate_caps); trans_class->passthrough_on_same_caps = TRUE; parent_class = g_type_class_peek_parent (klass); } static void gst_pixbufscale_init (GstPixbufScale * pixbufscale, GstPixbufScaleClass * kclass) { GstBaseTransform *trans; GST_DEBUG_OBJECT (pixbufscale, "_init"); trans = GST_BASE_TRANSFORM (pixbufscale); gst_pad_set_event_function (trans->srcpad, gst_pixbufscale_handle_src_event); pixbufscale->method = GST_PIXBUFSCALE_TILES; pixbufscale->gdk_method = GDK_INTERP_TILES; } static void gst_pixbufscale_set_property (GObject * object, guint prop_id, const GValue * value, GParamSpec * pspec) { GstPixbufScale *src; g_return_if_fail (GST_IS_PIXBUFSCALE (object)); src = GST_PIXBUFSCALE (object); switch (prop_id) { case ARG_METHOD: src->method = g_value_get_enum (value); switch (src->method) { case GST_PIXBUFSCALE_NEAREST: src->gdk_method = GDK_INTERP_NEAREST; break; case GST_PIXBUFSCALE_TILES: src->gdk_method = GDK_INTERP_TILES; break; case GST_PIXBUFSCALE_BILINEAR: src->gdk_method = GDK_INTERP_BILINEAR; break; case GST_PIXBUFSCALE_HYPER: src->gdk_method = GDK_INTERP_HYPER; break; } break; default: break; } } static void gst_pixbufscale_get_property (GObject * object, guint prop_id, GValue * value, GParamSpec * pspec) { GstPixbufScale *src; g_return_if_fail (GST_IS_PIXBUFSCALE (object)); src = GST_PIXBUFSCALE (object); switch (prop_id) { case ARG_METHOD: g_value_set_enum (value, src->method); break; default: G_OBJECT_WARN_INVALID_PROPERTY_ID (object, prop_id, pspec); break; } } static GstCaps * gst_pixbufscale_transform_caps (GstBaseTransform * trans, GstPadDirection direction, GstCaps * caps) { GstCaps *ret; int i; ret = gst_caps_copy (caps); for (i = 0; i < gst_caps_get_size (ret); i++) { GstStructure *structure = gst_caps_get_structure (ret, i); gst_structure_set (structure, "width", GST_TYPE_INT_RANGE, 16, 4096, "height", GST_TYPE_INT_RANGE, 16, 4096, NULL); gst_structure_remove_field (structure, "pixel-aspect-ratio"); } GST_DEBUG_OBJECT (trans, "returning caps: %" GST_PTR_FORMAT, ret); return ret; } static gboolean parse_caps (GstCaps * caps, gint * width, gint * height) { gboolean ret; GstStructure *structure; structure = gst_caps_get_structure (caps, 0); ret = gst_structure_get_int (structure, "width", width); ret &= gst_structure_get_int (structure, "height", height); return ret; } static gboolean gst_pixbufscale_set_caps (GstBaseTransform * trans, GstCaps * in, GstCaps * out) { GstPixbufScale *pixbufscale; gboolean ret; pixbufscale = GST_PIXBUFSCALE (trans); ret = parse_caps (in, &pixbufscale->from_width, &pixbufscale->from_height); ret &= parse_caps (out, &pixbufscale->to_width, &pixbufscale->to_height); if (!ret) goto done; pixbufscale->from_stride = GST_ROUND_UP_4 (pixbufscale->from_width * 3); pixbufscale->from_buf_size = pixbufscale->from_stride * pixbufscale->from_height; pixbufscale->to_stride = GST_ROUND_UP_4 (pixbufscale->to_width * 3); pixbufscale->to_buf_size = pixbufscale->to_stride * pixbufscale->to_height; GST_DEBUG_OBJECT (pixbufscale, "from=%dx%d, size %d -> to=%dx%d, size %d", pixbufscale->from_width, pixbufscale->from_height, pixbufscale->from_buf_size, pixbufscale->to_width, pixbufscale->to_height, pixbufscale->to_buf_size); done: return ret; } static gboolean gst_pixbufscale_get_unit_size (GstBaseTransform * trans, GstCaps * caps, guint * size) { gint width, height; g_assert (size); if (!parse_caps (caps, &width, &height)) return FALSE; *size = GST_ROUND_UP_4 (width * 3) * height; return TRUE; } static void gst_pixbufscale_fixate_caps (GstBaseTransform * base, GstPadDirection direction, GstCaps * caps, GstCaps * othercaps) { GstStructure *ins, *outs; const GValue *from_par, *to_par; g_return_if_fail (gst_caps_is_fixed (caps)); GST_DEBUG_OBJECT (base, "trying to fixate othercaps %" GST_PTR_FORMAT " based on caps %" GST_PTR_FORMAT, othercaps, caps); ins = gst_caps_get_structure (caps, 0); outs = gst_caps_get_structure (othercaps, 0); from_par = gst_structure_get_value (ins, "pixel-aspect-ratio"); to_par = gst_structure_get_value (outs, "pixel-aspect-ratio"); if (from_par && to_par) { GValue to_ratio = { 0, }; /* w/h of output video */ int from_w, from_h, from_par_n, from_par_d, to_par_n, to_par_d; int count = 0, w = 0, h = 0, num, den; /* if both width and height are already fixed, we can't do anything * * about it anymore */ if (gst_structure_get_int (outs, "width", &w)) ++count; if (gst_structure_get_int (outs, "height", &h)) ++count; if (count == 2) { GST_DEBUG_OBJECT (base, "dimensions already set to %dx%d, not fixating", w, h); return; } gst_structure_get_int (ins, "width", &from_w); gst_structure_get_int (ins, "height", &from_h); from_par_n = gst_value_get_fraction_numerator (from_par); from_par_d = gst_value_get_fraction_denominator (from_par); to_par_n = gst_value_get_fraction_numerator (to_par); to_par_d = gst_value_get_fraction_denominator (to_par); g_value_init (&to_ratio, GST_TYPE_FRACTION); gst_value_set_fraction (&to_ratio, from_w * from_par_n * to_par_d, from_h * from_par_d * to_par_n); num = gst_value_get_fraction_numerator (&to_ratio); den = gst_value_get_fraction_denominator (&to_ratio); GST_DEBUG_OBJECT (base, "scaling input with %dx%d and PAR %d/%d to output PAR %d/%d", from_w, from_h, from_par_n, from_par_d, to_par_n, to_par_d); GST_DEBUG_OBJECT (base, "resulting output should respect ratio of %d/%d", num, den); /* now find a width x height that respects this display ratio. * * prefer those that have one of w/h the same as the incoming video * * using wd / hd = num / den */ /* start with same height, because of interlaced video */ /* check hd / den is an integer scale factor, and scale wd with the PAR */ if (from_h % den == 0) { GST_DEBUG_OBJECT (base, "keeping video height"); h = from_h; w = h * num / den; } else if (from_w % num == 0) { GST_DEBUG_OBJECT (base, "keeping video width"); w = from_w; h = w * den / num; } else { GST_DEBUG_OBJECT (base, "approximating but keeping video height"); h = from_h; w = h * num / den; } GST_DEBUG_OBJECT (base, "scaling to %dx%d", w, h); /* now fixate */ gst_structure_fixate_field_nearest_int (outs, "width", w); gst_structure_fixate_field_nearest_int (outs, "height", h); } else { gint width, height; if (gst_structure_get_int (ins, "width", &width)) { if (gst_structure_has_field (outs, "width")) { gst_structure_fixate_field_nearest_int (outs, "width", width); } } if (gst_structure_get_int (ins, "height", &height)) { if (gst_structure_has_field (outs, "height")) { gst_structure_fixate_field_nearest_int (outs, "height", height); } } } GST_DEBUG_OBJECT (base, "fixated othercaps to %" GST_PTR_FORMAT, othercaps); } static GstFlowReturn gst_pixbufscale_transform (GstBaseTransform * trans, GstBuffer * in, GstBuffer * out) { GstPixbufScale *scale; GdkPixbuf *src_pixbuf, *dest_pixbuf; scale = GST_PIXBUFSCALE (trans); src_pixbuf = gdk_pixbuf_new_from_data (GST_BUFFER_DATA (in), GDK_COLORSPACE_RGB, FALSE, 8, scale->from_width, scale->from_height, GST_RGB24_ROWSTRIDE (scale->from_width), NULL, NULL); dest_pixbuf = gdk_pixbuf_new_from_data (GST_BUFFER_DATA (out), GDK_COLORSPACE_RGB, FALSE, 8, scale->to_width, scale->to_height, GST_RGB24_ROWSTRIDE (scale->to_width), NULL, NULL); gdk_pixbuf_scale (src_pixbuf, dest_pixbuf, 0, 0, scale->to_width, scale->to_height, 0, 0, (double) scale->to_width / scale->from_width, (double) scale->to_height / scale->from_height, scale->gdk_method); g_object_unref (src_pixbuf); g_object_unref (dest_pixbuf); return GST_FLOW_OK; } static gboolean gst_pixbufscale_handle_src_event (GstPad * pad, GstEvent * event) { GstPixbufScale *pixbufscale; gboolean ret; double a; GstStructure *structure; pixbufscale = GST_PIXBUFSCALE (gst_pad_get_parent (pad)); GST_DEBUG_OBJECT (pixbufscale, "handling %s event", GST_EVENT_TYPE_NAME (event)); switch (GST_EVENT_TYPE (event)) { case GST_EVENT_NAVIGATION: event = GST_EVENT (gst_mini_object_make_writable (GST_MINI_OBJECT (event))); structure = (GstStructure *) gst_event_get_structure (event); if (gst_structure_get_double (structure, "pointer_x", &a)) { gst_structure_set (structure, "pointer_x", G_TYPE_DOUBLE, a * pixbufscale->from_width / pixbufscale->to_width, NULL); } if (gst_structure_get_double (structure, "pointer_y", &a)) { gst_structure_set (structure, "pointer_y", G_TYPE_DOUBLE, a * pixbufscale->from_height / pixbufscale->to_height, NULL); } break; default: break; } ret = gst_pad_event_default (pad, event); gst_object_unref (pixbufscale); return ret; } gboolean pixbufscale_init (GstPlugin * plugin) { if (!gst_element_register (plugin, "gdkpixbufscale", GST_RANK_NONE, GST_TYPE_PIXBUFSCALE)) return FALSE; GST_DEBUG_CATEGORY_INIT (pixbufscale_debug, "gdkpixbufscale", 0, "pixbufscale element"); return TRUE; }
ahmedammar/platform_external_gst_plugins_good
ext/gdk_pixbuf/pixbufscale.c
C
lgpl-2.1
15,057
/**************************************************************************** ** ** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies). ** Contact: http://www.qt-project.org/legal ** ** This file is part of the examples of the Qt Toolkit. ** ** $QT_BEGIN_LICENSE:LGPL$ ** Commercial License Usage ** Licensees holding valid commercial Qt licenses may use this file in ** accordance with the commercial license agreement provided with the ** Software or, alternatively, in accordance with the terms contained in ** a written agreement between you and Digia. For licensing terms and ** conditions see http://qt.digia.com/licensing. For further information ** use the contact form at http://qt.digia.com/contact-us. ** ** GNU Lesser General Public License Usage ** Alternatively, this file may be used under the terms of the GNU Lesser ** General Public License version 2.1 as published by the Free Software ** Foundation and appearing in the file LICENSE.LGPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU Lesser General Public License version 2.1 requirements ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. ** ** In addition, as a special exception, Digia gives you certain additional ** rights. These rights are described in the Digia Qt LGPL Exception ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. ** ** GNU General Public License Usage ** Alternatively, this file may be used under the terms of the GNU ** General Public License version 3.0 as published by the Free Software ** Foundation and appearing in the file LICENSE.GPL included in the ** packaging of this file. Please review the following information to ** ensure the GNU General Public License version 3.0 requirements will be ** met: http://www.gnu.org/copyleft/gpl.html. ** ** ** $QT_END_LICENSE$ ** ****************************************************************************/ #include <QtGui> #include "finddialog.h" FindDialog::FindDialog(QWidget *parent) : QDialog(parent) { QLabel *findLabel = new QLabel(tr("Enter the name of a contact:")); lineEdit = new QLineEdit; findButton = new QPushButton(tr("&Find")); findText = ""; QHBoxLayout *layout = new QHBoxLayout; layout->addWidget(findLabel); layout->addWidget(lineEdit); layout->addWidget(findButton); setLayout(layout); setWindowTitle(tr("Find a Contact")); connect(findButton, SIGNAL(clicked()), this, SLOT(findClicked())); connect(findButton, SIGNAL(clicked()), this, SLOT(accept())); } void FindDialog::findClicked() { QString text = lineEdit->text(); if (text.isEmpty()) { QMessageBox::information(this, tr("Empty Field"), tr("Please enter a name.")); return; } else { findText = text; lineEdit->clear(); hide(); } } QString FindDialog::getFindText() { return findText; }
RLovelett/qt
examples/tutorials/addressbook/part7/finddialog.cpp
C++
lgpl-2.1
2,952
/* GStreamer * * Copyright (C) 2002 Ronald Bultje <rbultje@ronald.bitfreak.net> * 2006 Edgard Lima <edgard.lima@indt.org.br> * * v4l2_calls.c - generic V4L2 calls handling * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This library is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this library; if not, write to the * Free Software Foundation, Inc., 59 Temple Place - Suite 330, * Boston, MA 02111-1307, USA. */ #ifdef HAVE_CONFIG_H #include <config.h> #endif #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h> #include <sys/ioctl.h> #include <sys/mman.h> #include <string.h> #include <errno.h> #include <unistd.h> #ifdef __sun /* Needed on older Solaris Nevada builds (72 at least) */ #include <stropts.h> #include <sys/ioccom.h> #endif #include "v4l2_calls.h" #include "gstv4l2tuner.h" #if 0 #include "gstv4l2xoverlay.h" #endif #include "gstv4l2colorbalance.h" #include "gstv4l2src.h" #ifdef HAVE_EXPERIMENTAL #include "gstv4l2sink.h" #endif #include "gst/gst-i18n-plugin.h" /* Those are ioctl calls */ #ifndef V4L2_CID_HCENTER #define V4L2_CID_HCENTER V4L2_CID_HCENTER_DEPRECATED #endif #ifndef V4L2_CID_VCENTER #define V4L2_CID_VCENTER V4L2_CID_VCENTER_DEPRECATED #endif GST_DEBUG_CATEGORY_EXTERN (v4l2_debug); #define GST_CAT_DEFAULT v4l2_debug /****************************************************** * gst_v4l2_get_capabilities(): * get the device's capturing capabilities * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_get_capabilities (GstV4l2Object * v4l2object) { GstElement *e; e = v4l2object->element; GST_DEBUG_OBJECT (e, "getting capabilities"); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_QUERYCAP, &v4l2object->vcap) < 0) goto cap_failed; GST_LOG_OBJECT (e, "driver: '%s'", v4l2object->vcap.driver); GST_LOG_OBJECT (e, "card: '%s'", v4l2object->vcap.card); GST_LOG_OBJECT (e, "bus_info: '%s'", v4l2object->vcap.bus_info); GST_LOG_OBJECT (e, "version: %08x", v4l2object->vcap.version); GST_LOG_OBJECT (e, "capabilites: %08x", v4l2object->vcap.capabilities); return TRUE; /* ERRORS */ cap_failed: { GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, SETTINGS, (_("Error getting capabilities for device '%s': " "It isn't a v4l2 driver. Check if it is a v4l1 driver."), v4l2object->videodev), GST_ERROR_SYSTEM); return FALSE; } } /****************************************************** * gst_v4l2_empty_lists() and gst_v4l2_fill_lists(): * fill/empty the lists of enumerations * return value: TRUE on success, FALSE on error ******************************************************/ static gboolean gst_v4l2_fill_lists (GstV4l2Object * v4l2object) { gint n; GstElement *e; e = v4l2object->element; GST_DEBUG_OBJECT (e, "getting enumerations"); GST_V4L2_CHECK_OPEN (v4l2object); GST_DEBUG_OBJECT (e, " channels"); /* and now, the channels */ for (n = 0;; n++) { struct v4l2_input input; GstV4l2TunerChannel *v4l2channel; GstTunerChannel *channel; memset (&input, 0, sizeof (input)); input.index = n; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_ENUMINPUT, &input) < 0) { if (errno == EINVAL) break; /* end of enumeration */ else { GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS, (_("Failed to query attributes of input %d in device %s"), n, v4l2object->videodev), ("Failed to get %d in input enumeration for %s. (%d - %s)", n, v4l2object->videodev, errno, strerror (errno))); return FALSE; } } GST_LOG_OBJECT (e, " index: %d", input.index); GST_LOG_OBJECT (e, " name: '%s'", input.name); GST_LOG_OBJECT (e, " type: %08x", input.type); GST_LOG_OBJECT (e, " audioset: %08x", input.audioset); GST_LOG_OBJECT (e, " std: %016x", (guint) input.std); GST_LOG_OBJECT (e, " status: %08x", input.status); v4l2channel = g_object_new (GST_TYPE_V4L2_TUNER_CHANNEL, NULL); channel = GST_TUNER_CHANNEL (v4l2channel); channel->label = g_strdup ((const gchar *) input.name); channel->flags = GST_TUNER_CHANNEL_INPUT; v4l2channel->index = n; if (input.type == V4L2_INPUT_TYPE_TUNER) { struct v4l2_tuner vtun; v4l2channel->tuner = input.tuner; channel->flags |= GST_TUNER_CHANNEL_FREQUENCY; vtun.index = input.tuner; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_TUNER, &vtun) < 0) { GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS, (_("Failed to get setting of tuner %d on device '%s'."), input.tuner, v4l2object->videodev), GST_ERROR_SYSTEM); g_object_unref (G_OBJECT (channel)); return FALSE; } channel->freq_multiplicator = 62.5 * ((vtun.capability & V4L2_TUNER_CAP_LOW) ? 1 : 1000); channel->min_frequency = vtun.rangelow * channel->freq_multiplicator; channel->max_frequency = vtun.rangehigh * channel->freq_multiplicator; channel->min_signal = 0; channel->max_signal = 0xffff; } if (input.audioset) { /* we take the first. We don't care for * the others for now */ while (!(input.audioset & (1 << v4l2channel->audio))) v4l2channel->audio++; channel->flags |= GST_TUNER_CHANNEL_AUDIO; } v4l2object->channels = g_list_prepend (v4l2object->channels, (gpointer) channel); } v4l2object->channels = g_list_reverse (v4l2object->channels); GST_DEBUG_OBJECT (e, " norms"); /* norms... */ for (n = 0;; n++) { struct v4l2_standard standard = { 0, }; GstV4l2TunerNorm *v4l2norm; GstTunerNorm *norm; /* fill in defaults */ standard.frameperiod.numerator = 1; standard.frameperiod.denominator = 0; standard.index = n; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_ENUMSTD, &standard) < 0) { if (errno == EINVAL || errno == ENOTTY) break; /* end of enumeration */ else { GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS, (_("Failed to query norm on device '%s'."), v4l2object->videodev), ("Failed to get attributes for norm %d on devide '%s'. (%d - %s)", n, v4l2object->videodev, errno, strerror (errno))); return FALSE; } } GST_DEBUG_OBJECT (e, " '%s', fps: %d / %d", standard.name, standard.frameperiod.denominator, standard.frameperiod.numerator); v4l2norm = g_object_new (GST_TYPE_V4L2_TUNER_NORM, NULL); norm = GST_TUNER_NORM (v4l2norm); norm->label = g_strdup ((const gchar *) standard.name); gst_value_set_fraction (&norm->framerate, standard.frameperiod.denominator, standard.frameperiod.numerator); v4l2norm->index = standard.id; v4l2object->norms = g_list_prepend (v4l2object->norms, (gpointer) norm); } v4l2object->norms = g_list_reverse (v4l2object->norms); GST_DEBUG_OBJECT (e, " controls+menus"); /* and lastly, controls+menus (if appropriate) */ for (n = V4L2_CID_BASE;; n++) { struct v4l2_queryctrl control = { 0, }; GstV4l2ColorBalanceChannel *v4l2channel; GstColorBalanceChannel *channel; /* when we reached the last official CID, continue with private CIDs */ if (n == V4L2_CID_LASTP1) { GST_DEBUG_OBJECT (e, "checking private CIDs"); n = V4L2_CID_PRIVATE_BASE; } GST_DEBUG_OBJECT (e, "checking control %08x", n); control.id = n; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_QUERYCTRL, &control) < 0) { if (errno == EINVAL) { if (n < V4L2_CID_PRIVATE_BASE) { GST_DEBUG_OBJECT (e, "skipping control %08x", n); /* continue so that we also check private controls */ continue; } else { GST_DEBUG_OBJECT (e, "controls finished"); break; } } else { GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS, (_("Failed getting controls attributes on device '%s'."), v4l2object->videodev), ("Failed querying control %d on device '%s'. (%d - %s)", n, v4l2object->videodev, errno, strerror (errno))); return FALSE; } } if (control.flags & V4L2_CTRL_FLAG_DISABLED) { GST_DEBUG_OBJECT (e, "skipping disabled control"); continue; } switch (n) { case V4L2_CID_BRIGHTNESS: case V4L2_CID_CONTRAST: case V4L2_CID_SATURATION: case V4L2_CID_HUE: case V4L2_CID_BLACK_LEVEL: case V4L2_CID_AUTO_WHITE_BALANCE: case V4L2_CID_DO_WHITE_BALANCE: case V4L2_CID_RED_BALANCE: case V4L2_CID_BLUE_BALANCE: case V4L2_CID_GAMMA: case V4L2_CID_EXPOSURE: case V4L2_CID_AUTOGAIN: case V4L2_CID_GAIN: #ifdef V4L2_CID_SHARPNESS case V4L2_CID_SHARPNESS: #endif /* we only handle these for now (why?) */ break; case V4L2_CID_HFLIP: case V4L2_CID_VFLIP: case V4L2_CID_HCENTER: case V4L2_CID_VCENTER: #ifdef V4L2_CID_PAN_RESET case V4L2_CID_PAN_RESET: #endif #ifdef V4L2_CID_TILT_RESET case V4L2_CID_TILT_RESET: #endif /* not handled here, handled by VideoOrientation interface */ control.id++; break; case V4L2_CID_AUDIO_VOLUME: case V4L2_CID_AUDIO_BALANCE: case V4L2_CID_AUDIO_BASS: case V4L2_CID_AUDIO_TREBLE: case V4L2_CID_AUDIO_MUTE: case V4L2_CID_AUDIO_LOUDNESS: /* FIXME: We should implement GstMixer interface */ /* fall through */ default: GST_DEBUG_OBJECT (e, "ControlID %s (%x) unhandled, FIXME", control.name, n); control.id++; break; } if (n != control.id) continue; GST_DEBUG_OBJECT (e, "Adding ControlID %s (%x)", control.name, n); v4l2channel = g_object_new (GST_TYPE_V4L2_COLOR_BALANCE_CHANNEL, NULL); channel = GST_COLOR_BALANCE_CHANNEL (v4l2channel); channel->label = g_strdup ((const gchar *) control.name); v4l2channel->id = n; #if 0 /* FIXME: it will be need just when handling private controls *(currently none of base controls are of this type) */ if (control.type == V4L2_CTRL_TYPE_MENU) { struct v4l2_querymenu menu, *mptr; int i; menu.id = n; for (i = 0;; i++) { menu.index = i; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_QUERYMENU, &menu) < 0) { if (errno == EINVAL) break; /* end of enumeration */ else { GST_ELEMENT_ERROR (e, RESOURCE, SETTINGS, (_("Failed getting controls attributes on device '%s'."), v4l2object->videodev), ("Failed to get %d in menu enumeration for %s. (%d - %s)", n, v4l2object->videodev, errno, strerror (errno))); return FALSE; } } mptr = g_malloc (sizeof (menu)); memcpy (mptr, &menu, sizeof (menu)); menus = g_list_append (menus, mptr); } } v4l2object->menus = g_list_append (v4l2object->menus, menus); #endif switch (control.type) { case V4L2_CTRL_TYPE_INTEGER: channel->min_value = control.minimum; channel->max_value = control.maximum; break; case V4L2_CTRL_TYPE_BOOLEAN: channel->min_value = FALSE; channel->max_value = TRUE; break; default: /* FIXME we should find out how to handle V4L2_CTRL_TYPE_BUTTON. BUTTON controls like V4L2_CID_DO_WHITE_BALANCE can just be set (1) or unset (0), but can't be queried */ GST_DEBUG_OBJECT (e, "Control with non supported type %s (%x), type=%d", control.name, n, control.type); channel->min_value = channel->max_value = 0; break; } v4l2object->colors = g_list_prepend (v4l2object->colors, (gpointer) channel); } v4l2object->colors = g_list_reverse (v4l2object->colors); GST_DEBUG_OBJECT (e, "done"); return TRUE; } static void gst_v4l2_empty_lists (GstV4l2Object * v4l2object) { GST_DEBUG_OBJECT (v4l2object->element, "deleting enumerations"); g_list_foreach (v4l2object->channels, (GFunc) g_object_unref, NULL); g_list_free (v4l2object->channels); v4l2object->channels = NULL; g_list_foreach (v4l2object->norms, (GFunc) g_object_unref, NULL); g_list_free (v4l2object->norms); v4l2object->norms = NULL; g_list_foreach (v4l2object->colors, (GFunc) g_object_unref, NULL); g_list_free (v4l2object->colors); v4l2object->colors = NULL; } /****************************************************** * gst_v4l2_open(): * open the video device (v4l2object->videodev) * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_open (GstV4l2Object * v4l2object) { struct stat st; int libv4l2_fd; GstPollFD pollfd = GST_POLL_FD_INIT; GST_DEBUG_OBJECT (v4l2object->element, "Trying to open device %s", v4l2object->videodev); GST_V4L2_CHECK_NOT_OPEN (v4l2object); GST_V4L2_CHECK_NOT_ACTIVE (v4l2object); /* be sure we have a device */ if (!v4l2object->videodev) v4l2object->videodev = g_strdup ("/dev/video"); /* check if it is a device */ if (stat (v4l2object->videodev, &st) == -1) goto stat_failed; if (!S_ISCHR (st.st_mode)) goto no_device; /* open the device */ v4l2object->video_fd = open (v4l2object->videodev, O_RDWR /* | O_NONBLOCK */ ); if (!GST_V4L2_IS_OPEN (v4l2object)) goto not_open; libv4l2_fd = v4l2_fd_open (v4l2object->video_fd, V4L2_ENABLE_ENUM_FMT_EMULATION); /* Note the v4l2_xxx functions are designed so that if they get passed an unknown fd, the will behave exactly as their regular xxx counterparts, so if v4l2_fd_open fails, we continue as normal (missing the libv4l2 custom cam format to normal formats conversion). Chances are big we will still fail then though, as normally v4l2_fd_open only fails if the device is not a v4l2 device. */ if (libv4l2_fd != -1) v4l2object->video_fd = libv4l2_fd; v4l2object->can_poll_device = TRUE; /* get capabilities, error will be posted */ if (!gst_v4l2_get_capabilities (v4l2object)) goto error; /* do we need to be a capture device? */ if (GST_IS_V4L2SRC (v4l2object->element) && !(v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_CAPTURE)) goto not_capture; #ifdef HAVE_EXPERIMENTAL if (GST_IS_V4L2SINK (v4l2object->element) && !(v4l2object->vcap.capabilities & V4L2_CAP_VIDEO_OUTPUT)) goto not_output; #endif /* create enumerations, posts errors. */ if (!gst_v4l2_fill_lists (v4l2object)) goto error; GST_INFO_OBJECT (v4l2object->element, "Opened device '%s' (%s) successfully", v4l2object->vcap.card, v4l2object->videodev); pollfd.fd = v4l2object->video_fd; gst_poll_add_fd (v4l2object->poll, &pollfd); gst_poll_fd_ctl_read (v4l2object->poll, &pollfd, TRUE); return TRUE; /* ERRORS */ stat_failed: { GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND, (_("Cannot identify device '%s'."), v4l2object->videodev), GST_ERROR_SYSTEM); goto error; } no_device: { GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND, (_("This isn't a device '%s'."), v4l2object->videodev), GST_ERROR_SYSTEM); goto error; } not_open: { GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, OPEN_READ_WRITE, (_("Could not open device '%s' for reading and writing."), v4l2object->videodev), GST_ERROR_SYSTEM); goto error; } not_capture: { GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND, (_("Device '%s' is not a capture device."), v4l2object->videodev), ("Capabilities: 0x%x", v4l2object->vcap.capabilities)); goto error; } #ifdef HAVE_EXPERIMENTAL not_output: { GST_ELEMENT_ERROR (v4l2object->element, RESOURCE, NOT_FOUND, (_("Device '%s' is not a output device."), v4l2object->videodev), ("Capabilities: 0x%x", v4l2object->vcap.capabilities)); goto error; } #endif error: { if (GST_V4L2_IS_OPEN (v4l2object)) { /* close device */ v4l2_close (v4l2object->video_fd); v4l2object->video_fd = -1; } /* empty lists */ gst_v4l2_empty_lists (v4l2object); return FALSE; } } /****************************************************** * gst_v4l2_close(): * close the video device (v4l2object->video_fd) * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_close (GstV4l2Object * v4l2object) { GstPollFD pollfd = GST_POLL_FD_INIT; GST_DEBUG_OBJECT (v4l2object->element, "Trying to close %s", v4l2object->videodev); GST_V4L2_CHECK_OPEN (v4l2object); GST_V4L2_CHECK_NOT_ACTIVE (v4l2object); /* close device */ v4l2_close (v4l2object->video_fd); pollfd.fd = v4l2object->video_fd; gst_poll_remove_fd (v4l2object->poll, &pollfd); v4l2object->video_fd = -1; /* empty lists */ gst_v4l2_empty_lists (v4l2object); return TRUE; } /****************************************************** * gst_v4l2_get_norm() * Get the norm of the current device * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_get_norm (GstV4l2Object * v4l2object, v4l2_std_id * norm) { GST_DEBUG_OBJECT (v4l2object->element, "getting norm"); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_STD, norm) < 0) goto std_failed; return TRUE; /* ERRORS */ std_failed: { GST_DEBUG ("Failed to get the current norm for device %s", v4l2object->videodev); return FALSE; } } /****************************************************** * gst_v4l2_set_norm() * Set the norm of the current device * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_set_norm (GstV4l2Object * v4l2object, v4l2_std_id norm) { GST_DEBUG_OBJECT (v4l2object->element, "trying to set norm to " "%" G_GINT64_MODIFIER "x", (guint64) norm); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_STD, &norm) < 0) goto std_failed; return TRUE; /* ERRORS */ std_failed: { GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to set norm for device '%s'."), v4l2object->videodev), GST_ERROR_SYSTEM); return FALSE; } } /****************************************************** * gst_v4l2_get_frequency(): * get the current frequency * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_get_frequency (GstV4l2Object * v4l2object, gint tunernum, gulong * frequency) { struct v4l2_frequency freq = { 0, }; GstTunerChannel *channel; GST_DEBUG_OBJECT (v4l2object->element, "getting current tuner frequency"); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; channel = gst_tuner_get_channel (GST_TUNER (v4l2object->element)); freq.tuner = tunernum; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_FREQUENCY, &freq) < 0) goto freq_failed; *frequency = freq.frequency * channel->freq_multiplicator; return TRUE; /* ERRORS */ freq_failed: { GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to get current tuner frequency for device '%s'."), v4l2object->videodev), GST_ERROR_SYSTEM); return FALSE; } } /****************************************************** * gst_v4l2_set_frequency(): * set frequency * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_set_frequency (GstV4l2Object * v4l2object, gint tunernum, gulong frequency) { struct v4l2_frequency freq = { 0, }; GstTunerChannel *channel; GST_DEBUG_OBJECT (v4l2object->element, "setting current tuner frequency to %lu", frequency); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; channel = gst_tuner_get_channel (GST_TUNER (v4l2object->element)); freq.tuner = tunernum; /* fill in type - ignore error */ v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_FREQUENCY, &freq); freq.frequency = frequency / channel->freq_multiplicator; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_FREQUENCY, &freq) < 0) goto freq_failed; return TRUE; /* ERRORS */ freq_failed: { GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to set current tuner frequency for device '%s' to %lu Hz."), v4l2object->videodev, frequency), GST_ERROR_SYSTEM); return FALSE; } } /****************************************************** * gst_v4l2_signal_strength(): * get the strength of the signal on the current input * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_signal_strength (GstV4l2Object * v4l2object, gint tunernum, gulong * signal_strength) { struct v4l2_tuner tuner = { 0, }; GST_DEBUG_OBJECT (v4l2object->element, "trying to get signal strength"); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; tuner.index = tunernum; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_TUNER, &tuner) < 0) goto tuner_failed; *signal_strength = tuner.signal; return TRUE; /* ERRORS */ tuner_failed: { GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to get signal strength for device '%s'."), v4l2object->videodev), GST_ERROR_SYSTEM); return FALSE; } } /****************************************************** * gst_v4l2_get_attribute(): * try to get the value of one specific attribute * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_get_attribute (GstV4l2Object * v4l2object, int attribute_num, int *value) { struct v4l2_control control = { 0, }; GST_DEBUG_OBJECT (v4l2object->element, "getting value of attribute %d", attribute_num); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; control.id = attribute_num; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_CTRL, &control) < 0) goto ctrl_failed; *value = control.value; return TRUE; /* ERRORS */ ctrl_failed: { GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to get value for control %d on device '%s'."), attribute_num, v4l2object->videodev), GST_ERROR_SYSTEM); return FALSE; } } /****************************************************** * gst_v4l2_set_attribute(): * try to set the value of one specific attribute * return value: TRUE on success, FALSE on error ******************************************************/ gboolean gst_v4l2_set_attribute (GstV4l2Object * v4l2object, int attribute_num, const int value) { struct v4l2_control control = { 0, }; GST_DEBUG_OBJECT (v4l2object->element, "setting value of attribute %d to %d", attribute_num, value); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; control.id = attribute_num; control.value = value; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_CTRL, &control) < 0) goto ctrl_failed; return TRUE; /* ERRORS */ ctrl_failed: { GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to set value %d for control %d on device '%s'."), value, attribute_num, v4l2object->videodev), GST_ERROR_SYSTEM); return FALSE; } } gboolean gst_v4l2_get_input (GstV4l2Object * v4l2object, gint * input) { gint n; GST_DEBUG_OBJECT (v4l2object->element, "trying to get input"); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_INPUT, &n) < 0) goto input_failed; *input = n; GST_DEBUG_OBJECT (v4l2object->element, "input: %d", n); return TRUE; /* ERRORS */ input_failed: if (v4l2object->vcap.capabilities & V4L2_CAP_TUNER) { /* only give a warning message if driver actually claims to have tuner * support */ GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to get current input on device '%s'. May be it is a radio device"), v4l2object->videodev), GST_ERROR_SYSTEM); } return FALSE; } gboolean gst_v4l2_set_input (GstV4l2Object * v4l2object, gint input) { GST_DEBUG_OBJECT (v4l2object->element, "trying to set input to %d", input); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_INPUT, &input) < 0) goto input_failed; return TRUE; /* ERRORS */ input_failed: if (v4l2object->vcap.capabilities & V4L2_CAP_TUNER) { /* only give a warning message if driver actually claims to have tuner * support */ GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to set input %d on device %s."), input, v4l2object->videodev), GST_ERROR_SYSTEM); } return FALSE; } gboolean gst_v4l2_get_output (GstV4l2Object * v4l2object, gint * output) { gint n; GST_DEBUG_OBJECT (v4l2object->element, "trying to get output"); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_G_OUTPUT, &n) < 0) goto output_failed; *output = n; GST_DEBUG_OBJECT (v4l2object->element, "output: %d", n); return TRUE; /* ERRORS */ output_failed: if (v4l2object->vcap.capabilities & V4L2_CAP_TUNER) { /* only give a warning message if driver actually claims to have tuner * support */ GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to get current output on device '%s'. May be it is a radio device"), v4l2object->videodev), GST_ERROR_SYSTEM); } return FALSE; } gboolean gst_v4l2_set_output (GstV4l2Object * v4l2object, gint output) { GST_DEBUG_OBJECT (v4l2object->element, "trying to set output to %d", output); if (!GST_V4L2_IS_OPEN (v4l2object)) return FALSE; if (v4l2_ioctl (v4l2object->video_fd, VIDIOC_S_OUTPUT, &output) < 0) goto output_failed; return TRUE; /* ERRORS */ output_failed: if (v4l2object->vcap.capabilities & V4L2_CAP_TUNER) { /* only give a warning message if driver actually claims to have tuner * support */ GST_ELEMENT_WARNING (v4l2object->element, RESOURCE, SETTINGS, (_("Failed to set output %d on device %s."), output, v4l2object->videodev), GST_ERROR_SYSTEM); } return FALSE; }
rikaunite/gst-opera_gst-plugins-good
sys/v4l2/v4l2_calls.c
C
lgpl-2.1
27,391
<?php /** * dwoo security exception class * * This software is provided 'as-is', without any express or implied warranty. * In no event will the authors be held liable for any damages arising from the use of this software. * * @author Jordi Boggiano <j.boggiano@seld.be> * @copyright Copyright (c) 2008, Jordi Boggiano * @license http://dwoo.org/LICENSE Modified BSD License * @link http://dwoo.org/ * @version 1.0.0 * @date 2008-10-23 * @package Dwoo */ class Dwoo_Security_Exception extends Dwoo_Exception { }
JojoCMS/Jojo-CMS
plugins/jojo_core/external/dwoo/Dwoo/Security/Exception.php
PHP
lgpl-2.1
573
.util-border-radius-none { -webkit-border-radius: none; -moz-border-radius: none; border-radius: none; } .util-text-ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; } .util-textHidden { text-indent: -9999px; overflow: hidden; } .axtabs-style-normal { background: #e5e5e5; color: #6e7a85; border: 1px solid #b9babc; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-style-classic { background: #536270; color: #ffffff; border: 1px solid #536270; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-style-blue { background: #4aaded; color: #ffffff; border: 1px solid #4aaded; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-style-green { background: #1dbb9a; color: #ffffff; border: 1px solid #1dbb9a; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-style-red { background: #f05353; color: #ffffff; border: 1px solid #f05353; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-style-disabled { background: #bfbfbf; color: #ffffff; border: 1px solid #bfbfbf; box-shadow: none; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-event-normal { background: #e5e5e5; color: #6e7a85; border: 1px solid #b9babc; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-event-normal:hover, .axtabs-event-normal:focus { background: #cacaca; border: 1px solid #b9babc; } .axtabs-event-normal:active { box-shadow: none; } .axtabs-event-normal.on { text-shadow: none; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .axtabs-event-classic { background: #536270; color: #ffffff; border: 1px solid #536270; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-event-classic:hover, .axtabs-event-classic:focus { background: #495764; border: 1px solid #536270; } .axtabs-event-classic:active { box-shadow: none; } .axtabs-event-classic.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .axtabs-event-blue { background: #4aaded; color: #ffffff; border: 1px solid #4aaded; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-event-blue:hover, .axtabs-event-blue:focus { background: #338fcc; border: 1px solid #4aaded; } .axtabs-event-blue:active { box-shadow: none; } .axtabs-event-blue.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .axtabs-event-green { background: #1dbb9a; color: #ffffff; border: 1px solid #1dbb9a; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-event-green:hover, .axtabs-event-green:focus { background: #179e82; border: 1px solid #1dbb9a; } .axtabs-event-green:active { box-shadow: none; } .axtabs-event-green.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .axtabs-event-red { background: #f05353; color: #ffffff; border: 1px solid #f05353; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-event-red:hover, .axtabs-event-red:focus { background: #d24545; border: 1px solid #f05353; } .axtabs-event-red:active { box-shadow: none; } .axtabs-event-red.on { text-shadow: none; color: #6e7a85; background: #fff; border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .axtabs-event-disabled { background: #bfbfbf; color: #ffffff; border: 1px solid #bfbfbf; box-shadow: none; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .axtabs-event-disabled:hover, .axtabs-event-disabled:focus { background: #bfbfbf; border: 1px solid #bfbfbf; } .axtabs-event-disabled:active { box-shadow: none; } .axtabs-event-disabled.on { text-shadow: none; color: #ffffff; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #bfbfbf; border-bottom: 1px solid #fff; } .AXTabs { position: relative; min-height: 30px; overflow: hidden; box-sizing: content-box !important; } .AXTabs .AXTabsTray { background: url('images/dx-tab-bg.png'); box-sizing: content-box !important; } .AXTabs .AXTabsTray .trayScroll { position: absolute; left: 0px; top: 0px; height: 30px; box-sizing: content-box !important; } .AXTabs .AXTabsTray .AXTabSplit { display: none; } .AXTabs .AXTabsTray .AXTab { display: block; float: left; cursor: pointer; position: relative; height: 26px; min-width: 50px; padding: 0px 10px; box-sizing: content-box !important; margin: 2px 0px 0px 2px; border-top-left-radius: 4px; border-top-right-radius: 4px; font-size: 12px; color: #6e7a86; line-height: 26px; text-align: center; text-decoration: none; outline: none; background: #e5e5e5; color: #6e7a85; border: 1px solid #b9babc; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabs .AXTabsTray .AXTab:hover, .AXTabs .AXTabsTray .AXTab:focus { background: #cacaca; border: 1px solid #b9babc; } .AXTabs .AXTabsTray .AXTab:active { box-shadow: none; } .AXTabs .AXTabsTray .AXTab.on { text-shadow: none; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabs .AXTabsTray .AXTab:first-child { margin-left: 5px; } .AXTabs .AXTabsTray .AXTab.Classic { background: #536270; color: #ffffff; border: 1px solid #536270; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabs .AXTabsTray .AXTab.Classic:hover, .AXTabs .AXTabsTray .AXTab.Classic:focus { background: #495764; border: 1px solid #536270; } .AXTabs .AXTabsTray .AXTab.Classic:active { box-shadow: none; } .AXTabs .AXTabsTray .AXTab.Classic.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabs .AXTabsTray .AXTab.Blue { background: #4aaded; color: #ffffff; border: 1px solid #4aaded; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabs .AXTabsTray .AXTab.Blue:hover, .AXTabs .AXTabsTray .AXTab.Blue:focus { background: #338fcc; border: 1px solid #4aaded; } .AXTabs .AXTabsTray .AXTab.Blue:active { box-shadow: none; } .AXTabs .AXTabsTray .AXTab.Blue.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabs .AXTabsTray .AXTab.Green { background: #1dbb9a; color: #ffffff; border: 1px solid #1dbb9a; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabs .AXTabsTray .AXTab.Green:hover, .AXTabs .AXTabsTray .AXTab.Green:focus { background: #179e82; border: 1px solid #1dbb9a; } .AXTabs .AXTabsTray .AXTab.Green:active { box-shadow: none; } .AXTabs .AXTabsTray .AXTab.Green.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabs .AXTabsTray .AXTab.Red { background: #f05353; color: #ffffff; border: 1px solid #f05353; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabs .AXTabsTray .AXTab.Red:hover, .AXTabs .AXTabsTray .AXTab.Red:focus { background: #d24545; border: 1px solid #f05353; } .AXTabs .AXTabsTray .AXTab.Red:active { box-shadow: none; } .AXTabs .AXTabsTray .AXTab.Red.on { text-shadow: none; color: #6e7a85; background: #fff; border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabs .AXTabsTray .AXTab[disabled] { background: #bfbfbf; color: #ffffff; border: 1px solid #bfbfbf; box-shadow: none; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabs .AXTabsTray .AXTab[disabled]:hover, .AXTabs .AXTabsTray .AXTab[disabled]:focus { background: #bfbfbf; border: 1px solid #bfbfbf; } .AXTabs .AXTabsTray .AXTab[disabled]:active { box-shadow: none; } .AXTabs .AXTabsTray .AXTab[disabled].on { text-shadow: none; color: #ffffff; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #bfbfbf; border-bottom: 1px solid #fff; } .AXTabs .AXTabsTray .AXTab.closable { padding-right: 20px; } .AXTabs .AXTabsTray .AXTab .AXTabClose { position: absolute; right: 5px; top: 0px; font-family: axicon; } .AXTabs .AXTabsTray .AXTab .AXTabClose:before { content: "\f1b4"; } .AXTabs .AXTabsTray .leftArrowHandleBox { position: absolute; left: 0px; top: 1px; width: 29px; height: 28px; background: url('images/dx-left-arrows-bg.png') repeat-y 0px 0px; } .AXTabs .AXTabsTray .leftArrowHandleBox .tabArrow { display: block; width: 29px; height: 28px; background: url('images/dx-left-arrows-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabs .AXTabsTray .leftArrowHandleBox .tabArrow:hover { background: url('images/dx-left-arrows-01-r.png') no-repeat 50%; } .AXTabs .AXTabsTray .rightArrowHandleBox { position: absolute; right: 24px; top: 1px; width: 29px; height: 28px; background: url('images/dx-right-arrows-bg.png') repeat-y 100% 0px; } .AXTabs .AXTabsTray .rightArrowHandleBox .tabArrow { display: block; width: 29px; height: 28px; background: url('images/dx-right-arrows-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabs .AXTabsTray .rightArrowHandleBox .tabArrow:hover { background: url('images/dx-right-arrows-01-r.png') no-repeat 50%; } .AXTabs .AXTabsTray .rightArrowMoreBox { position: absolute; right: 0px; top: 1px; width: 24px; height: 28px; background: #fff; } .AXTabs .AXTabsTray .rightArrowMoreBox .tabArrow { display: block; width: 24px; height: 28px; background: url('images/dx-right-arrows-more-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabs .AXTabsTray .rightArrowMoreBox .tabArrow:hover { background: url('images/dx-right-arrows-more-01-r.png') no-repeat 50%; } .AXTabsLarge { position: relative; min-height: 46px; overflow: hidden; } .AXTabsLarge .AXTabsTray { background: url('images/dx-tab-bg-large.png'); } .AXTabsLarge .AXTabsTray .trayScroll { position: absolute; left: 0px; top: 0px; height: 46px; } .AXTabsLarge .AXTabsTray .AXTab { display: block; float: left; cursor: pointer; position: relative; height: 40px; min-width: 100px; padding: 0px 10px; box-sizing: content-box !important; margin: 4px 0px 0px 4px; border-top-left-radius: 4px; border-top-right-radius: 4px; font-size: 14px; color: #6e7a86; line-height: 40px; text-align: center; text-decoration: none; outline: none; background: #e5e5e5; color: #6e7a85; border: 1px solid #b9babc; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsLarge .AXTabsTray .AXTab:hover, .AXTabsLarge .AXTabsTray .AXTab:focus { background: #cacaca; border: 1px solid #b9babc; } .AXTabsLarge .AXTabsTray .AXTab:active { box-shadow: none; } .AXTabsLarge .AXTabsTray .AXTab.on { text-shadow: none; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsLarge .AXTabsTray .AXTab:first-child { margin-left: 5px; } .AXTabsLarge .AXTabsTray .AXTab.Classic { background: #536270; color: #ffffff; border: 1px solid #536270; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsLarge .AXTabsTray .AXTab.Classic:hover, .AXTabsLarge .AXTabsTray .AXTab.Classic:focus { background: #495764; border: 1px solid #536270; } .AXTabsLarge .AXTabsTray .AXTab.Classic:active { box-shadow: none; } .AXTabsLarge .AXTabsTray .AXTab.Classic.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsLarge .AXTabsTray .AXTab.Blue { background: #4aaded; color: #ffffff; border: 1px solid #4aaded; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsLarge .AXTabsTray .AXTab.Blue:hover, .AXTabsLarge .AXTabsTray .AXTab.Blue:focus { background: #338fcc; border: 1px solid #4aaded; } .AXTabsLarge .AXTabsTray .AXTab.Blue:active { box-shadow: none; } .AXTabsLarge .AXTabsTray .AXTab.Blue.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsLarge .AXTabsTray .AXTab.Green { background: #1dbb9a; color: #ffffff; border: 1px solid #1dbb9a; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsLarge .AXTabsTray .AXTab.Green:hover, .AXTabsLarge .AXTabsTray .AXTab.Green:focus { background: #179e82; border: 1px solid #1dbb9a; } .AXTabsLarge .AXTabsTray .AXTab.Green:active { box-shadow: none; } .AXTabsLarge .AXTabsTray .AXTab.Green.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsLarge .AXTabsTray .AXTab.Red { background: #f05353; color: #ffffff; border: 1px solid #f05353; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsLarge .AXTabsTray .AXTab.Red:hover, .AXTabsLarge .AXTabsTray .AXTab.Red:focus { background: #d24545; border: 1px solid #f05353; } .AXTabsLarge .AXTabsTray .AXTab.Red:active { box-shadow: none; } .AXTabsLarge .AXTabsTray .AXTab.Red.on { text-shadow: none; color: #6e7a85; background: #fff; border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsLarge .AXTabsTray .AXTab[disabled] { background: #bfbfbf; color: #ffffff; border: 1px solid #bfbfbf; box-shadow: none; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsLarge .AXTabsTray .AXTab[disabled]:hover, .AXTabsLarge .AXTabsTray .AXTab[disabled]:focus { background: #bfbfbf; border: 1px solid #bfbfbf; } .AXTabsLarge .AXTabsTray .AXTab[disabled]:active { box-shadow: none; } .AXTabsLarge .AXTabsTray .AXTab[disabled].on { text-shadow: none; color: #ffffff; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #bfbfbf; border-bottom: 1px solid #fff; } .AXTabsLarge .AXTabsTray .AXTab.closable { padding-right: 20px; } .AXTabsLarge .AXTabsTray .AXTab .AXTabClose { position: absolute; right: 5px; top: 0px; font-family: axicon; } .AXTabsLarge .AXTabsTray .AXTab .AXTabClose:before { content: "\f1b4"; } .AXTabsLarge .AXTabsTray .leftArrowHandleBox { position: absolute; left: 0px; top: 1px; width: 29px; height: 44px; background: url('images/dx-left-arrows-bg.png') repeat-y 0px 0px; } .AXTabsLarge .AXTabsTray .leftArrowHandleBox .tabArrow { display: block; width: 29px; height: 44px; background: url('images/dx-left-arrows-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabsLarge .AXTabsTray .leftArrowHandleBox .tabArrow:hover { background: url('images/dx-left-arrows-01-r.png') no-repeat 50%; } .AXTabsLarge .AXTabsTray .rightArrowHandleBox { position: absolute; right: 24px; top: 1px; width: 29px; height: 44px; background: url('images/dx-right-arrows-bg.png') repeat-y 100% 0px; } .AXTabsLarge .AXTabsTray .rightArrowHandleBox .tabArrow { display: block; width: 29px; height: 44px; background: url('images/dx-right-arrows-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabsLarge .AXTabsTray .rightArrowHandleBox .tabArrow:hover { background: url('images/dx-right-arrows-01-r.png') no-repeat 50%; } .AXTabsLarge .AXTabsTray .rightArrowMoreBox { position: absolute; right: 0px; top: 1px; width: 24px; height: 44px; background: #fff; } .AXTabsLarge .AXTabsTray .rightArrowMoreBox .tabArrow { display: block; width: 24px; height: 44px; background: url('images/dx-right-arrows-more-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabsLarge .AXTabsTray .rightArrowMoreBox .tabArrow:hover { background: url('images/dx-right-arrows-more-01-r.png') no-repeat 50%; } .AXTabsSmall { position: relative; min-height: 24px; overflow: hidden; } .AXTabsSmall .AXTabsTray { background: url('images/dx-tab-bg-small.png'); } .AXTabsSmall .AXTabsTray .trayScroll { position: absolute; left: 0px; top: 0px; height: 24px; } .AXTabsSmall .AXTabsTray .AXTab { display: block; float: left; cursor: pointer; position: relative; height: 20px; min-width: 60px; padding: 0px 10px; box-sizing: content-box !important; margin: 2px 0px 0px 2px; border-top-left-radius: 4px; border-top-right-radius: 4px; font-size: 11px; color: #6e7a86; line-height: 20px; text-align: center; text-decoration: none; outline: none; background: #e5e5e5; color: #6e7a85; border: 1px solid #b9babc; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsSmall .AXTabsTray .AXTab:hover, .AXTabsSmall .AXTabsTray .AXTab:focus { background: #cacaca; border: 1px solid #b9babc; } .AXTabsSmall .AXTabsTray .AXTab:active { box-shadow: none; } .AXTabsSmall .AXTabsTray .AXTab.on { text-shadow: none; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsSmall .AXTabsTray .AXTab:first-child { margin-left: 5px; } .AXTabsSmall .AXTabsTray .AXTab.Classic { background: #536270; color: #ffffff; border: 1px solid #536270; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsSmall .AXTabsTray .AXTab.Classic:hover, .AXTabsSmall .AXTabsTray .AXTab.Classic:focus { background: #495764; border: 1px solid #536270; } .AXTabsSmall .AXTabsTray .AXTab.Classic:active { box-shadow: none; } .AXTabsSmall .AXTabsTray .AXTab.Classic.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsSmall .AXTabsTray .AXTab.Blue { background: #4aaded; color: #ffffff; border: 1px solid #4aaded; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsSmall .AXTabsTray .AXTab.Blue:hover, .AXTabsSmall .AXTabsTray .AXTab.Blue:focus { background: #338fcc; border: 1px solid #4aaded; } .AXTabsSmall .AXTabsTray .AXTab.Blue:active { box-shadow: none; } .AXTabsSmall .AXTabsTray .AXTab.Blue.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsSmall .AXTabsTray .AXTab.Green { background: #1dbb9a; color: #ffffff; border: 1px solid #1dbb9a; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsSmall .AXTabsTray .AXTab.Green:hover, .AXTabsSmall .AXTabsTray .AXTab.Green:focus { background: #179e82; border: 1px solid #1dbb9a; } .AXTabsSmall .AXTabsTray .AXTab.Green:active { box-shadow: none; } .AXTabsSmall .AXTabsTray .AXTab.Green.on { text-shadow: none; color: #6e7a85; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsSmall .AXTabsTray .AXTab.Red { background: #f05353; color: #ffffff; border: 1px solid #f05353; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsSmall .AXTabsTray .AXTab.Red:hover, .AXTabsSmall .AXTabsTray .AXTab.Red:focus { background: #d24545; border: 1px solid #f05353; } .AXTabsSmall .AXTabsTray .AXTab.Red:active { box-shadow: none; } .AXTabsSmall .AXTabsTray .AXTab.Red.on { text-shadow: none; color: #6e7a85; background: #fff; border: 1px solid #b9babc; border-bottom: 1px solid #fff; } .AXTabsSmall .AXTabsTray .AXTab[disabled] { background: #bfbfbf; color: #ffffff; border: 1px solid #bfbfbf; box-shadow: none; -webkit-border-radius: 4px 4px 0 0; -moz-border-radius: 4px 4px 0 0; border-radius: 4px 4px 0 0; } .AXTabsSmall .AXTabsTray .AXTab[disabled]:hover, .AXTabsSmall .AXTabsTray .AXTab[disabled]:focus { background: #bfbfbf; border: 1px solid #bfbfbf; } .AXTabsSmall .AXTabsTray .AXTab[disabled]:active { box-shadow: none; } .AXTabsSmall .AXTabsTray .AXTab[disabled].on { text-shadow: none; color: #ffffff; /*background: @stop;*/ background-image: -webkit-linear-gradient(#ffffff, #ffffff); /* For Safari */ background-image: -o-linear-gradient(#ffffff, #ffffff); /* For Opera 11.1 to 12.0 */ background-image: -moz-linear-gradient(#ffffff, #ffffff); /* For Firefox 3.6 to 15 */ background-image: linear-gradient(#ffffff, #ffffff); /* Standard syntax */ filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ -ms-filter: progid:DXImageTransform.Microsoft.gradient(GradientType=0, startColorstr=#ffffff, endColorstr=#ffffff); /*For IE7-8-9*/ border: 1px solid #bfbfbf; border-bottom: 1px solid #fff; } .AXTabsSmall .AXTabsTray .AXTab.closable { padding-right: 20px; } .AXTabsSmall .AXTabsTray .AXTab .AXTabClose { position: absolute; right: 5px; top: 0px; font-family: axicon; } .AXTabsSmall .AXTabsTray .AXTab .AXTabClose:before { content: "\f1b4"; } .AXTabsSmall .AXTabsTray .leftArrowHandleBox { position: absolute; left: 0px; top: 1px; width: 29px; height: 22px; background: url('images/dx-left-arrows-bg.png') repeat-y 0px 0px; } .AXTabsSmall .AXTabsTray .leftArrowHandleBox .tabArrow { display: block; width: 29px; height: 22px; background: url('images/dx-left-arrows-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabsSmall .AXTabsTray .leftArrowHandleBox .tabArrow:hover { background: url('images/dx-left-arrows-01-r.png') no-repeat 50%; } .AXTabsSmall .AXTabsTray .rightArrowHandleBox { position: absolute; right: 24px; top: 1px; width: 29px; height: 22px; background: url('images/dx-right-arrows-bg.png') repeat-y 100% 0px; } .AXTabsSmall .AXTabsTray .rightArrowHandleBox .tabArrow { display: block; width: 29px; height: 22px; background: url('images/dx-right-arrows-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabsSmall .AXTabsTray .rightArrowHandleBox .tabArrow:hover { background: url('images/dx-right-arrows-01-r.png') no-repeat 50%; } .AXTabsSmall .AXTabsTray .rightArrowMoreBox { position: absolute; right: 0px; top: 1px; width: 24px; height: 22px; background: #fff; } .AXTabsSmall .AXTabsTray .rightArrowMoreBox .tabArrow { display: block; width: 24px; height: 22px; background: url('images/dx-right-arrows-more-01.png') no-repeat 50%; text-indent: -1000px; overflow: hidden; } .AXTabsSmall .AXTabsTray .rightArrowMoreBox .tabArrow:hover { background: url('images/dx-right-arrows-more-01-r.png') no-repeat 50%; }
axisj/axisj
ui/bulldog/AXTabs.css
CSS
lgpl-2.1
35,107
/** ****************************************************************************** * @file stm32f37x_sdadc.h * @author MCD Application Team * @version V1.0.0 * @date 20-September-2012 * @brief This file contains all the functions prototypes for the SDADC firmware * library. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT 2012 STMicroelectronics</center></h2> * * Licensed under MCD-ST Liberty SW License Agreement V2, (the "License"); * You may not use this file except in compliance with the License. * You may obtain a copy of the License at: * * http://www.st.com/software_license_agreement_liberty_v2 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F37X_SDADC_H #define __STM32F37X_SDADC_H #ifdef __cplusplus extern "C" { #endif /* Includes ------------------------------------------------------------------*/ #include "stm32f37x.h" /** @addtogroup STM32F37x_StdPeriph_Driver * @{ */ /** @addtogroup SDADC * @{ */ /* Exported types ------------------------------------------------------------*/ /** * @brief SDADC Init structure definition */ typedef struct { uint32_t SDADC_Channel; /*!< Select the regular channel. This parameter can be any value of @ref SDADC_Channel_Selection */ FunctionalState SDADC_ContinuousConvMode; /*!< Specifies whether the conversion is performed in Continuous or Single mode. This parameter can be set to ENABLE or DISABLE. */ FunctionalState SDADC_FastConversionMode; /*!< Specifies whether the conversion is performed in fast mode. This parameter can be set to ENABLE or DISABLE. */ }SDADC_InitTypeDef; /** * @brief SDADC Analog Inputs Configuration structure definition */ typedef struct { uint32_t SDADC_InputMode; /*!< Specifies the input structure type (single ended, differential...) This parameter can be any value of @ref SDADC_InputMode */ uint32_t SDADC_Gain; /*!< Specifies the gain setting. This parameter can be any value of @ref SDADC_Gain */ uint32_t SDADC_CommonMode; /*!< Specifies the common mode setting (VSSA, VDDA, VDDA/2). This parameter can be any value of @ref SDADC_CommonMode */ uint32_t SDADC_Offset; /*!< Specifies the 12-bit offset value. This parameter can be any value lower or equal to 0x00000FFF */ }SDADC_AINStructTypeDef; /* Exported constants --------------------------------------------------------*/ /** @defgroup SDADC_Exported_Constants * @{ */ #define IS_SDADC_ALL_PERIPH(PERIPH) (((PERIPH) == SDADC1) || \ ((PERIPH) == SDADC2) || \ ((PERIPH) == SDADC3)) #define IS_SDADC_SLAVE_PERIPH(PERIPH) (((PERIPH) == SDADC2) || \ ((PERIPH) == SDADC3)) /** @defgroup SDADC_Channel_Selection * @{ */ /* SDADC Channels ------------------------------------------------------------*/ /* The SDADC channels are defined as follow: - in 16-bit LSB the channel mask is set - in 16-bit MSB the channel number is set e.g. for channel 5 definition: - the channel mask is 0x00000020 (bit 5 is set) - the channel number 5 is 0x00050000 --> Consequently, channel 5 definition is 0x00000020 | 0x00050000 = 0x00050020 */ #define SDADC_Channel_0 ((uint32_t)0x00000001) #define SDADC_Channel_1 ((uint32_t)0x00010002) #define SDADC_Channel_2 ((uint32_t)0x00020004) #define SDADC_Channel_3 ((uint32_t)0x00030008) #define SDADC_Channel_4 ((uint32_t)0x00040010) #define SDADC_Channel_5 ((uint32_t)0x00050020) #define SDADC_Channel_6 ((uint32_t)0x00060040) #define SDADC_Channel_7 ((uint32_t)0x00070080) #define SDADC_Channel_8 ((uint32_t)0x00080100) /* Just one channel of the 9 channels can be selected for regular conversion */ #define IS_SDADC_REGULAR_CHANNEL(CHANNEL) (((CHANNEL) == SDADC_Channel_0) || \ ((CHANNEL) == SDADC_Channel_1) || \ ((CHANNEL) == SDADC_Channel_2) || \ ((CHANNEL) == SDADC_Channel_3) || \ ((CHANNEL) == SDADC_Channel_4) || \ ((CHANNEL) == SDADC_Channel_5) || \ ((CHANNEL) == SDADC_Channel_6) || \ ((CHANNEL) == SDADC_Channel_7) || \ ((CHANNEL) == SDADC_Channel_8)) /* Any or all of the 9 channels can be selected for injected conversion */ #define IS_SDADC_INJECTED_CHANNEL(CHANNEL) (((CHANNEL) != 0) && ((CHANNEL) <= 0x000F01FF)) /** * @} */ /** @defgroup SDADC_Conf * @{ */ #define SDADC_Conf_0 ((uint32_t)0x00000000) /*!< Configuration 0 selected */ #define SDADC_Conf_1 ((uint32_t)0x00000001) /*!< Configuration 1 selected */ #define SDADC_Conf_2 ((uint32_t)0x00000002) /*!< Configuration 2 selected */ #define IS_SDADC_CONF(CONF) (((CONF) == SDADC_Conf_0) || \ ((CONF) == SDADC_Conf_1) || \ ((CONF) == SDADC_Conf_2)) /** * @} */ /** @defgroup SDADC_InputMode * @{ */ #define SDADC_InputMode_Diff ((uint32_t)0x00000000) /*!< Conversions are executed in differential mode */ #define SDADC_InputMode_SEOffset SDADC_CONF0R_SE0_0 /*!< Conversions are executed in single ended offset mode */ #define SDADC_InputMode_SEZeroReference SDADC_CONF0R_SE0 /*!< Conversions are executed in single ended zero-volt reference mode */ #define IS_SDADC_INPUT_MODE(MODE) (((MODE) == SDADC_InputMode_Diff) || \ ((MODE) == SDADC_InputMode_SEOffset) || \ ((MODE) == SDADC_InputMode_SEZeroReference)) /** * @} */ /** @defgroup SDADC_Gain * @{ */ #define SDADC_Gain_1 ((uint32_t)0x00000000) /*!< Gain equal to 1 */ #define SDADC_Gain_2 SDADC_CONF0R_GAIN0_0 /*!< Gain equal to 2 */ #define SDADC_Gain_4 SDADC_CONF0R_GAIN0_1 /*!< Gain equal to 4 */ #define SDADC_Gain_8 ((uint32_t)0x00300000) /*!< Gain equal to 8 */ #define SDADC_Gain_16 SDADC_CONF0R_GAIN0_2 /*!< Gain equal to 16 */ #define SDADC_Gain_32 ((uint32_t)0x00500000) /*!< Gain equal to 32 */ #define SDADC_Gain_1_2 SDADC_CONF0R_GAIN0 /*!< Gain equal to 1/2 */ #define IS_SDADC_GAIN(GAIN) (((GAIN) == SDADC_Gain_1) || \ ((GAIN) == SDADC_Gain_2) || \ ((GAIN) == SDADC_Gain_4) || \ ((GAIN) == SDADC_Gain_8) || \ ((GAIN) == SDADC_Gain_16) || \ ((GAIN) == SDADC_Gain_32) || \ ((GAIN) == SDADC_Gain_1_2)) /** * @} */ /** @defgroup SDADC_CommonMode * @{ */ #define SDADC_CommonMode_VSSA ((uint32_t)0x00000000) /*!< Select SDADC VSSA as common mode */ #define SDADC_CommonMode_VDDA_2 SDADC_CONF0R_COMMON0_0 /*!< Select SDADC VDDA/2 as common mode */ #define SDADC_CommonMode_VDDA SDADC_CONF0R_COMMON0_1 /*!< Select SDADC VDDA as common mode */ #define IS_SDADC_COMMON_MODE(MODE) (((MODE) == SDADC_CommonMode_VSSA) || \ ((MODE) == SDADC_CommonMode_VDDA_2) || \ ((MODE) == SDADC_CommonMode_VDDA)) /** * @} */ /** @defgroup SDADC_Offset * @{ */ #define IS_SDADC_OFFSET_VALUE(VALUE) ((VALUE) <= 0x00000FFF) /** * @} */ /** @defgroup SDADC_ExternalTrigger_sources * @{ */ #define SDADC_ExternalTrigInjecConv_T13_CC1 ((uint32_t)0x00000000) /*!< Trigger source for SDADC1 */ #define SDADC_ExternalTrigInjecConv_T14_CC1 ((uint32_t)0x00000100) /*!< Trigger source for SDADC1 */ #define SDADC_ExternalTrigInjecConv_T16_CC1 ((uint32_t)0x00000000) /*!< Trigger source for SDADC3 */ #define SDADC_ExternalTrigInjecConv_T17_CC1 ((uint32_t)0x00000000) /*!< Trigger source for SDADC2 */ #define SDADC_ExternalTrigInjecConv_T12_CC1 ((uint32_t)0x00000100) /*!< Trigger source for SDADC2 */ #define SDADC_ExternalTrigInjecConv_T12_CC2 ((uint32_t)0x00000100) /*!< Trigger source for SDADC3 */ #define SDADC_ExternalTrigInjecConv_T15_CC2 ((uint32_t)0x00000200) /*!< Trigger source for SDADC1 */ #define SDADC_ExternalTrigInjecConv_T2_CC3 ((uint32_t)0x00000200) /*!< Trigger source for SDADC2 */ #define SDADC_ExternalTrigInjecConv_T2_CC4 ((uint32_t)0x00000200) /*!< Trigger source for SDADC3 */ #define SDADC_ExternalTrigInjecConv_T3_CC1 ((uint32_t)0x00000300) /*!< Trigger source for SDADC1 */ #define SDADC_ExternalTrigInjecConv_T3_CC2 ((uint32_t)0x00000300) /*!< Trigger source for SDADC2 */ #define SDADC_ExternalTrigInjecConv_T3_CC3 ((uint32_t)0x00000300) /*!< Trigger source for SDADC3 */ #define SDADC_ExternalTrigInjecConv_T4_CC1 ((uint32_t)0x00000400) /*!< Trigger source for SDADC1 */ #define SDADC_ExternalTrigInjecConv_T4_CC2 ((uint32_t)0x00000400) /*!< Trigger source for SDADC2 */ #define SDADC_ExternalTrigInjecConv_T4_CC3 ((uint32_t)0x00000400) /*!< Trigger source for SDADC3 */ #define SDADC_ExternalTrigInjecConv_T19_CC2 ((uint32_t)0x00000500) /*!< Trigger source for SDADC1 */ #define SDADC_ExternalTrigInjecConv_T19_CC3 ((uint32_t)0x00000500) /*!< Trigger source for SDADC2 */ #define SDADC_ExternalTrigInjecConv_T19_CC4 ((uint32_t)0x00000500) /*!< Trigger source for SDADC3 */ #define SDADC_ExternalTrigInjecConv_Ext_IT11 ((uint32_t)0x00000700) /*!< Trigger source for SDADC1, SDADC2 and SDADC3 */ #define SDADC_ExternalTrigInjecConv_Ext_IT15 ((uint32_t)0x00000600) /*!< Trigger source for SDADC1, SDADC2 and SDADC3 */ #define IS_SDADC_EXT_INJEC_TRIG(INJTRIG) (((INJTRIG) == SDADC_ExternalTrigInjecConv_T13_CC1) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T14_CC1) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T16_CC1) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T17_CC1) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T12_CC1) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T12_CC2) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T15_CC2) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T2_CC3) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T2_CC4) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T3_CC1) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T3_CC2) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T3_CC3) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T4_CC1) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T4_CC2) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T4_CC3) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T19_CC2) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T19_CC3) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_T19_CC4) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_Ext_IT11) || \ ((INJTRIG) == SDADC_ExternalTrigInjecConv_Ext_IT15)) /** * @} */ /** @defgroup SDADC_external_trigger_edge_for_injected_channels_conversion * @{ */ #define SDADC_ExternalTrigInjecConvEdge_None ((uint32_t) 0x00000000) #define SDADC_ExternalTrigInjecConvEdge_Rising SDADC_CR2_JEXTEN_0 #define SDADC_ExternalTrigInjecConvEdge_Falling SDADC_CR2_JEXTEN_1 #define SDADC_ExternalTrigInjecConvEdge_RisingFalling SDADC_CR2_JEXTEN #define IS_SDADC_EXT_INJEC_TRIG_EDGE(EDGE) (((EDGE) == SDADC_ExternalTrigInjecConvEdge_None) || \ ((EDGE) == SDADC_ExternalTrigInjecConvEdge_Rising) || \ ((EDGE) == SDADC_ExternalTrigInjecConvEdge_Falling) || \ ((EDGE) == SDADC_ExternalTrigInjecConvEdge_RisingFalling)) /** * @} */ /** @defgroup SDADC_DMATransfer_modes * @{ */ #define SDADC_DMATransfer_Regular SDADC_CR1_RDMAEN /*!< DMA requests enabled for regular conversions */ #define SDADC_DMATransfer_Injected SDADC_CR1_JDMAEN /*!< DMA requests enabled for injected conversions */ #define IS_SDADC_DMA_TRANSFER(TRANSFER) (((TRANSFER) == SDADC_DMATransfer_Regular) || \ ((TRANSFER) == SDADC_DMATransfer_Injected)) /** * @} */ /** @defgroup SDADC_CalibrationSequence * @{ */ #define SDADC_CalibrationSequence_1 ((uint32_t)0x00000000) /*!< One calibration sequence to calculate offset of conf0 (OFFSET0[11:0]) */ #define SDADC_CalibrationSequence_2 SDADC_CR2_CALIBCNT_0 /*!< Two calibration sequences to calculate offset of conf0 and conf1 (OFFSET0[11:0] and OFFSET1[11:0]) */ #define SDADC_CalibrationSequence_3 SDADC_CR2_CALIBCNT_1 /*!< Three calibration sequences to calculate offset of conf0, conf1 and conf2 (OFFSET0[11:0], OFFSET1[11:0], and OFFSET2[11:0]) */ #define IS_SDADC_CALIB_SEQUENCE(SEQUENCE) (((SEQUENCE) == SDADC_CalibrationSequence_1) || \ ((SEQUENCE) == SDADC_CalibrationSequence_2) || \ ((SEQUENCE) == SDADC_CalibrationSequence_3)) /** * @} */ /** @defgroup SDADC_VREF * @{ */ #define SDADC_VREF_Ext ((uint32_t)0x00000000) /*!< The reference voltage is forced externally using VREF pin */ #define SDADC_VREF_VREFINT1 SDADC_CR1_REFV_0 /*!< The reference voltage is forced internally to 1.22V VREFINT */ #define SDADC_VREF_VREFINT2 SDADC_CR1_REFV_1 /*!< The reference voltage is forced internally to 1.8V VREFINT */ #define SDADC_VREF_VDDA SDADC_CR1_REFV /*!< The reference voltage is forced internally to VDDA */ #define IS_SDADC_VREF(VREF) (((VREF) == SDADC_VREF_Ext) || \ ((VREF) == SDADC_VREF_VREFINT1) || \ ((VREF) == SDADC_VREF_VREFINT2) || \ ((VREF) == SDADC_VREF_VDDA)) /** * @} */ /** @defgroup SDADC_interrupts_definition * @{ */ #define SDADC_IT_EOCAL ((uint32_t)0x00000001) /*!< End of calibration flag */ #define SDADC_IT_JEOC ((uint32_t)0x00000002) /*!< End of injected conversion flag */ #define SDADC_IT_JOVR ((uint32_t)0x00000004) /*!< Injected conversion overrun flag */ #define SDADC_IT_REOC ((uint32_t)0x00000008) /*!< End of regular conversion flag */ #define SDADC_IT_ROVR ((uint32_t)0x00000010) /*!< Regular conversion overrun flag */ #define IS_SDADC_IT(IT) ((((IT) & (uint32_t)0xFFFFFFE0) == 0x00000000) && ((IT) != 0x00000000)) #define IS_SDADC_GET_IT(IT) (((IT) == SDADC_IT_EOCAL) || ((IT) == SDADC_IT_JEOC) || \ ((IT) == SDADC_IT_JOVR) || ((IT) == SDADC_IT_REOC) || \ ((IT) == SDADC_IT_ROVR)) #define IS_SDADC_CLEAR_IT(IT) ((((IT) & (uint32_t)0xFFFFFFEA) == 0x00000000) && ((IT) != 0x00000000)) /** * @} */ /** @defgroup SDADC_flags_definition * @{ */ #define SDADC_FLAG_EOCAL ((uint32_t)0x00000001) /*!< End of calibration flag */ #define SDADC_FLAG_JEOC ((uint32_t)0x00000002) /*!< End of injected conversion flag */ #define SDADC_FLAG_JOVR ((uint32_t)0x00000004) /*!< Injected conversion overrun flag */ #define SDADC_FLAG_REOC ((uint32_t)0x00000008) /*!< End of regular conversion flag */ #define SDADC_FLAG_ROVR ((uint32_t)0x00000010) /*!< Regular conversion overrun flag */ #define SDADC_FLAG_CALIBIP ((uint32_t)0x00001000) /*!< Calibration in progress status */ #define SDADC_FLAG_JCIP ((uint32_t)0x00002000) /*!< Injected conversion in progress status */ #define SDADC_FLAG_RCIP ((uint32_t)0x00004000) /*!< Regular conversion in progress status */ #define SDADC_FLAG_STABIP ((uint32_t)0x00008000) /*!< Stabilization in progress status */ #define SDADC_FLAG_INITRDY ((uint32_t)0x80000000) /*!< Initialization mode is ready */ #define IS_SDADC_CLEAR_FLAG(FLAG) ((((FLAG) & (uint32_t)0xFFFFFFE0) == 0x00000000) && ((FLAG) != 0x00000000)) #define IS_SDADC_GET_FLAG(FLAG) (((FLAG) == SDADC_FLAG_EOCAL) || ((FLAG) == SDADC_FLAG_JEOC) || \ ((FLAG) == SDADC_FLAG_JOVR) || ((FLAG)== SDADC_FLAG_REOC) || \ ((FLAG) == SDADC_FLAG_ROVR) || ((FLAG)== SDADC_FLAG_CALIBIP) || \ ((FLAG) == SDADC_FLAG_JCIP) || ((FLAG)== SDADC_FLAG_RCIP) || \ ((FLAG) == SDADC_FLAG_STABIP) || ((FLAG)== SDADC_FLAG_INITRDY)) /** * @} */ /** * @} */ /* Exported macro ------------------------------------------------------------*/ /* Exported functions ------------------------------------------------------- */ /* Function used to set the SDADC configuration to the default reset state ****/ void SDADC_DeInit(SDADC_TypeDef* SDADCx); /* Initialization and Configuration functions *********************************/ void SDADC_Init(SDADC_TypeDef* SDADCx, SDADC_InitTypeDef* SDADC_InitStruct); void SDADC_StructInit(SDADC_InitTypeDef* SDADC_InitStruct); void SDADC_AINInit(SDADC_TypeDef* SDADCx, uint32_t SDADC_Conf, SDADC_AINStructTypeDef* SDADC_AINStruct); void SDADC_AINStructInit(SDADC_AINStructTypeDef* SDADC_AINStruct); void SDADC_ChannelConfig(SDADC_TypeDef* SDADCx, uint32_t SDADC_Channel, uint32_t SDADC_Conf); void SDADC_Cmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_InitModeCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_FastConversionCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_VREFSelect(uint32_t SDADC_VREF); void SDADC_CalibrationSequenceConfig(SDADC_TypeDef* SDADCx, uint32_t SDADC_CalibrationSequence); void SDADC_StartCalibration(SDADC_TypeDef* SDADCx); /* Regular Channels Configuration functions ***********************************/ void SDADC_ChannelSelect(SDADC_TypeDef* SDADCx, uint32_t SDADC_Channel); void SDADC_ContinuousModeCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_SoftwareStartConv(SDADC_TypeDef* SDADCx); int16_t SDADC_GetConversionValue(SDADC_TypeDef* SDADCx); void SDADC_RegularSynchroSDADC1(SDADC_TypeDef* SDADCx, FunctionalState NewState); uint32_t SDADC_GetConversionSDADC12Value(void); uint32_t SDADC_GetConversionSDADC13Value(void); /* Injected channels Configuration functions **********************************/ void SDADC_SoftwareStartInjectedConv(SDADC_TypeDef* SDADCx); void SDADC_InjectedChannelSelect(SDADC_TypeDef* SDADCx, uint32_t SDADC_Channel); void SDADC_DelayStartInjectedConvCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_InjectedContinuousModeCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_ExternalTrigInjectedConvConfig(SDADC_TypeDef* SDADCx, uint32_t SDADC_ExternalTrigInjecConv); void SDADC_ExternalTrigInjectedConvEdgeConfig(SDADC_TypeDef* SDADCx, uint32_t SDADC_ExternalTrigInjecConvEdge); uint32_t SDADC_GetInjectedChannel(SDADC_TypeDef* SDADCx); int16_t SDADC_GetInjectedConversionValue(SDADC_TypeDef* SDADCx, uint32_t* SDADC_Channel); void SDADC_InjectedSynchroSDADC1(SDADC_TypeDef* SDADCx, FunctionalState NewState); uint32_t SDADC_GetInjectedConversionSDADC12Value(void); uint32_t SDADC_GetInjectedConversionSDADC13Value(void); /* Power saving functions *****************************************************/ void SDADC_PowerDownCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_StandbyCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); void SDADC_SlowClockCmd(SDADC_TypeDef* SDADCx, FunctionalState NewState); /* Regular/Injected Channels DMA Configuration functions **********************/ void SDADC_DMAConfig(SDADC_TypeDef* SDADCx, uint32_t SDADC_DMATransfer, FunctionalState NewState); /* Interrupts and flags management functions **********************************/ void SDADC_ITConfig(SDADC_TypeDef* SDADCx, uint32_t SDADC_IT, FunctionalState NewState); FlagStatus SDADC_GetFlagStatus(SDADC_TypeDef* SDADCx, uint32_t SDADC_FLAG); void SDADC_ClearFlag(SDADC_TypeDef* SDADCx, uint32_t SDADC_FLAG); ITStatus SDADC_GetITStatus(SDADC_TypeDef* SDADCx, uint32_t SDADC_IT); void SDADC_ClearITPendingBit(SDADC_TypeDef* SDADCx, uint32_t SDADC_IT); #ifdef __cplusplus } #endif #endif /*__STM32F37X_SDADC_H */ /** * @} */ /** * @} */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
prefetchnta/crhack
src/naked/arm-stm32/stm32f37x/stm32f37x_sdadc.h
C
lgpl-2.1
23,717
/* * Copyright (c) 1997 Silicon Graphics, Inc. All Rights Reserved. * Copyright (c) 2009 Aconex. All Rights Reserved. * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the * Free Software Foundation; either version 2 of the License, or (at your * option) any later version. * * This program is distributed in the hope that it will be useful, but * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * for more details. */ #ifndef _STACKMOD_H_ #define _STACKMOD_H_ #include <QVector> #include "modulate.h" class SoBaseColor; class SoTranslation; class SoScale; class SoNode; class SoSwitch; class Launch; struct StackBlock { SoSeparator *_sep; SoBaseColor *_color; SoScale *_scale; SoTranslation *_tran; Modulate::State _state; bool _selected; }; typedef QVector<StackBlock> StackBlockList; class StackMod : public Modulate { public: enum Height { unfixed, fixed, util }; private: static const float theDefFillColor[]; static const char theStackId; StackBlockList _blocks; SoSwitch *_switch; Height _height; QString _text; int _selectCount; int _infoValue; int _infoMetric; int _infoInst; public: virtual ~StackMod(); StackMod(MetricList *metrics, SoNode *obj, Height height = unfixed); void setFillColor(const SbColor &col); void setFillColor(int packedcol); void setFillText(const char *str) { _text = str; } virtual void refresh(bool fetchFlag); virtual void selectAll(); virtual int select(SoPath *); virtual int remove(SoPath *); virtual void selectInfo(SoPath *); virtual void removeInfo(SoPath *); virtual void infoText(QString &str, bool) const; virtual void launch(Launch &launch, bool all) const; virtual void dump(QTextStream &) const; private: StackMod(); StackMod(const StackMod &); const StackMod &operator=(const StackMod &); // Never defined void findBlock(SoPath *path, int &metric, int &inst, int &value, bool idMetric = true); }; #endif /* _STACKMOD_H_ */
aeg-aeg/pcpfans
src/pmview/stackmod.h
C
lgpl-2.1
2,280
package test; import java.util.*; public class Expr extends Constants { public void eval() { int i = 1; byte b1 = 2, b2; boolean b; String g; if( b) { g = "Hello "; String h = "World!", k; k = g + h; } if( i & 0x0F) { // whoops! i = "hello"; } // works! i = i + 1; // doesn't work! boolean j; j = i + 1; // b1 promoted to int. b2 = b1 << 2; } }
blue-systems-group/project.maybe.polyglot
tests/Expr.jl
Julia
lgpl-2.1
453
/*This file is generated by luagen.*/ #include "lua_ftk_file.h" #include "lua_ftk_callbacks.h" static void tolua_reg_types (lua_State* L) { tolua_usertype(L, "FtkFile"); } static int lua_ftk_file_get_info(lua_State* L) { tolua_Error err = {0}; Ret retv; const char* file_name; FtkFileInfo* info; int param_ok = tolua_isstring(L, 1, 0, &err) && tolua_isusertype(L, 2, "FtkFileInfo", 0, &err); return_val_if_fail(param_ok, 0); file_name = tolua_tostring(L, 1, 0); info = tolua_tousertype(L, 2, 0); retv = ftk_file_get_info(file_name, info); tolua_pushnumber(L, (lua_Number)retv); return 1; } static int lua_ftk_file_get_mime_type(lua_State* L) { tolua_Error err = {0}; const char* retv; const char* file_name; int param_ok = tolua_isstring(L, 1, 0, &err); return_val_if_fail(param_ok, 0); file_name = tolua_tostring(L, 1, 0); retv = ftk_file_get_mime_type(file_name); tolua_pushstring(L, (const char*)retv); return 1; } int tolua_ftk_file_init(lua_State* L) { tolua_open(L); tolua_reg_types(L); tolua_module(L, NULL, 0); tolua_beginmodule(L, NULL); tolua_cclass(L,"FtkFile", "FtkFile", "", NULL); tolua_beginmodule(L, "FtkFile"); tolua_function(L, "GetInfo", lua_ftk_file_get_info); tolua_function(L, "GetMimeType", lua_ftk_file_get_mime_type); tolua_endmodule(L); tolua_endmodule(L); return 1; }
xuxiandi/ftk
script_binding/lua/lua_ftk_file.c
C
lgpl-3.0
1,339
local corner_nodebox = { type = "fixed", fixed = {{ -16/32-0.001, -17/32, -3/32, 0, -13/32, 3/32 }, { -3/32, -17/32, -16/32+0.001, 3/32, -13/32, 3/32}} } local corner_selectionbox = { type = "fixed", fixed = { -16/32-0.001, -18/32, -16/32, 5/32, -12/32, 5/32 }, } local corner_get_rules = function (node) local rules = {{x = 1, y = 0, z = 0}, {x = 0, y = 0, z = -1}} for i = 0, node.param2 do rules = mesecon.rotate_rules_left(rules) end return rules end minetest.register_node("mesecons_extrawires:corner_on", { drawtype = "nodebox", tiles = { "jeija_insulated_wire_curved_tb_on.png", "jeija_insulated_wire_curved_tb_on.png^[transformR270", "jeija_insulated_wire_sides_on.png", "jeija_insulated_wire_ends_on.png", "jeija_insulated_wire_sides_on.png", "jeija_insulated_wire_ends_on.png" }, paramtype = "light", paramtype2 = "facedir", walkable = false, sunlight_propagates = true, selection_box = corner_selectionbox, node_box = corner_nodebox, groups = {dig_immediate = 2, not_in_creative_inventory = 1}, -- MFF drop = "mesecons_extrawires:corner_off", mesecons = {conductor = { state = mesecon.state.on, rules = corner_get_rules, offstate = "mesecons_extrawires:corner_off" }} }) minetest.register_node("mesecons_extrawires:corner_off", { drawtype = "nodebox", description = "Mesecon Corner", tiles = { "jeija_insulated_wire_curved_tb_off.png", "jeija_insulated_wire_curved_tb_off.png^[transformR270", "jeija_insulated_wire_sides_off.png", "jeija_insulated_wire_ends_off.png", "jeija_insulated_wire_sides_off.png", "jeija_insulated_wire_ends_off.png" }, paramtype = "light", paramtype2 = "facedir", walkable = false, sunlight_propagates = true, selection_box = corner_selectionbox, node_box = corner_nodebox, groups = {dig_immediate = 2}, --MFF mesecons = {conductor = { state = mesecon.state.off, rules = corner_get_rules, onstate = "mesecons_extrawires:corner_on" }} }) minetest.register_craft({ output = "mesecons_extrawires:corner_off 3", recipe = { {"", "", ""}, {"mesecons_insulated:insulated_off", "mesecons_insulated:insulated_off", ""}, {"", "mesecons_insulated:insulated_off", ""}, } })
MinetestForFun/minetest-minetestforfun-server
mods/mesecons/mesecons_extrawires/corner.lua
Lua
unlicense
2,204
[#]: collector: (lujun9972) [#]: translator: (Yufei-Yan) [#]: reviewer: (wxy) [#]: publisher: (wxy) [#]: url: (https://linux.cn/article-12435-1.html) [#]: subject: (Project OWL: IoT trying to hold connectivity together in disasters) [#]: via: (https://www.networkworld.com/article/3564980/project-owl-iot-trying-to-hold-connectivity-together-in-disasters.html) [#]: author: (Jon Gold https://www.networkworld.com/author/Jon-Gold/) OWL 项目:物联网正尝试在灾难中让一切保持联络 ====== > 当自然灾害破坏了传统的通信连接时,配置在<ruby>多跳网络<rt>mesh network</rt></ruby>的物联网设备可以迅速部署以提供基本的连接。 ![](https://img.linux.net.cn/data/attachment/album/202007/21/135614mwr8rxr6lw5xefjs.jpg) OWL 项目负责人在最近的开源峰会上说,一个以多跳网络、物联网和 LoRa 连接为中心的开源项目可以帮助急救和受灾人员在自然灾害之后保持联系。 OWL 项目的应用场景是当在自然灾害之后频繁发生的通信中断时。无论是蜂窝网络还是有线网络,大范围的中断会频繁阻碍急救服务、供应和在暴风雨或其他重大灾难后必须解决关键问题的信息流。 该项目通过一大群“<ruby>鸭子<rt>duck</rt></ruby>”(便宜、易于部署且不需要现有基础设施支持的小型无线模块)实现这个目的。一些“鸭子”是太阳能的,其它一些则用的是耐用电池。每只“鸭子”配备一个 LoRa 无线电,用于在网络上和其它“鸭子”进行通信,同时还配备有 Wi-Fi,而且可能配备蓝牙和 GPS 来实现其他功能。 这个想法是这样的,当网络瘫痪时,用户可以使用他们的智能手机或者笔记本电脑与“鸭子”建立一个 Wi-Fi 连接,这个“鸭子”可以将小块的信息传递到网络的其他部分。信息向网络后端传递,直到到达“<ruby>鸭子爸爸<rt>papaduck</rt></ruby>”,“鸭子爸爸”装备了可以与云上的 OWL 数据管理系统连接的卫星系统(OWL 代表 ”<ruby>组织<rt>organization</rt></ruby>、<ruby>位置<rt>whereabouts</rt></ruby>和<ruby>物流<rt>logistics</rt></ruby>”)。信息可以通过云在智能手机或者网页上进行可视化,甚至可以通过 API 插入到现有的系统中。 秘密在于“<ruby>鸭群<rt>ClusterDuck</rt></ruby>” 协议,这是一个开源固件,即使在一些模块不能正常工作的网络中,它仍然能保持信息流通。它就是设计用来工作在大量便宜且容易获取的计算硬件上,类似树莓派的硬件,这样可以更容易且更快捷的建立一个“鸭群”网络。 创始人 Bryan Knouse 表示,这个项目的创建,是因为在 2017 年和 2018 年的毁灭性飓风中,要与受影响社区进行有效的通信而采取救援措施,面临着巨大的困难。 “我们的一些创始成员经历了这些灾难,然后我们会问‘我们该做些什么?’”,他说道。 在马亚圭斯,该项目有一批来自波多黎各大学的学生和教授,大多数的系统测试都在那里进行。Knouse 说,校园中目前有 17 个太阳能“鸭子”,分布在屋顶和树上,并且计划增加数量。 他说,“这种关系实际上创建了一个开源社区,这些学生和教授正在帮助我们开发这个项目。” -------------------------------------------------------------------------------- via: https://www.networkworld.com/article/3564980/project-owl-iot-trying-to-hold-connectivity-together-in-disasters.html 作者:[Jon Gold][a] 选题:[lujun9972][b] 译者:[Yufei-Yan](https://github.com/Yufei-Yan) 校对:[wxy](https://github.com/wxy) 本文由 [LCTT](https://github.com/LCTT/TranslateProject) 原创编译,[Linux中国](https://linux.cn/) 荣誉推出 [a]: https://www.networkworld.com/author/Jon-Gold/ [b]: https://github.com/lujun9972 [1]: https://images.idgesg.net/images/article/2019/01/owl-face-100785829-large.jpg [2]: https://creativecommons.org/licenses/by/2.0/legalcode [3]: https://www.networkworld.com/article/3207535/what-is-iot-the-internet-of-things-explained.html [4]: https://www.networkworld.com/article/3356838/how-to-determine-if-wi-fi-6-is-right-for-you.html [5]: https://www.networkworld.com/article/3250268/what-is-mu-mimo-and-why-you-need-it-in-your-wireless-routers.html [6]: https://www.networkworld.com/article/3402316/when-to-use-5g-when-to-use-wi-fi-6.html [7]: https://www.networkworld.com/article/3306720/mobile-wireless/how-enterprises-can-prep-for-5g.html [8]: https://www.networkworld.com/article/3560993/what-is-wi-fi-and-why-is-it-so-important.html [9]: https://www.facebook.com/NetworkWorld/ [10]: https://www.linkedin.com/company/network-world
alim0x/TranslateProject
published/202007/20200706 Project OWL- IoT trying to hold connectivity together in disasters.md
Markdown
apache-2.0
4,784
--- id: version-2.1.0-incubating-io-cassandra title: Cassandra Sink Connector sidebar_label: Cassandra Sink Connector original_id: io-cassandra --- The Cassandra Sink connector is used to write messages to a Cassandra Cluster. The tutorial [Connecting Pulsar with Apache Cassandra](io-quickstart.md) shows an example how to use Cassandra Sink connector to write messages to a Cassandra table. ## Sink Configuration Options All the Cassandra sink settings are listed as below. All the settings are required to run a Cassandra sink. | Name | Default | Required | Description | |------|---------|----------|-------------| | `roots` | `null` | `true` | Cassandra Contact Points. A list of one or many node address. It is a comma separated `String`. | | `keyspace` | `null` | `true` | Cassandra Keyspace name. The keyspace should be created prior to creating the sink. | | `columnFamily` | `null` | `true` | Cassandra ColumnFamily name. The column family should be created prior to creating the sink. | | `keyname` | `null` | `true` | Key column name. The key column is used for storing Pulsar message keys. If a Pulsar message doesn't have any key associated, the message value will be used as the key. | | `columnName` | `null` | `true` | Value column name. The value column is used for storing Pulsar message values. |
massakam/pulsar
site2/website/versioned_docs/version-2.1.0-incubating/io-cassandra.md
Markdown
apache-2.0
1,322
/******************************************************************************* * * Pentaho Big Data * * Copyright (C) 2002-2013 by Pentaho : http://www.pentaho.com * ******************************************************************************* * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with * the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * ******************************************************************************/ package org.pentaho.di.ui.job.entries.sqoop; import org.junit.Test; import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertFalse; import static org.junit.Assert.assertTrue; public class DatabaseItemTest { @Test public void instantiate_name() { String name = "name"; DatabaseItem item = new DatabaseItem( name ); assertEquals( name, item.getName() ); assertEquals( name, item.getDisplayName() ); } @Test public void instantiate_displayName() { String name = "name"; String displayName = "display name"; DatabaseItem item = new DatabaseItem( name, displayName ); assertEquals( name, item.getName() ); assertEquals( displayName, item.getDisplayName() ); } @Test public void equals() { DatabaseItem item1 = new DatabaseItem( "test" ); DatabaseItem item2 = new DatabaseItem( "test" ); DatabaseItem item3 = new DatabaseItem( "testing" ); assertFalse( item1.equals( null ) ); assertFalse( item1.equals( item3 ) ); assertTrue( item1.equals( item1 ) ); assertTrue( item1.equals( item2 ) ); } @Test public void testHashCode() { String name = "test"; DatabaseItem item1 = new DatabaseItem( name ); assertEquals( name.hashCode(), item1.hashCode() ); } @Test public void testToString() { String name = "test"; DatabaseItem item = new DatabaseItem( name ); assertEquals( name, item.toString() ); } }
mdamour1976/big-data-plugin
test-src/org/pentaho/di/ui/job/entries/sqoop/DatabaseItemTest.java
Java
apache-2.0
2,341
<div id="formDiaryDelete" class="dparts box"><div class="parts"> <div class="partsHeading"> <h3><?php echo __('Delete the diary') ?></h3> </div> <div class="block"> <p><?php echo __('Do you really delete this diary?') ?></p> <form action="<?php echo url_for('@diary_delete?id='.$diary->id) ?>" method="post"> <div class="operation"> <ul class="moreInfo button"> <li> <?php echo $form[$form->getCSRFFieldName()] ?> <input class="input_submit" type="submit" value="<?php echo __('Delete') ?>" /> </li> </ul> </div> </form> </div> </div></div> <?php use_helper('Javascript') ?> <?php op_include_line('backLink', link_to_function(__('Back to previous page'), 'history.back()')) ?>
cripure/openpne3
plugins/opDiaryPlugin/apps/pc_frontend/modules/diary/templates/deleteConfirmSuccess.php
PHP
apache-2.0
678
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.lens.api.error; import javax.ws.rs.core.Response; import lombok.Getter; public enum LensHttpStatus implements Response.StatusType { TOO_MANY_REQUESTS(429, "Too many requests"); @Getter private final int statusCode; @Getter private final String reasonPhrase; @Getter private final Response.Status.Family family; LensHttpStatus(int statusCode, String reasonPhrase) { this.statusCode = statusCode; this.reasonPhrase = reasonPhrase; this.family = LensHttpStatus.familyOf(statusCode); } public String toString() { return this.reasonPhrase; } public static Response.StatusType fromStatusCode(int statusCode) { // Delegate all status code calls to Response.Status. // Compute status code from LensHttpStatus only if it does not get status code from Status. Response.StatusType httpStatusCode = Response.Status.fromStatusCode(statusCode); if (httpStatusCode == null) { LensHttpStatus[] arr = values(); int len = arr.length; for (int i = 0; i < len; ++i) { LensHttpStatus lensHttpStatus = arr[i]; if (lensHttpStatus.statusCode == statusCode) { return lensHttpStatus; } } } return httpStatusCode; } public static Response.Status.Family familyOf(int statusCode) { return Response.Status.Family.familyOf(statusCode); } }
archanah24/lens
lens-api/src/main/java/org/apache/lens/api/error/LensHttpStatus.java
Java
apache-2.0
2,173
package com.tonicartos.superslim; import android.app.Application; import android.test.ApplicationTestCase; /** * <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a> */ public class ApplicationTest extends ApplicationTestCase<Application> { public ApplicationTest() { super(Application.class); } }
pacificIT/SuperSLiM
library/src/androidTest/java/com/tonicartos/superslim/ApplicationTest.java
Java
apache-2.0
355
/* * Copyright 2003-2014 Dave Griffith, Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.siyeh.ig.classlayout; import com.intellij.codeInsight.AnnotationUtil; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.psi.*; import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.BaseInspection; import com.siyeh.ig.BaseInspectionVisitor; import com.siyeh.ig.InspectionGadgetsFix; import com.siyeh.ig.fixes.RemoveModifierFix; import org.jetbrains.annotations.NotNull; public class FinalMethodInFinalClassInspection extends BaseInspection { @Override public BaseInspectionVisitor buildVisitor() { return new FinalMethodInFinalClassVisitor(); } @Override @NotNull protected String buildErrorString(Object... infos) { return InspectionGadgetsBundle.message( "final.method.in.final.class.problem.descriptor"); } @Override public InspectionGadgetsFix buildFix(Object... infos) { return new RemoveModifierFix(PsiModifier.FINAL); } private static class FinalMethodInFinalClassVisitor extends BaseInspectionVisitor { @Override public void visitMethod(@NotNull PsiMethod method) { if (!method.hasModifierProperty(PsiModifier.FINAL)) { return; } if (!method.hasModifierProperty(PsiModifier.STATIC) && AnnotationUtil.findAnnotation(method, true, CommonClassNames.JAVA_LANG_SAFE_VARARGS) != null) { return; } final PsiClass containingClass = method.getContainingClass(); if (containingClass == null || containingClass.isEnum()) { return; } if (!containingClass.hasModifierProperty(PsiModifier.FINAL)) { return; } final PsiModifierList modifiers = method.getModifierList(); final PsiElement[] children = modifiers.getChildren(); for (final PsiElement child : children) { final String text = child.getText(); if (PsiModifier.FINAL.equals(text)) { registerError(child, ProblemHighlightType.LIKE_UNUSED_SYMBOL); } } } } }
siosio/intellij-community
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/classlayout/FinalMethodInFinalClassInspection.java
Java
apache-2.0
2,583
using System; using System.Linq; using System.Management.Automation; using Microsoft.SharePoint.Client; using OfficeDevPnP.PowerShell.CmdletHelpAttributes; using OfficeDevPnP.PowerShell.Commands.Base.PipeBinds; namespace OfficeDevPnP.PowerShell.Commands.Lists { [Cmdlet(VerbsCommon.Set, "SPOListPermission")] [CmdletHelp("Sets list permissions", Category = "Lists")] public class SetListPermission : SPOWebCmdlet { [Parameter(Mandatory = true, ParameterSetName = ParameterAttribute.AllParameterSets)] public ListPipeBind Identity; [Parameter(Mandatory = true, ParameterSetName = "Group")] public GroupPipeBind Group; [Parameter(Mandatory = true, ParameterSetName = "User")] public string User; [Parameter(Mandatory = false)] public string AddRole = string.Empty; [Parameter(Mandatory = false)] public string RemoveRole = string.Empty; protected override void ExecuteCmdlet() { var list = Identity.GetList(SelectedWeb); if (list != null) { Principal principal = null; if (ParameterSetName == "Group") { if (Group.Id != -1) { principal = SelectedWeb.SiteGroups.GetById(Group.Id); } else if (!string.IsNullOrEmpty(Group.Name)) { principal = SelectedWeb.SiteGroups.GetByName(Group.Name); } else if (Group.Group != null) { principal = Group.Group; } } else { principal = SelectedWeb.EnsureUser(User); } if (principal != null) { if (!string.IsNullOrEmpty(AddRole)) { var roleDefinition = SelectedWeb.RoleDefinitions.GetByName(AddRole); var roleDefinitionBindings = new RoleDefinitionBindingCollection(ClientContext); roleDefinitionBindings.Add(roleDefinition); var roleAssignments = list.RoleAssignments; roleAssignments.Add(principal, roleDefinitionBindings); ClientContext.Load(roleAssignments); ClientContext.ExecuteQueryRetry(); } if (!string.IsNullOrEmpty(RemoveRole)) { var roleAssignment = list.RoleAssignments.GetByPrincipal(principal); var roleDefinitionBindings = roleAssignment.RoleDefinitionBindings; ClientContext.Load(roleDefinitionBindings); ClientContext.ExecuteQueryRetry(); foreach (var roleDefinition in roleDefinitionBindings.Where(roleDefinition => roleDefinition.Name == RemoveRole)) { roleDefinitionBindings.Remove(roleDefinition); roleAssignment.Update(); ClientContext.ExecuteQueryRetry(); break; } } } else { WriteError(new ErrorRecord(new Exception("Principal not found"), "1", ErrorCategory.ObjectNotFound, null)); } } } } }
rroman81/PnP
Solutions/PowerShell.Commands/Commands/Lists/SetListPermission.cs
C#
apache-2.0
3,597
// Copyright (C) 2009 The Android Open Source Project // // Licensed under the Apache License, Version 2.0 (the "License"); // you may not use this file except in compliance with the License. // You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, software // distributed under the License is distributed on an "AS IS" BASIS, // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. // See the License for the specific language governing permissions and // limitations under the License. package com.google.gerrit.server.query; import com.google.gwtorm.client.OrmException; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.List; /** Requires all predicates to be true. */ public class AndPredicate<T> extends Predicate<T> { private final List<Predicate<T>> children; private final int cost; protected AndPredicate(final Predicate<T>... that) { this(Arrays.asList(that)); } protected AndPredicate(final Collection<? extends Predicate<T>> that) { final ArrayList<Predicate<T>> t = new ArrayList<Predicate<T>>(that.size()); int c = 0; for (Predicate<T> p : that) { if (getClass() == p.getClass()) { for (Predicate<T> gp : p.getChildren()) { t.add(gp); c += gp.getCost(); } } else { t.add(p); c += p.getCost(); } } if (t.size() < 2) { throw new IllegalArgumentException("Need at least two predicates"); } children = t; cost = c; } @Override public final List<Predicate<T>> getChildren() { return Collections.unmodifiableList(children); } @Override public final int getChildCount() { return children.size(); } @Override public final Predicate<T> getChild(final int i) { return children.get(i); } @Override public Predicate<T> copy(final Collection<? extends Predicate<T>> children) { return new AndPredicate<T>(children); } @Override public boolean match(final T object) throws OrmException { for (final Predicate<T> c : children) { if (!c.match(object)) { return false; } } return true; } @Override public int getCost() { return cost; } @Override public int hashCode() { return getChild(0).hashCode() * 31 + getChild(1).hashCode(); } @Override public boolean equals(final Object other) { if (other == null) return false; return getClass() == other.getClass() && getChildren().equals(((Predicate<?>) other).getChildren()); } @Override public final String toString() { final StringBuilder r = new StringBuilder(); r.append("("); for (int i = 0; i < getChildCount(); i++) { if (i != 0) { r.append(" "); } r.append(getChild(i)); } r.append(")"); return r.toString(); } }
duboisf/gerrit
gerrit-server/src/main/java/com/google/gerrit/server/query/AndPredicate.java
Java
apache-2.0
2,984
/* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.isis.applib.query; import java.io.Serializable; /** * Although implements {@link Query} and thus is intended to be (and indeed is) * {@link Serializable}, it will be converted into a <tt>PersistenceQuery</tt> * in the runtime for remoting purposes. * * <p> * See discussion in {@link QueryBuiltInAbstract} for further details. */ public class QueryFindAllInstances<T> extends QueryBuiltInAbstract<T> { private static final long serialVersionUID = 1L; public QueryFindAllInstances(final Class<T> type, final long ... range) { super(type, range); } public QueryFindAllInstances(final String typeName, final long ... range) { super(typeName, range); } @Override public String getDescription() { return getResultTypeName() + " (all instances)"; } }
howepeng/isis
core/applib/src/main/java/org/apache/isis/applib/query/QueryFindAllInstances.java
Java
apache-2.0
1,663
# vim: tabstop=4 shiftwidth=4 softtabstop=4 # Copyright 2013 Cloudbase Solutions Srl # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. import mock from nova import test from nova.virt.hyperv import vmutils class VMUtilsTestCase(test.NoDBTestCase): """Unit tests for the Hyper-V VMUtils class.""" _FAKE_VM_NAME = 'fake_vm' _FAKE_MEMORY_MB = 2 _FAKE_VM_PATH = "fake_vm_path" def setUp(self): self._vmutils = vmutils.VMUtils() self._vmutils._conn = mock.MagicMock() super(VMUtilsTestCase, self).setUp() def test_enable_vm_metrics_collection(self): self.assertRaises(NotImplementedError, self._vmutils.enable_vm_metrics_collection, self._FAKE_VM_NAME) def _lookup_vm(self): mock_vm = mock.MagicMock() self._vmutils._lookup_vm_check = mock.MagicMock( return_value=mock_vm) mock_vm.path_.return_value = self._FAKE_VM_PATH return mock_vm def test_set_vm_memory_static(self): self._test_set_vm_memory_dynamic(1.0) def test_set_vm_memory_dynamic(self): self._test_set_vm_memory_dynamic(2.0) def _test_set_vm_memory_dynamic(self, dynamic_memory_ratio): mock_vm = self._lookup_vm() mock_s = self._vmutils._conn.Msvm_VirtualSystemSettingData()[0] mock_s.SystemType = 3 mock_vmsetting = mock.MagicMock() mock_vmsetting.associators.return_value = [mock_s] self._vmutils._modify_virt_resource = mock.MagicMock() self._vmutils._set_vm_memory(mock_vm, mock_vmsetting, self._FAKE_MEMORY_MB, dynamic_memory_ratio) self._vmutils._modify_virt_resource.assert_called_with( mock_s, self._FAKE_VM_PATH) if dynamic_memory_ratio > 1: self.assertTrue(mock_s.DynamicMemoryEnabled) else: self.assertFalse(mock_s.DynamicMemoryEnabled)
ntt-sic/nova
nova/tests/virt/hyperv/test_vmutils.py
Python
apache-2.0
2,546
/* Copyright 2017 The Kubernetes Authors. Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. */ package internalversion import ( v1 "k8s.io/apimachinery/pkg/apis/meta/v1" types "k8s.io/apimachinery/pkg/types" watch "k8s.io/apimachinery/pkg/watch" api "k8s.io/kubernetes/pkg/api" batch "k8s.io/kubernetes/pkg/apis/batch" restclient "k8s.io/kubernetes/pkg/client/restclient" ) // CronJobsGetter has a method to return a CronJobInterface. // A group's client should implement this interface. type CronJobsGetter interface { CronJobs(namespace string) CronJobInterface } // CronJobInterface has methods to work with CronJob resources. type CronJobInterface interface { Create(*batch.CronJob) (*batch.CronJob, error) Update(*batch.CronJob) (*batch.CronJob, error) UpdateStatus(*batch.CronJob) (*batch.CronJob, error) Delete(name string, options *api.DeleteOptions) error DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error Get(name string, options v1.GetOptions) (*batch.CronJob, error) List(opts api.ListOptions) (*batch.CronJobList, error) Watch(opts api.ListOptions) (watch.Interface, error) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *batch.CronJob, err error) CronJobExpansion } // cronJobs implements CronJobInterface type cronJobs struct { client restclient.Interface ns string } // newCronJobs returns a CronJobs func newCronJobs(c *BatchClient, namespace string) *cronJobs { return &cronJobs{ client: c.RESTClient(), ns: namespace, } } // Create takes the representation of a cronJob and creates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *cronJobs) Create(cronJob *batch.CronJob) (result *batch.CronJob, err error) { result = &batch.CronJob{} err = c.client.Post(). Namespace(c.ns). Resource("cronjobs"). Body(cronJob). Do(). Into(result) return } // Update takes the representation of a cronJob and updates it. Returns the server's representation of the cronJob, and an error, if there is any. func (c *cronJobs) Update(cronJob *batch.CronJob) (result *batch.CronJob, err error) { result = &batch.CronJob{} err = c.client.Put(). Namespace(c.ns). Resource("cronjobs"). Name(cronJob.Name). Body(cronJob). Do(). Into(result) return } // UpdateStatus was generated because the type contains a Status member. // Add a +genclientstatus=false comment above the type to avoid generating UpdateStatus(). func (c *cronJobs) UpdateStatus(cronJob *batch.CronJob) (result *batch.CronJob, err error) { result = &batch.CronJob{} err = c.client.Put(). Namespace(c.ns). Resource("cronjobs"). Name(cronJob.Name). SubResource("status"). Body(cronJob). Do(). Into(result) return } // Delete takes name of the cronJob and deletes it. Returns an error if one occurs. func (c *cronJobs) Delete(name string, options *api.DeleteOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). Name(name). Body(options). Do(). Error() } // DeleteCollection deletes a collection of objects. func (c *cronJobs) DeleteCollection(options *api.DeleteOptions, listOptions api.ListOptions) error { return c.client.Delete(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&listOptions, api.ParameterCodec). Body(options). Do(). Error() } // Get takes name of the cronJob, and returns the corresponding cronJob object, and an error if there is any. func (c *cronJobs) Get(name string, options v1.GetOptions) (result *batch.CronJob, err error) { result = &batch.CronJob{} err = c.client.Get(). Namespace(c.ns). Resource("cronjobs"). Name(name). VersionedParams(&options, api.ParameterCodec). Do(). Into(result) return } // List takes label and field selectors, and returns the list of CronJobs that match those selectors. func (c *cronJobs) List(opts api.ListOptions) (result *batch.CronJobList, err error) { result = &batch.CronJobList{} err = c.client.Get(). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&opts, api.ParameterCodec). Do(). Into(result) return } // Watch returns a watch.Interface that watches the requested cronJobs. func (c *cronJobs) Watch(opts api.ListOptions) (watch.Interface, error) { return c.client.Get(). Prefix("watch"). Namespace(c.ns). Resource("cronjobs"). VersionedParams(&opts, api.ParameterCodec). Watch() } // Patch applies the patch and returns the patched cronJob. func (c *cronJobs) Patch(name string, pt types.PatchType, data []byte, subresources ...string) (result *batch.CronJob, err error) { result = &batch.CronJob{} err = c.client.Patch(pt). Namespace(c.ns). Resource("cronjobs"). SubResource(subresources...). Name(name). Body(data). Do(). Into(result) return }
vwfs/fork-kubernetes
pkg/client/clientset_generated/internalclientset/typed/batch/internalversion/cronjob.go
GO
apache-2.0
5,283
# Copyright 2011 OpenStack LLC # All Rights Reserved. # # Licensed under the Apache License, Version 2.0 (the "License"); you may # not use this file except in compliance with the License. You may obtain # a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, WITHOUT # WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the # License for the specific language governing permissions and limitations # under the License. from sqlalchemy import Column, Integer, MetaData, String, Table meta = MetaData() # Table stub-definitions # Just for the ForeignKey and column creation to succeed, these are not the # actual definitions of instances or services. # fixed_ips = Table( "fixed_ips", meta, Column( "id", Integer(), primary_key=True, nullable=False)) # # New Tables # # None # # Tables to alter # # None # # Columns to add to existing tables # fixed_ips_addressV6 = Column( "addressV6", String( length=255, convert_unicode=False, assert_unicode=None, unicode_error=None, _warn_on_bytestring=False)) fixed_ips_netmaskV6 = Column( "netmaskV6", String( length=3, convert_unicode=False, assert_unicode=None, unicode_error=None, _warn_on_bytestring=False)) fixed_ips_gatewayV6 = Column( "gatewayV6", String( length=255, convert_unicode=False, assert_unicode=None, unicode_error=None, _warn_on_bytestring=False)) def upgrade(migrate_engine): # Upgrade operations go here. Don't create your own engine; # bind migrate_engine to your metadata meta.bind = migrate_engine # Add columns to existing tables fixed_ips.create_column(fixed_ips_addressV6) fixed_ips.create_column(fixed_ips_netmaskV6) fixed_ips.create_column(fixed_ips_gatewayV6)
nii-cloud/dodai-compute
nova/db/sqlalchemy/migrate_repo/versions/007_add_ipv6_to_fixed_ips.py
Python
apache-2.0
2,067
#region License /* * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ #endregion namespace Gremlin.Net.Structure.IO.GraphSON { internal class GraphSONTokens { public static string TypeKey = "@type"; public static string ValueKey = "@value"; public static string GremlinTypeNamespace = "g"; } }
jorgebay/tinkerpop
gremlin-dotnet/src/Gremlin.Net/Structure/IO/GraphSON/GraphSONTokens.cs
C#
apache-2.0
1,091
-- Source: https://github.com/soumith/imagenet-multiGPU.torch/blob/master/donkey.lua -- -- Copyright (c) 2014, Facebook, Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. An additional grant -- of patent rights can be found in the PATENTS file in the same directory. -- local gm = assert(require 'graphicsmagick') paths.dofile('dataset.lua') paths.dofile('util.lua') ffi=require 'ffi' -- This file contains the data-loading logic and details. -- It is run by each data-loader thread. ------------------------------------------ -- a cache file of the training metadata (if doesnt exist, will be created) local trainCache = paths.concat(opt.cache, 'trainCache.t7') -- local testCache = paths.concat(opt.cache, 'testCache.t7') -- Check for existence of opt.data if not os.execute('cd ' .. opt.data) then error(("could not chdir to '%s'"):format(opt.data)) end local loadSize = {3, opt.imgDim, opt.imgDim} local sampleSize = {3, opt.imgDim, opt.imgDim} -- function to load the image, jitter it appropriately (random crops etc.) local trainHook = function(self, path) -- load image with size hints local input = gm.Image():load(path, self.loadSize[3], self.loadSize[2]) input:size(self.sampleSize[3], self.sampleSize[2]) local out = input -- do hflip with probability 0.5 if torch.uniform() > 0.5 then out:flop(); end out = out:toTensor('float','RGB','DHW') return out end if paths.filep(trainCache) then print('Loading train metadata from cache') trainLoader = torch.load(trainCache) trainLoader.sampleHookTrain = trainHook else print('Creating train metadata') trainLoader = dataLoader{ paths = {paths.concat(opt.data)}, loadSize = loadSize, sampleSize = sampleSize, split = 100, verbose = true } torch.save(trainCache, trainLoader) trainLoader.sampleHookTrain = trainHook end collectgarbage() -- do some sanity checks on trainLoader do local class = trainLoader.imageClass local nClasses = #trainLoader.classes assert(class:max() <= nClasses, "class logic has error") assert(class:min() >= 1, "class logic has error") end -- End of train loader section -------------------------------------------------------------------------------- --[[ Section 2: Create a test data loader (testLoader), ]]-- -- if opt.testEpochSize > 0 then -- if paths.filep(testCache) then -- print('Loading test metadata from cache') -- testLoader = torch.load(testCache) -- else -- print('Creating test metadata') -- testLoader = dataLoader{ -- paths = {paths.concat(opt.data, 'val')}, -- loadSize = loadSize, -- sampleSize = sampleSize, -- -- split = 0, -- split = 100, -- verbose = true, -- -- force consistent class indices between trainLoader and testLoader -- forceClasses = trainLoader.classes -- } -- torch.save(testCache, testLoader) -- end -- collectgarbage() -- end -- -- End of test loader section
nmabhi/Webface
training/donkey.lua
Lua
apache-2.0
3,091
/** ****************************************************************************** * @file stm32f3xx_hal_pcd_ex.h * @author MCD Application Team * @brief Header file of PCD HAL Extension module. ****************************************************************************** * @attention * * <h2><center>&copy; COPYRIGHT(c) 2016 STMicroelectronics</center></h2> * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * 1. Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * 2. Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * 3. Neither the name of STMicroelectronics nor the names of its contributors * may be used to endorse or promote products derived from this software * without specific prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER * CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. * ****************************************************************************** */ /* Define to prevent recursive inclusion -------------------------------------*/ #ifndef __STM32F3xx_HAL_PCD_EX_H #define __STM32F3xx_HAL_PCD_EX_H #ifdef __cplusplus extern "C" { #endif #if defined(STM32F302xE) || defined(STM32F303xE) || \ defined(STM32F302xC) || defined(STM32F303xC) || \ defined(STM32F302x8) || \ defined(STM32F373xC) /* Includes ------------------------------------------------------------------*/ #include "stm32f3xx_hal_def.h" /** @addtogroup STM32F3xx_HAL_Driver * @{ */ /** @addtogroup PCDEx * @{ */ /* Exported types ------------------------------------------------------------*/ /* Exported constants --------------------------------------------------------*/ /* Exported macros -----------------------------------------------------------*/ /** @defgroup PCDEx_Exported_Macros PCD Extended Exported Macros * @{ */ /** * @brief Gets address in an endpoint register. * @param USBx USB peripheral instance register address. * @param bEpNum Endpoint Number. * @retval None */ #if defined(STM32F302xC) || defined(STM32F303xC) || \ defined(STM32F373xC) #define PCD_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8)*2+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_EP_TX_CNT(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8+2)*2+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_EP_RX_ADDRESS(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8+4)*2+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_EP_RX_CNT(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8+6)*2+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_SET_EP_RX_CNT(USBx, bEpNum,wCount) {\ uint16_t *pdwReg =PCD_EP_RX_CNT((USBx),(bEpNum)); \ PCD_SET_EP_CNT_RX_REG((pdwReg), (wCount))\ } #endif /* STM32F302xC || STM32F303xC || */ /* STM32F373xC */ #if defined(STM32F302xE) || defined(STM32F303xE) || \ defined(STM32F302x8) #define PCD_EP_TX_ADDRESS(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8)+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_EP_TX_CNT(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8+2)+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_EP_RX_ADDRESS(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8+4)+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_EP_RX_CNT(USBx, bEpNum) ((uint16_t *)((uint32_t)((((USBx)->BTABLE+(bEpNum)*8+6)+ ((uint32_t)(USBx) + 0x400U))))) #define PCD_SET_EP_RX_CNT(USBx, bEpNum,wCount) {\ uint16_t *pdwReg = PCD_EP_RX_CNT((USBx), (bEpNum));\ PCD_SET_EP_CNT_RX_REG((pdwReg), (wCount))\ } #endif /* STM32F302xE || STM32F303xE || */ /* STM32F302x8 */ /** * @} */ /* Exported functions --------------------------------------------------------*/ /** @addtogroup PCDEx_Exported_Functions PCDEx Exported Functions * @{ */ /** @addtogroup PCDEx_Exported_Functions_Group1 Peripheral Control functions * @{ */ HAL_StatusTypeDef HAL_PCDEx_PMAConfig(PCD_HandleTypeDef *hpcd, uint16_t ep_addr, uint16_t ep_kind, uint32_t pmaadress); void HAL_PCDEx_SetConnectionState(PCD_HandleTypeDef *hpcd, uint8_t state); /** * @} */ /** * @} */ /** * @} */ /** * @} */ #endif /* STM32F302xE || STM32F303xE || */ /* STM32F302xC || STM32F303xC || */ /* STM32F302x8 || */ /* STM32F373xC */ #ifdef __cplusplus } #endif #endif /* __STM32F3xx_HAL_PCD_EX_H */ /************************ (C) COPYRIGHT STMicroelectronics *****END OF FILE****/
fbsder/zephyr
ext/hal/st/stm32cube/stm32f3xx/drivers/include/stm32f3xx_hal_pcd_ex.h
C
apache-2.0
5,732
// <auto-generated> // Copyright (c) Microsoft Corporation. All rights reserved. // Licensed under the MIT License. See License.txt in the project root for // license information. // // Code generated by Microsoft (R) AutoRest Code Generator. // Changes may cause incorrect behavior and will be lost if the code is // regenerated. // </auto-generated> namespace Microsoft.Azure.Management.Network.Models { /// <summary> /// Defines values for FirewallPolicyRuleNetworkProtocol. /// </summary> public static class FirewallPolicyRuleNetworkProtocol { public const string TCP = "TCP"; public const string UDP = "UDP"; public const string Any = "Any"; public const string ICMP = "ICMP"; } }
yugangw-msft/azure-sdk-for-net
sdk/network/Microsoft.Azure.Management.Network/src/Generated/Models/FirewallPolicyRuleNetworkProtocol.cs
C#
apache-2.0
745
/* * #%L * ACS AEM Commons Package * %% * Copyright (C) 2014 Adobe * %% * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * #L% */ /*global angular: false, ace: false qrCode: false*/ angular.module('acs-commons-instant-package-app', ['acsCoral', 'ACS.Commons.notifications']).controller('MainCtrl', ['$scope', '$http', '$timeout', 'NotificationsService', function ($scope, $http, $timeout, NotificationsService) { $scope.app = { uri: '' }; $scope.form = { enabled: false }; $scope.init = function(appUri) { $scope.app.uri = appUri; $http({ method: 'GET', url: $scope.app.uri + '/config/enabled' }).success(function (data) { $scope.form.enabled = data; }).error(function (data, status) { // Response code 404 will be when configs are not available if (status !== 404) { NotificationsService.add('error', "Error", "Something went wrong while fetching previous configurations"); } }); }; $scope.saveConfig = function () { $http({ method: 'POST', url: $scope.app.uri + '/config', data: 'enabled=' + $scope.form.enabled || 'false', headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }). success(function (data, status, headers, config) { if ($scope.form.enabled) { $http({ method: 'POST', url: $scope.app.uri, data: './clientlib-authoring/categories@TypeHint=String[]&./clientlib-authoring/categories=cq.wcm.sites&./clientlib-authoring/categories=dam.gui.admin.coral', headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); } else { $http({ method: 'POST', url: $scope.app.uri, data: './clientlib-authoring/categories@Delete', headers: { 'Content-Type': 'application/x-www-form-urlencoded' } }); } $scope.app.running = false; NotificationsService.add('success', "Success", "Your configuration has been saved"); NotificationsService.running($scope.app.running); }). error(function (data) { NotificationsService.add('error', 'ERROR', data.title + '. ' + data.message); $scope.app.running = false; NotificationsService.running($scope.app.running); }); }; }]);
dfoerderreuther/acs-aem-commons
ui.apps/src/main/content/jcr_root/apps/acs-commons/components/utilities/instant-package/clientlibs/js/app.js
JavaScript
apache-2.0
3,224
#!/usr/bin/env python """ Copyright (c) 2004-Present Pivotal Software, Inc. This program and the accompanying materials are made available under the terms of the under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License. """ from gppylib.commands.base import Command from gppylib.db import dbconn from tinctest import logger from mpp.lib.PSQL import PSQL from mpp.models import MPPTestCase from mpp.gpdb.tests.storage.walrepl import lib as walrepl import mpp.gpdb.tests.storage.walrepl.run import os import shutil import subprocess class basebackup_cases(mpp.gpdb.tests.storage.walrepl.run.StandbyRunMixin, MPPTestCase): def tearDown(self): super(basebackup_cases, self).tearDown() self.reset_fault('base_backup_post_create_checkpoint') def run_gpfaultinjector(self, fault_type, fault_name): cmd_str = 'gpfaultinjector -s 1 -y {0} -f {1}'.format( fault_type, fault_name) cmd = Command(cmd_str, cmd_str) cmd.run() return cmd.get_results() def resume(self, fault_name): return self.run_gpfaultinjector('resume', fault_name) def suspend_at(self, fault_name): return self.run_gpfaultinjector('suspend', fault_name) def reset_fault(self, fault_name): return self.run_gpfaultinjector('reset', fault_name) def fault_status(self, fault_name): return self.run_gpfaultinjector('status', fault_name) def wait_triggered(self, fault_name): search = "fault injection state:'triggered'" for i in walrepl.polling(10, 3): result = self.fault_status(fault_name) stdout = result.stdout if stdout.find(search) > 0: return True return False def test_xlogcleanup(self): """ Test for verifying if xlog seg created while basebackup dumps out data does not get cleaned """ shutil.rmtree('base', True) PSQL.run_sql_command('DROP table if exists foo') # Inject fault at post checkpoint create (basebackup) logger.info ('Injecting base_backup_post_create_checkpoint fault ...') result = self.suspend_at( 'base_backup_post_create_checkpoint') logger.info(result.stdout) self.assertEqual(result.rc, 0, result.stdout) # Now execute basebackup. It will be blocked due to the # injected fault. logger.info ('Perform basebackup with xlog & recovery.conf...') pg_basebackup = subprocess.Popen(['pg_basebackup', '-x', '-R', '-D', 'base'] , stdout = subprocess.PIPE , stderr = subprocess.PIPE) # Give basebackup a moment to reach the fault & # trigger it logger.info('Check if suspend fault is hit ...') triggered = self.wait_triggered( 'base_backup_post_create_checkpoint') self.assertTrue(triggered, 'Fault was not triggered') # Perform operations that causes xlog seg generation logger.info ('Performing xlog seg generation ...') count = 0 while (count < 10): PSQL.run_sql_command('select pg_switch_xlog(); select pg_switch_xlog(); checkpoint;') count = count + 1 # Resume basebackup result = self.resume('base_backup_post_create_checkpoint') logger.info(result.stdout) self.assertEqual(result.rc, 0, result.stdout) # Wait until basebackup end logger.info('Waiting for basebackup to end ...') sql = "SELECT count(*) FROM pg_stat_replication" with dbconn.connect(dbconn.DbURL(), utility=True) as conn: while (True): curs = dbconn.execSQL(conn, sql) results = curs.fetchall() if (int(results[0][0]) == 0): break; # Verify if basebackup completed successfully # See if recovery.conf exists (Yes - Pass) self.assertTrue(os.path.exists(os.path.join('base','recovery.conf'))) logger.info ('Found recovery.conf in the backup directory.') logger.info ('Pass')
edespino/gpdb
src/test/tinc/tincrepo/mpp/gpdb/tests/storage/walrepl/basebackup/test_xlog_cleanup.py
Python
apache-2.0
4,635
<html> <head> <script> window.location.replace("{{ page.redirect }}" + window.location.hash); </script> <!-- Fall back to a <meta> redirect if the user has JavaScript disabled. --> <meta http-equiv="refresh" content="0;url={{ page.redirect }}"> </head> </html>
twitter-forks/bazel
site/_layouts/redirect.html
HTML
apache-2.0
287
/* * Copyright 2003-2017 Dave Griffith, Bas Leijdekkers * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package com.siyeh.ig.controlflow; import com.intellij.codeInspection.CleanupLocalInspectionTool; import com.intellij.codeInspection.ProblemDescriptor; import com.intellij.codeInspection.ProblemHighlightType; import com.intellij.codeInspection.SetInspectionOptionFix; import com.intellij.codeInspection.ui.MultipleCheckboxOptionsPanel; import com.intellij.openapi.project.Project; import com.intellij.profile.codeInspection.InspectionProjectProfileManager; import com.intellij.psi.*; import com.intellij.psi.util.PsiTreeUtil; import com.intellij.psi.util.PsiUtilCore; import com.intellij.util.SmartList; import com.siyeh.InspectionGadgetsBundle; import com.siyeh.ig.BaseInspection; import com.siyeh.ig.BaseInspectionVisitor; import com.siyeh.ig.DelegatingFix; import com.siyeh.ig.InspectionGadgetsFix; import com.siyeh.ig.psiutils.BoolUtils; import com.siyeh.ig.psiutils.CommentTracker; import com.siyeh.ig.psiutils.ControlFlowUtils; import com.siyeh.ig.style.ConditionalExpressionGenerator; import com.siyeh.ig.style.IfConditionalModel; import org.intellij.lang.annotations.Pattern; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; import javax.swing.*; import java.util.List; import java.util.Objects; public class TrivialIfInspection extends BaseInspection implements CleanupLocalInspectionTool { public boolean ignoreChainedIf = false; public boolean ignoreAssertStatements = false; @Pattern(VALID_ID_PATTERN) @Override public @NotNull String getID() { return "RedundantIfStatement"; } @Override public @Nullable JComponent createOptionsPanel() { final MultipleCheckboxOptionsPanel panel = new MultipleCheckboxOptionsPanel(this); panel.addCheckbox(InspectionGadgetsBundle.message("trivial.if.option.ignore.chained"), "ignoreChainedIf"); panel.addCheckbox(InspectionGadgetsBundle.message("trivial.if.option.ignore.assert.statements"), "ignoreAssertStatements"); return panel; } @Override public boolean isEnabledByDefault() { return true; } @Override protected @NotNull String buildErrorString(Object... infos) { return InspectionGadgetsBundle.message("trivial.if.problem.descriptor"); } @Override protected InspectionGadgetsFix @NotNull [] buildFixes(Object... infos) { List<InspectionGadgetsFix> fixes = new SmartList<>(new TrivialIfFix()); boolean addIgnoreChainedIfFix = (boolean)infos[0]; if (addIgnoreChainedIfFix) { fixes.add(new DelegatingFix(new SetInspectionOptionFix( this, "ignoreChainedIf", InspectionGadgetsBundle.message("trivial.if.option.ignore.chained"), true))); } boolean addIgnoreAssertStatementsFix = (boolean)infos[1]; if (addIgnoreAssertStatementsFix) { fixes.add(new DelegatingFix(new SetInspectionOptionFix( this, "ignoreAssertStatements", InspectionGadgetsBundle.message("trivial.if.option.ignore.assert.statements"), true))); } return fixes.toArray(InspectionGadgetsFix.EMPTY_ARRAY); } private static class TrivialIfFix extends InspectionGadgetsFix { @Override public @NotNull String getFamilyName() { return InspectionGadgetsBundle.message("trivial.if.fix.family.name"); } @Override public void doFix(Project project, ProblemDescriptor descriptor) { final PsiElement ifKeywordElement = descriptor.getPsiElement(); final PsiIfStatement statement = (PsiIfStatement)ifKeywordElement.getParent(); simplify(statement); } } private static void simplify(PsiIfStatement statement) { IfConditionalModel model = IfConditionalModel.from(statement, true); if (model != null) { ConditionalExpressionGenerator generator = ConditionalExpressionGenerator.from(model); if (generator != null) { CommentTracker ct = new CommentTracker(); String text = generator.generate(ct); if (model.getElseExpression().textMatches(text) && !PsiTreeUtil.isAncestor(statement, model.getElseBranch(), false)) { ct.deleteAndRestoreComments(statement); } else if (model.getElseBranch() instanceof PsiDeclarationStatement){ ct.replace(model.getElseExpression(), text); ct.deleteAndRestoreComments(statement); } else { ct.replace(model.getThenExpression(), text); ct.replaceAndRestoreComments(statement, model.getThenBranch()); PsiStatement elseBranch = model.getElseBranch(); if (elseBranch.isValid() && (elseBranch instanceof PsiExpressionStatement || !ControlFlowUtils.isReachable(elseBranch))) { PsiElement sibling = elseBranch.getPrevSibling(); if (sibling instanceof PsiWhiteSpace) { sibling.delete(); } new CommentTracker().deleteAndRestoreComments(elseBranch); } } } } if (isSimplifiableAssert(statement)) { replaceSimplifiableAssert(statement); } } private static void replaceSimplifiableAssert(PsiIfStatement statement) { final PsiExpression condition = statement.getCondition(); if (condition == null) { return; } final String conditionText = BoolUtils.getNegatedExpressionText(condition); if (statement.getElseBranch() != null) { return; } final PsiStatement thenBranch = ControlFlowUtils.stripBraces(statement.getThenBranch()); if (!(thenBranch instanceof PsiAssertStatement)) { return; } final PsiAssertStatement assertStatement = (PsiAssertStatement)thenBranch; final PsiExpression assertCondition = assertStatement.getAssertCondition(); if (assertCondition == null) { return; } final PsiExpression replacementCondition = JavaPsiFacade.getElementFactory(statement.getProject()).createExpressionFromText( BoolUtils.isFalse(assertCondition) ? conditionText : conditionText + "||" + assertCondition.getText(), statement); assertCondition.replace(replacementCondition); statement.replace(assertStatement); } @Override public BaseInspectionVisitor buildVisitor() { return new BaseInspectionVisitor() { @Override public void visitIfStatement(@NotNull PsiIfStatement ifStatement) { super.visitIfStatement(ifStatement); boolean chainedIf = PsiTreeUtil.skipWhitespacesAndCommentsBackward(ifStatement) instanceof PsiIfStatement || (ifStatement.getParent() instanceof PsiIfStatement && ((PsiIfStatement)ifStatement.getParent()).getElseBranch() == ifStatement); if (ignoreChainedIf && chainedIf && !isOnTheFly()) return; final PsiExpression condition = ifStatement.getCondition(); if (condition == null) { return; } if (isTrivial(ifStatement)) { PsiElement anchor = Objects.requireNonNull(ifStatement.getFirstChild()); ProblemHighlightType level = ignoreChainedIf && chainedIf ? ProblemHighlightType.INFORMATION : ProblemHighlightType.GENERIC_ERROR_OR_WARNING; boolean addIgnoreChainedIfFix = chainedIf && !ignoreChainedIf && !InspectionProjectProfileManager.isInformationLevel(getShortName(), ifStatement); boolean addIgnoreAssertStatementsFix = !ignoreAssertStatements && isSimplifiableAssert(ifStatement); registerError(anchor, level, addIgnoreChainedIfFix, addIgnoreAssertStatementsFix); } } }; } private boolean isTrivial(PsiIfStatement ifStatement) { if (PsiUtilCore.hasErrorElementChild(ifStatement)) { return false; } IfConditionalModel model = IfConditionalModel.from(ifStatement, true); if (model != null) { ConditionalExpressionGenerator generator = ConditionalExpressionGenerator.from(model); if (generator != null && generator.getTokenType().isEmpty()) return true; } return !ignoreAssertStatements && isSimplifiableAssert(ifStatement); } private static boolean isSimplifiableAssert(PsiIfStatement ifStatement) { if (ifStatement.getElseBranch() != null) { return false; } final PsiStatement thenBranch = ControlFlowUtils.stripBraces(ifStatement.getThenBranch()); if (!(thenBranch instanceof PsiAssertStatement)) { return false; } final PsiAssertStatement assertStatement = (PsiAssertStatement)thenBranch; return assertStatement.getAssertCondition() != null; } }
jwren/intellij-community
plugins/InspectionGadgets/InspectionGadgetsAnalysis/src/com/siyeh/ig/controlflow/TrivialIfInspection.java
Java
apache-2.0
8,998
using System.Threading.Tasks; using Nest; using Tests.Framework; using static Tests.Framework.UrlTester; namespace Tests.Modules.SnapshotAndRestore.Restore.Restore { public class RestoreUrlTests { [U] public async Task Urls() { var repository = "repos"; var snapshot = "snap"; await POST($"/_snapshot/{repository}/{snapshot}/_restore") .Fluent(c => c.Restore(repository, snapshot)) .Request(c => c.Restore(new RestoreRequest(repository, snapshot))) .FluentAsync(c => c.RestoreAsync(repository, snapshot)) .RequestAsync(c => c.RestoreAsync(new RestoreRequest(repository, snapshot))) ; } } }
CSGOpenSource/elasticsearch-net
src/Tests/Modules/SnapshotAndRestore/Restore/RestoreUrlTests.cs
C#
apache-2.0
633
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, * software distributed under the License is distributed on an * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * KIND, either express or implied. See the License for the * specific language governing permissions and limitations * under the License. */ package org.apache.apex.malhar.contrib.redis; import java.util.ArrayList; import java.util.List; import java.util.Map; import org.apache.apex.malhar.lib.util.KeyValPair; /** * This is the an implementation of a Redis input operator for fetching * Key-Value pair stored in Redis. It takes in keys to fetch and emits * corresponding <Key, Value> Pair. Value data type is String in this case. * * @displayName Redis Input Operator for Key Value pair * @category Store * @tags input operator, key value * * @since 3.1.0 */ public class RedisKeyValueInputOperator extends AbstractRedisInputOperator<KeyValPair<String, String>> { private List<Object> keysObjectList = new ArrayList<Object>(); @Override public void processTuples() { keysObjectList = new ArrayList<Object>(keys); if (keysObjectList.size() > 0) { List<Object> allValues = store.getAll(keysObjectList); for (int i = 0; i < allValues.size() && i < keys.size(); i++) { if (allValues.get(i) == null) { outputPort.emit(new KeyValPair<String, String>(keys.get(i), null)); } else { outputPort.emit(new KeyValPair<String, String>(keys.get(i), allValues.get(i).toString())); } } keys.clear(); keysObjectList.clear(); } } @Override public KeyValPair<String, String> convertToTuple(Map<Object, Object> o) { // Do nothing for the override, Scan already done in processTuples return null; } }
ananthc/apex-malhar
contrib/src/main/java/org/apache/apex/malhar/contrib/redis/RedisKeyValueInputOperator.java
Java
apache-2.0
2,277
// Licensed to the Apache Software Foundation (ASF) under one // or more contributor license agreements. See the NOTICE file // distributed with this work for additional information // regarding copyright ownership. The ASF licenses this file // to you under the Apache License, Version 2.0 (the // "License"); you may not use this file except in compliance // with the License. You may obtain a copy of the License at // // http://www.apache.org/licenses/LICENSE-2.0 // // Unless required by applicable law or agreed to in writing, // software distributed under the License is distributed on an // "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY // KIND, either express or implied. See the License for the // specific language governing permissions and limitations // under the License. #pragma once #include <memory> #include <vector> #include "gandiva/arrow.h" #include "gandiva/function_signature.h" #include "gandiva/gandiva_aliases.h" #include "gandiva/visibility.h" namespace gandiva { class NativeFunction; class FunctionRegistry; /// \brief Exports types supported by Gandiva for processing. /// /// Has helper methods for clients to programmatically discover /// data types and functions supported by Gandiva. class GANDIVA_EXPORT ExpressionRegistry { public: using native_func_iterator_type = const NativeFunction*; using func_sig_iterator_type = const FunctionSignature*; ExpressionRegistry(); ~ExpressionRegistry(); static DataTypeVector supported_types() { return supported_types_; } class GANDIVA_EXPORT FunctionSignatureIterator { public: explicit FunctionSignatureIterator(native_func_iterator_type nf_it, native_func_iterator_type nf_it_end_); explicit FunctionSignatureIterator(func_sig_iterator_type fs_it); bool operator!=(const FunctionSignatureIterator& func_sign_it); FunctionSignature operator*(); func_sig_iterator_type operator++(int); private: native_func_iterator_type native_func_it_; const native_func_iterator_type native_func_it_end_; func_sig_iterator_type func_sig_it_; }; const FunctionSignatureIterator function_signature_begin(); const FunctionSignatureIterator function_signature_end() const; private: static DataTypeVector supported_types_; std::unique_ptr<FunctionRegistry> function_registry_; }; GANDIVA_EXPORT std::vector<std::shared_ptr<FunctionSignature>> GetRegisteredFunctionSignatures(); } // namespace gandiva
cpcloud/arrow
cpp/src/gandiva/expression_registry.h
C
apache-2.0
2,486
/* * Copyright (c) 2018 Nuvoton Technology Corp. * Copyright (c) 2018 ARM Limited * SPDX-License-Identifier: Apache-2.0 * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * * Description: NUC472 MAC driver source file */ #include <stdbool.h> #include "nuc472_eth.h" #include "mbed_toolchain.h" //#define NU_TRACE #include "numaker_eth_hal.h" #define ETH_TRIGGER_RX() do{EMAC->RXST = 0;}while(0) #define ETH_TRIGGER_TX() do{EMAC->TXST = 0;}while(0) #define ETH_ENABLE_TX() do{EMAC->CTL |= EMAC_CTL_TXON;}while(0) #define ETH_ENABLE_RX() do{EMAC->CTL |= EMAC_CTL_RXON_Msk;}while(0) #define ETH_DISABLE_TX() do{EMAC->CTL &= ~EMAC_CTL_TXON;}while(0) #define ETH_DISABLE_RX() do{EMAC->CTL &= ~EMAC_CTL_RXON_Msk;}while(0) #define EMAC_ENABLE_INT(emac, u32eIntSel) ((emac)->INTEN |= (u32eIntSel)) #define EMAC_DISABLE_INT(emac, u32eIntSel) ((emac)->INTEN &= ~ (u32eIntSel)) MBED_ALIGN(4) struct eth_descriptor rx_desc[RX_DESCRIPTOR_NUM]; MBED_ALIGN(4) struct eth_descriptor tx_desc[TX_DESCRIPTOR_NUM]; struct eth_descriptor volatile *cur_tx_desc_ptr, *cur_rx_desc_ptr, *fin_tx_desc_ptr; __attribute__((section("EMAC_RAM"))) MBED_ALIGN(4) uint8_t rx_buf[RX_DESCRIPTOR_NUM][PACKET_BUFFER_SIZE]; __attribute__((section("EMAC_RAM"))) MBED_ALIGN(4) uint8_t tx_buf[TX_DESCRIPTOR_NUM][PACKET_BUFFER_SIZE]; eth_callback_t nu_eth_txrx_cb = NULL; void *nu_userData = NULL; extern void ack_emac_rx_isr(void); static bool isPhyReset = false; static uint16_t phyLPAval = 0; // PTP source clock is 84MHz (Real chip using PLL). Each tick is 11.90ns // Assume we want to set each tick to 100ns. // Increase register = (100 * 2^31) / (10^9) = 214.71 =~ 215 = 0xD7 // Addend register = 2^32 * tick_freq / (84MHz), where tick_freq = (2^31 / 215) MHz // From above equation, addend register = 2^63 / (84M * 215) ~= 510707200 = 0x1E70C600 static void mdio_write(uint8_t addr, uint8_t reg, uint16_t val) { EMAC->MIIMDAT = val; EMAC->MIIMCTL = (addr << EMAC_MIIMCTL_PHYADDR_Pos) | reg | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_WRITE_Msk | EMAC_MIIMCTL_MDCON_Msk; while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk); } static uint16_t mdio_read(uint8_t addr, uint8_t reg) { EMAC->MIIMCTL = (addr << EMAC_MIIMCTL_PHYADDR_Pos) | reg | EMAC_MIIMCTL_BUSY_Msk | EMAC_MIIMCTL_MDCON_Msk; while (EMAC->MIIMCTL & EMAC_MIIMCTL_BUSY_Msk); return (EMAC->MIIMDAT); } static int reset_phy(void) { uint16_t reg; uint32_t delayCnt; mdio_write(CONFIG_PHY_ADDR, MII_BMCR, BMCR_RESET); delayCnt = 2000; while (delayCnt > 0) { delayCnt--; if ((mdio_read(CONFIG_PHY_ADDR, MII_BMCR) & BMCR_RESET) == 0) { break; } } if (delayCnt == 0) { NU_DEBUGF(("Reset phy failed\n")); return (-1); } mdio_write(CONFIG_PHY_ADDR, MII_ADVERTISE, ADVERTISE_CSMA | ADVERTISE_10HALF | ADVERTISE_10FULL | ADVERTISE_100HALF | ADVERTISE_100FULL); reg = mdio_read(CONFIG_PHY_ADDR, MII_BMCR); mdio_write(CONFIG_PHY_ADDR, MII_BMCR, reg | BMCR_ANRESTART); delayCnt = 200000; while (delayCnt > 0) { delayCnt--; if ((mdio_read(CONFIG_PHY_ADDR, MII_BMSR) & (BMSR_ANEGCOMPLETE | BMSR_LSTATUS)) == (BMSR_ANEGCOMPLETE | BMSR_LSTATUS)) { break; } } if (delayCnt == 0) { NU_DEBUGF(("AN failed. Set to 100 FULL\n")); EMAC->CTL |= (EMAC_CTL_OPMODE_Msk | EMAC_CTL_FUDUP_Msk); return (-1); } else { reg = mdio_read(CONFIG_PHY_ADDR, MII_LPA); phyLPAval = reg; if (reg & ADVERTISE_100FULL) { NU_DEBUGF(("100 full\n")); EMAC->CTL |= (EMAC_CTL_OPMODE_Msk | EMAC_CTL_FUDUP_Msk); } else if (reg & ADVERTISE_100HALF) { NU_DEBUGF(("100 half\n")); EMAC->CTL = (EMAC->CTL & ~EMAC_CTL_FUDUP_Msk) | EMAC_CTL_OPMODE_Msk; } else if (reg & ADVERTISE_10FULL) { NU_DEBUGF(("10 full\n")); EMAC->CTL = (EMAC->CTL & ~EMAC_CTL_OPMODE_Msk) | EMAC_CTL_FUDUP_Msk; } else { NU_DEBUGF(("10 half\n")); EMAC->CTL &= ~(EMAC_CTL_OPMODE_Msk | EMAC_CTL_FUDUP_Msk); } } printf("PHY ID 1:0x%x\r\n", mdio_read(CONFIG_PHY_ADDR, MII_PHYSID1)); printf("PHY ID 2:0x%x\r\n", mdio_read(CONFIG_PHY_ADDR, MII_PHYSID2)); return (0); } static void init_tx_desc(void) { uint32_t i; cur_tx_desc_ptr = fin_tx_desc_ptr = &tx_desc[0]; for (i = 0; i < TX_DESCRIPTOR_NUM; i++) { tx_desc[i].status1 = TXFD_PADEN | TXFD_CRCAPP | TXFD_INTEN; tx_desc[i].buf = &tx_buf[i][0]; tx_desc[i].status2 = 0; tx_desc[i].next = &tx_desc[(i + 1) % TX_DESCRIPTOR_NUM]; } EMAC->TXDSA = (unsigned int)&tx_desc[0]; return; } static void init_rx_desc(void) { uint32_t i; cur_rx_desc_ptr = &rx_desc[0]; for (i = 0; i < RX_DESCRIPTOR_NUM; i++) { rx_desc[i].status1 = OWNERSHIP_EMAC; rx_desc[i].buf = &rx_buf[i][0]; rx_desc[i].status2 = 0; rx_desc[i].next = &rx_desc[(i + 1) % (RX_DESCRIPTOR_NUM)]; } EMAC->RXDSA = (unsigned int)&rx_desc[0]; return; } void numaker_set_mac_addr(uint8_t *addr) { EMAC->CAM0M = (addr[0] << 24) | (addr[1] << 16) | (addr[2] << 8) | addr[3]; EMAC->CAM0L = (addr[4] << 24) | (addr[5] << 16); EMAC->CAMCTL = EMAC_CAMCTL_CMPEN_Msk | EMAC_CAMCTL_AMP_Msk | EMAC_CAMCTL_ABP_Msk; EMAC->CAMEN = 1; // Enable CAM entry 0 } static void __eth_clk_pin_init() { /* Unlock protected registers */ SYS_UnlockReg(); /* Enable IP clock */ CLK_EnableModuleClock(EMAC_MODULE); // Configure MDC clock rate to HCLK / (127 + 1) = 656 kHz if system is running at 84 MHz CLK_SetModuleClock(EMAC_MODULE, 0, CLK_CLKDIV3_EMAC(127)); /* Update System Core Clock */ SystemCoreClockUpdate(); /*---------------------------------------------------------------------------------------------------------*/ /* Init I/O Multi-function */ /*---------------------------------------------------------------------------------------------------------*/ // Configure RMII pins SYS->GPC_MFPL &= ~(SYS_GPC_MFPL_PC0MFP_Msk | SYS_GPC_MFPL_PC1MFP_Msk | SYS_GPC_MFPL_PC2MFP_Msk | SYS_GPC_MFPL_PC3MFP_Msk | SYS_GPC_MFPL_PC4MFP_Msk | SYS_GPC_MFPL_PC6MFP_Msk | SYS_GPC_MFPL_PC7MFP_Msk); SYS->GPC_MFPL |= SYS_GPC_MFPL_PC0MFP_EMAC_REFCLK | SYS_GPC_MFPL_PC1MFP_EMAC_MII_RXERR | SYS_GPC_MFPL_PC2MFP_EMAC_MII_RXDV | SYS_GPC_MFPL_PC3MFP_EMAC_MII_RXD1 | SYS_GPC_MFPL_PC4MFP_EMAC_MII_RXD0 | SYS_GPC_MFPL_PC6MFP_EMAC_MII_TXD0 | SYS_GPC_MFPL_PC7MFP_EMAC_MII_TXD1; SYS->GPC_MFPH &= ~SYS_GPC_MFPH_PC8MFP_Msk; SYS->GPC_MFPH |= SYS_GPC_MFPH_PC8MFP_EMAC_MII_TXEN; // Enable high slew rate on all RMII pins PC->SLEWCTL |= 0x1DF; // Configure MDC, MDIO at PB14 & PB15 SYS->GPB_MFPH &= ~(SYS_GPB_MFPH_PB14MFP_Msk | SYS_GPB_MFPH_PB15MFP_Msk); SYS->GPB_MFPH |= SYS_GPB_MFPH_PB14MFP_EMAC_MII_MDC | SYS_GPB_MFPH_PB15MFP_EMAC_MII_MDIO; /* Lock protected registers */ SYS_LockReg(); } void numaker_eth_init(uint8_t *mac_addr) { // init CLK & pins __eth_clk_pin_init(); // Reset MAC EMAC->CTL = EMAC_CTL_RST_Msk; while (EMAC->CTL & EMAC_CTL_RST_Msk) {} init_tx_desc(); init_rx_desc(); numaker_set_mac_addr(mac_addr); // need to reconfigure hardware address 'cos we just RESET emc... EMAC->CTL |= EMAC_CTL_STRIPCRC_Msk | EMAC_CTL_RXON_Msk | EMAC_CTL_TXON_Msk | EMAC_CTL_RMIIEN_Msk | EMAC_CTL_RMIIRXCTL_Msk; EMAC->INTEN |= EMAC_INTEN_RXIEN_Msk | EMAC_INTEN_RXGDIEN_Msk | EMAC_INTEN_RDUIEN_Msk | EMAC_INTEN_RXBEIEN_Msk | EMAC_INTEN_TXIEN_Msk | EMAC_INTEN_TXABTIEN_Msk | EMAC_INTEN_TXCPIEN_Msk | EMAC_INTEN_TXBEIEN_Msk; /* Limit the max receive frame length to 1514 + 4 */ EMAC->MRFL = NU_ETH_MAX_FLEN; /* Set RX FIFO threshold as 8 words */ if (isPhyReset != true) { if (!reset_phy()) { isPhyReset = true; } } else { if (phyLPAval & ADVERTISE_100FULL) { NU_DEBUGF(("100 full\n")); EMAC->CTL |= (EMAC_CTL_OPMODE_Msk | EMAC_CTL_FUDUP_Msk); } else if (phyLPAval & ADVERTISE_100HALF) { NU_DEBUGF(("100 half\n")); EMAC->CTL = (EMAC->CTL & ~EMAC_CTL_FUDUP_Msk) | EMAC_CTL_OPMODE_Msk; } else if (phyLPAval & ADVERTISE_10FULL) { NU_DEBUGF(("10 full\n")); EMAC->CTL = (EMAC->CTL & ~EMAC_CTL_OPMODE_Msk) | EMAC_CTL_FUDUP_Msk; } else { NU_DEBUGF(("10 half\n")); EMAC->CTL &= ~(EMAC_CTL_OPMODE_Msk | EMAC_CTL_FUDUP_Msk); } } EMAC_ENABLE_RX(); EMAC_ENABLE_TX(); } void ETH_halt(void) { EMAC->CTL &= ~(EMAC_CTL_RXON_Msk | EMAC_CTL_TXON_Msk); } unsigned int m_status; void EMAC_RX_IRQHandler(void) { m_status = EMAC->INTSTS & 0xFFFF; EMAC->INTSTS = m_status; if (m_status & EMAC_INTSTS_RXBEIF_Msk) { // Shouldn't goes here, unless descriptor corrupted mbed_error_printf("### RX Bus error [0x%x]\r\n", m_status); if (nu_eth_txrx_cb != NULL) { nu_eth_txrx_cb('B', nu_userData); } return; } EMAC_DISABLE_INT(EMAC, (EMAC_INTEN_RDUIEN_Msk | EMAC_INTEN_RXGDIEN_Msk)); if (nu_eth_txrx_cb != NULL) { nu_eth_txrx_cb('R', nu_userData); } } void numaker_eth_trigger_rx(void) { EMAC_ENABLE_INT(EMAC, (EMAC_INTEN_RDUIEN_Msk | EMAC_INTEN_RXGDIEN_Msk)); ETH_TRIGGER_RX(); } int numaker_eth_get_rx_buf(uint16_t *len, uint8_t **buf) { unsigned int cur_entry, status; cur_entry = EMAC->CRXDSA; if ((cur_entry == (uint32_t)cur_rx_desc_ptr) && (!(m_status & EMAC_INTSTS_RDUIF_Msk))) { // cur_entry may equal to cur_rx_desc_ptr if RDU occures return -1; } status = cur_rx_desc_ptr->status1; if (status & OWNERSHIP_EMAC) { return -1; } if (status & RXFD_RXGD) { *buf = cur_rx_desc_ptr->buf; *len = status & 0xFFFF; // length of payload should be <= 1514 if (*len > (NU_ETH_MAX_FLEN - 4)) { NU_DEBUGF(("%s... unexpected long packet length=%d, buf=0x%x\r\n", __FUNCTION__, *len, *buf)); *len = 0; // Skip this unexpected long packet } if (*len == (NU_ETH_MAX_FLEN - 4)) { NU_DEBUGF(("%s... length=%d, buf=0x%x\r\n", __FUNCTION__, *len, *buf)); } } return 0; } void numaker_eth_rx_next(void) { cur_rx_desc_ptr->status1 = OWNERSHIP_EMAC; cur_rx_desc_ptr = cur_rx_desc_ptr->next; } void EMAC_TX_IRQHandler(void) { unsigned int cur_entry, status; status = EMAC->INTSTS & 0xFFFF0000; EMAC->INTSTS = status; if (status & EMAC_INTSTS_TXBEIF_Msk) { // Shouldn't goes here, unless descriptor corrupted mbed_error_printf("### TX Bus error [0x%x]\r\n", status); if (nu_eth_txrx_cb != NULL) { nu_eth_txrx_cb('B', nu_userData); } return; } cur_entry = EMAC->CTXDSA; while (cur_entry != (uint32_t)fin_tx_desc_ptr) { fin_tx_desc_ptr = fin_tx_desc_ptr->next; } if (nu_eth_txrx_cb != NULL) { nu_eth_txrx_cb('T', nu_userData); } } uint8_t *numaker_eth_get_tx_buf(void) { if (cur_tx_desc_ptr->status1 & OWNERSHIP_EMAC) { return (NULL); } else { return (cur_tx_desc_ptr->buf); } } void numaker_eth_trigger_tx(uint16_t length, void *p) { struct eth_descriptor volatile *desc; cur_tx_desc_ptr->status2 = (unsigned int)length; desc = cur_tx_desc_ptr->next; // in case TX is transmitting and overwrite next pointer before we can update cur_tx_desc_ptr cur_tx_desc_ptr->status1 |= OWNERSHIP_EMAC; cur_tx_desc_ptr = desc; ETH_TRIGGER_TX(); } int numaker_eth_link_ok(void) { /* first, a dummy read to latch */ mdio_read(CONFIG_PHY_ADDR, MII_BMSR); if (mdio_read(CONFIG_PHY_ADDR, MII_BMSR) & BMSR_LSTATUS) { return 1; } return 0; } void numaker_eth_set_cb(eth_callback_t eth_cb, void *userData) { nu_eth_txrx_cb = eth_cb; nu_userData = userData; } // Override mbed_mac_address of mbed_interface.c to provide ethernet devices with a semi-unique MAC address void mbed_mac_address(char *mac) { uint32_t uID1; // Fetch word 0 uint32_t word0 = *(uint32_t *)0x7F804; // 2KB Data Flash at 0x7F800 // Fetch word 1 // we only want bottom 16 bits of word1 (MAC bits 32-47) // and bit 9 forced to 1, bit 8 forced to 0 // Locally administered MAC, reduced conflicts // http://en.wikipedia.org/wiki/MAC_address uint32_t word1 = *(uint32_t *)0x7F800; // 2KB Data Flash at 0x7F800 if (word0 == 0xFFFFFFFF) { // Not burn any mac address at 1st 2 words of Data Flash // with a semi-unique MAC address from the UUID /* Enable FMC ISP function */ SYS_UnlockReg(); FMC_Open(); // = FMC_ReadUID(0); uID1 = FMC_ReadUID(1); word1 = (uID1 & 0x003FFFFF) | ((uID1 & 0x030000) << 6) >> 8; word0 = ((FMC_ReadUID(0) >> 4) << 20) | ((uID1 & 0xFF) << 12) | (FMC_ReadUID(2) & 0xFFF); /* Disable FMC ISP function */ FMC_Close(); /* Lock protected registers */ SYS_LockReg(); } word1 |= 0x00000200; word1 &= 0x0000FEFF; mac[0] = (word1 & 0x0000ff00) >> 8; mac[1] = (word1 & 0x000000ff); mac[2] = (word0 & 0xff000000) >> 24; mac[3] = (word0 & 0x00ff0000) >> 16; mac[4] = (word0 & 0x0000ff00) >> 8; mac[5] = (word0 & 0x000000ff); NU_DEBUGF(("mac address %02x-%02x-%02x-%02x-%02x-%02x \r\n", mac[0], mac[1], mac[2], mac[3], mac[4], mac[5])); } void numaker_eth_enable_interrupts(void) { EMAC->INTEN |= EMAC_INTEN_RXIEN_Msk | EMAC_INTEN_TXIEN_Msk ; NVIC_EnableIRQ(EMAC_RX_IRQn); NVIC_EnableIRQ(EMAC_TX_IRQn); } void numaker_eth_disable_interrupts(void) { NVIC_DisableIRQ(EMAC_RX_IRQn); NVIC_DisableIRQ(EMAC_TX_IRQn); }
adfernandes/mbed
connectivity/drivers/emac/TARGET_NUVOTON_EMAC/TARGET_NUC472/nuc472_eth.c
C
apache-2.0
14,958
package test /* check availability of members defined locally and in hierarchy */ abstract class Base1 { type tb1 = Int val vb1 = 0 var rb1 = 0 def fb1 = 0 class Cb1 object Ob1 private type tb2 = Int private val vb2 = 0 private var rb2 = 0 private def fb2 = 0 private class Cb2 private object Ob2 type tb3 val vb3: Int var rb3: Int def fb3: Int } trait Trait1 { type tt1 = Int val vt1 = 0 var rt1 = 0 def ft1 = 0 class Ct1 object Ot1 private type tt2 = Int private val vt2 = 0 private var rt2 = 0 private def ft2 = 0 private class Ct2 private object Ot2 type tt3 val vt3: Int var rt3: Int def ft3: Int } class Completion1 extends Base1 with Trait1 { type tc1 = Int val vc1 = 0 var rc1 = 0 def fc1 = 0 class Cc1 object Oc1 private type tc2 = Int private val vc2 = 0 private var rc2 = 0 private def fc2 = 0 private class Cc2 private object Oc2 override type tb3 = Int override val vb3 = 12 override var rb3 = 12 override def fb3 = 12 override type tt3 = Int override val vt3 = 12 override var rt3 = 12 override def ft3 = 12 /*_*/ } object Completion2 extends Base1 with Trait1 { type to1 = Int val vo1 = 0 var ro1 = 0 def fo1 = 0 class Co1 object Oo1 private type to2 = Int private val vo2 = 0 private var ro2 = 0 private def fo2 = 0 private class Co2 private object Oo2 override type tb3 = Int override val vb3 = 12 override var rb3 = 12 override def fb3 = 12 override type tt3 = Int override val vt3 = 12 override var rt3 = 12 override def ft3 = 12 /*_*/ }
scala/scala
test/files/presentation/scope-completion-3/src/Completions.scala
Scala
apache-2.0
1,634
package org.radargun.service; import org.jgroups.Event; import org.jgroups.Message; import org.radargun.protocols.SLAVE_PARTITION; /** * SLAVE_PARTITION adapted for JGroups 3.3.x * * @author Radim Vansa &lt;rvansa@redhat.com&gt; */ public class SLAVE_PARTITION_33 extends SLAVE_PARTITION { @Override public Object down(Event evt) { switch (evt.getType()) { case Event.MSG: Message msg = (Message) evt.getArg(); // putHeader signature has changed msg.putHeader(PROTOCOL_ID, new SlaveHeader(this.slaveIndex)); } return down_prot.down(evt); } }
vjuranek/radargun
plugins/infinispan52/src/main/java/org/radargun/service/SLAVE_PARTITION_33.java
Java
apache-2.0
620
/* * Copyright Elasticsearch B.V. and/or licensed to Elasticsearch B.V. under one * or more contributor license agreements. Licensed under the Elastic License; * you may not use this file except in compliance with the Elastic License. */ package org.elasticsearch.xpack.sql.expression.predicate.logical; import org.elasticsearch.xpack.sql.expression.Expression; import org.elasticsearch.xpack.sql.expression.Expressions; import org.elasticsearch.xpack.sql.expression.Nullability; import org.elasticsearch.xpack.sql.expression.gen.pipeline.Pipe; import org.elasticsearch.xpack.sql.expression.predicate.BinaryOperator; import org.elasticsearch.xpack.sql.expression.predicate.logical.BinaryLogicProcessor.BinaryLogicOperation; import org.elasticsearch.xpack.sql.tree.Source; import org.elasticsearch.xpack.sql.type.DataType; import static org.elasticsearch.xpack.sql.expression.TypeResolutions.isBoolean; public abstract class BinaryLogic extends BinaryOperator<Boolean, Boolean, Boolean, BinaryLogicOperation> { protected BinaryLogic(Source source, Expression left, Expression right, BinaryLogicOperation operation) { super(source, left, right, operation); } @Override public DataType dataType() { return DataType.BOOLEAN; } @Override protected TypeResolution resolveInputType(Expression e, Expressions.ParamOrdinal paramOrdinal) { return isBoolean(e, sourceText(), paramOrdinal); } @Override protected Pipe makePipe() { return new BinaryLogicPipe(source(), this, Expressions.pipe(left()), Expressions.pipe(right()), function()); } @Override public Nullability nullable() { // Cannot fold null due to 3vl, constant folding will do any possible folding. return Nullability.UNKNOWN; } }
coding0011/elasticsearch
x-pack/plugin/sql/src/main/java/org/elasticsearch/xpack/sql/expression/predicate/logical/BinaryLogic.java
Java
apache-2.0
1,799
class AppFooterCtrl { constructor(AppConstants) { 'ngInject'; this.appName = AppConstants.appName; // Get today's date to generate the year this.date = new Date(); } } let AppFooter = { controller: AppFooterCtrl, templateUrl: 'layout/footer.html' }; export default AppFooter;
gustavovaliati/training_Symfony2.8_Angular1.5_AdminLTE
symfony-root/web/webapp/js/layout/footer.component.js
JavaScript
apache-2.0
303
package com.importnew.importnewapp; public class DateTest{ }
leerduo/ImportNewApp
app/src/androidTest/java/com/importnew/importnewapp/DateTest.java
Java
apache-2.0
63
/* * JBoss, Home of Professional Open Source * Copyright 2006, Red Hat Middleware LLC, and individual contributors * as indicated by the @author tags. * See the copyright.txt in the distribution for a * full listing of individual contributors. * This copyrighted material is made available to anyone wishing to use, * modify, copy, or redistribute it subject to the terms and conditions * of the GNU Lesser General Public License, v. 2.1. * This program is distributed in the hope that it will be useful, but WITHOUT A * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A * PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. * You should have received a copy of the GNU Lesser General Public License, * v.2.1 along with this distribution; if not, write to the Free Software * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, * MA 02110-1301, USA. * * (C) 2005-2006, * @author JBoss Inc. */ /* * Copyright (C) 2004, * * Arjuna Technologies Ltd, * Newcastle upon Tyne, * Tyne and Wear, * UK. * * $Id: xidcheck.java 2342 2006-03-30 13:06:17Z $ */ package com.hp.mwtests.ts.jts.orbspecific.interposition; import static org.junit.Assert.assertTrue; import org.junit.Test; import org.omg.CosTransactions.Control; import com.arjuna.ats.internal.jts.orbspecific.ControlImple; import com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple; import com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl; import com.arjuna.ats.internal.jts.orbspecific.interposition.resources.strict.ServerStrictTopLevelAction; import com.hp.mwtests.ts.jts.resources.TestBase; public class ServerTopLevelStrictUnitTest extends TestBase { @Test public void test () throws Exception { ControlImple cont = new ControlImple(null, null); Control theControl = cont.getControl(); ArjunaTransactionImple tx = cont.getImplHandle(); ServerControl sc = new ServerControl(tx.get_uid(), theControl, tx, theControl.get_coordinator(), theControl.get_terminator()); ServerStrictTopLevelAction act = new ServerStrictTopLevelAction(sc, true); assertTrue(act.interposeResource()); assertTrue(act.type() != null); } }
nmcl/scratch
graalvm/transactions/fork/narayana/ArjunaJTS/jts/tests/classes/com/hp/mwtests/ts/jts/orbspecific/interposition/ServerTopLevelStrictUnitTest.java
Java
apache-2.0
2,298
<?xml version="1.0" encoding="ascii"?> <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"> <head> <title>api_shim.core.http.HttpServerFileUpload</title> <link rel="stylesheet" href="epydoc.css" type="text/css" /> <script type="text/javascript" src="epydoc.js"></script> </head> <body bgcolor="white" text="black" link="blue" vlink="#204080" alink="#204080"> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th>&nbsp;&nbsp;&nbsp;<a href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th> <!-- Index link --> <th>&nbsp;&nbsp;&nbsp;<a href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th> <!-- Help link --> <th>&nbsp;&nbsp;&nbsp;<a href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th> <th class="navbar" width="100%"></th> </tr> </table> <table width="100%" cellpadding="0" cellspacing="0"> <tr valign="top"> <td width="100%"> <span class="breadcrumbs"> Package&nbsp;api_shim :: <a href="api_shim.core-module.html">Package&nbsp;core</a> :: <a href="api_shim.core.http-module.html">Module&nbsp;http</a> :: Class&nbsp;HttpServerFileUpload </span> </td> <td> <table cellpadding="0" cellspacing="0"> <!-- hide/show private --> <tr><td align="right"><span class="options">[<a href="javascript:void(0);" class="privatelink" onclick="toggle_private();">hide&nbsp;private</a>]</span></td></tr> <tr><td align="right"><span class="options" >[<a href="frames.html" target="_top">frames</a >]&nbsp;|&nbsp;<a href="api_shim.core.http.HttpServerFileUpload-class.html" target="_top">no&nbsp;frames</a>]</span></td></tr> </table> </td> </tr> </table> <!-- ==================== CLASS DESCRIPTION ==================== --> <h1 class="epydoc">Class HttpServerFileUpload</h1><p class="nomargin-top"><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload">source&nbsp;code</a></span></p> <pre class="base-tree"> object --+ | <a href="api_shim.core.streams.ReadStream-class.html">streams.ReadStream</a> --+ | <strong class="uidshort">HttpServerFileUpload</strong> </pre> <hr /> <p>An Upload which was found in the HttpServerMultipartRequest while handling it.</p> <!-- ==================== INSTANCE METHODS ==================== --> <a name="section-InstanceMethods"></a> <table class="summary" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Instance Methods</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-InstanceMethods" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="api_shim.core.http.HttpServerFileUpload-class.html#__init__" class="summary-sig-name">__init__</a>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">upload</span>)</span></td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.__init__">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a name="stream_to_file_system"></a><span class="summary-sig-name">stream_to_file_system</span>(<span class="summary-sig-arg">self</span>, <span class="summary-sig-arg">filename</span>)</span><br /> Stream the content of this upload to the given filename.</td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.stream_to_file_system">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="api_shim.core.http.HttpServerFileUpload-class.html#filename" class="summary-sig-name">filename</a>(<span class="summary-sig-arg">self</span>)</span><br /> Returns the filename of the attribute</td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.filename">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="api_shim.core.http.HttpServerFileUpload-class.html#name" class="summary-sig-name">name</a>(<span class="summary-sig-arg">self</span>)</span><br /> Returns the filename of the attribute</td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.name">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="api_shim.core.http.HttpServerFileUpload-class.html#content_type" class="summary-sig-name">content_type</a>(<span class="summary-sig-arg">self</span>)</span><br /> Returns the contentType for the upload</td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.content_type">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="api_shim.core.http.HttpServerFileUpload-class.html#content_transfer_encoding" class="summary-sig-name">content_transfer_encoding</a>(<span class="summary-sig-arg">self</span>)</span><br /> Returns the contentTransferEncoding for the upload</td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.content_transfer_encoding">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="api_shim.core.http.HttpServerFileUpload-class.html#charset" class="summary-sig-name">charset</a>(<span class="summary-sig-arg">self</span>)</span><br /> Returns the charset for the upload</td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.charset">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td width="15%" align="right" valign="top" class="summary"> <span class="summary-type">&nbsp;</span> </td><td class="summary"> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr> <td><span class="summary-sig"><a href="api_shim.core.http.HttpServerFileUpload-class.html#size" class="summary-sig-name">size</a>(<span class="summary-sig-arg">self</span>)</span><br /> Returns the charset for the upload</td> <td align="right" valign="top"> <span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.size">source&nbsp;code</a></span> </td> </tr> </table> </td> </tr> <tr> <td colspan="2" class="summary"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.streams.ReadStream-class.html">streams.ReadStream</a></code></b>: <code><a href="api_shim.core.streams.ReadStream-class.html#data_handler">data_handler</a></code>, <code><a href="api_shim.core.streams.ReadStream-class.html#end_handler">end_handler</a></code>, <code><a href="api_shim.core.streams.ReadStream-class.html#exception_handler">exception_handler</a></code>, <code><a href="api_shim.core.streams.ReadStream-class.html#pause">pause</a></code>, <code><a href="api_shim.core.streams.ReadStream-class.html#resume">resume</a></code> </p> <div class="private"> <p class="indent-wrapped-lines"><b>Inherited from <code><a href="api_shim.core.streams.ReadStream-class.html">streams.ReadStream</a></code></b> (private): <code><a href="api_shim.core.streams.ReadStream-class.html#_to_read_stream" onclick="show_private();">_to_read_stream</a></code> </p></div> </td> </tr> </table> <!-- ==================== METHOD DETAILS ==================== --> <a name="section-MethodDetails"></a> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr bgcolor="#70b0f0" class="table-header"> <td colspan="2" class="table-header"> <table border="0" cellpadding="0" cellspacing="0" width="100%"> <tr valign="top"> <td align="left"><span class="table-header">Method Details</span></td> <td align="right" valign="top" ><span class="options">[<a href="#section-MethodDetails" class="privatelink" onclick="toggle_private();" >hide private</a>]</span></td> </tr> </table> </td> </tr> </table> <a name="__init__"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">__init__</span>(<span class="sig-arg">self</span>, <span class="sig-arg">upload</span>)</span> <br /><em class="fname">(Constructor)</em> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.__init__">source&nbsp;code</a></span>&nbsp; </td> </tr></table> <dl class="fields"> <dt>Overrides: object.__init__ <dd><em class="note">(inherited documentation)</em></dd> </dt> </dl> </td></tr></table> </div> <a name="filename"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">filename</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.filename">source&nbsp;code</a></span>&nbsp; </td> </tr></table> <p>Returns the filename of the attribute</p> <dl class="fields"> <dt>Decorators:</dt> <dd><ul class="nomargin-top"> <li><code>@property</code></li> </ul></dd> </dl> </td></tr></table> </div> <a name="name"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">name</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.name">source&nbsp;code</a></span>&nbsp; </td> </tr></table> <p>Returns the filename of the attribute</p> <dl class="fields"> <dt>Decorators:</dt> <dd><ul class="nomargin-top"> <li><code>@property</code></li> </ul></dd> </dl> </td></tr></table> </div> <a name="content_type"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">content_type</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.content_type">source&nbsp;code</a></span>&nbsp; </td> </tr></table> <p>Returns the contentType for the upload</p> <dl class="fields"> <dt>Decorators:</dt> <dd><ul class="nomargin-top"> <li><code>@property</code></li> </ul></dd> </dl> </td></tr></table> </div> <a name="content_transfer_encoding"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">content_transfer_encoding</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.content_transfer_encoding">source&nbsp;code</a></span>&nbsp; </td> </tr></table> <p>Returns the contentTransferEncoding for the upload</p> <dl class="fields"> <dt>Decorators:</dt> <dd><ul class="nomargin-top"> <li><code>@property</code></li> </ul></dd> </dl> </td></tr></table> </div> <a name="charset"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">charset</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.charset">source&nbsp;code</a></span>&nbsp; </td> </tr></table> <p>Returns the charset for the upload</p> <dl class="fields"> <dt>Decorators:</dt> <dd><ul class="nomargin-top"> <li><code>@property</code></li> </ul></dd> </dl> </td></tr></table> </div> <a name="size"></a> <div> <table class="details" border="1" cellpadding="3" cellspacing="0" width="100%" bgcolor="white"> <tr><td> <table width="100%" cellpadding="0" cellspacing="0" border="0"> <tr valign="top"><td> <h3 class="epydoc"><span class="sig"><span class="sig-name">size</span>(<span class="sig-arg">self</span>)</span> </h3> </td><td align="right" valign="top" ><span class="codelink"><a href="api_shim.core.http-pysrc.html#HttpServerFileUpload.size">source&nbsp;code</a></span>&nbsp; </td> </tr></table> <p>Returns the charset for the upload</p> <dl class="fields"> <dt>Decorators:</dt> <dd><ul class="nomargin-top"> <li><code>@property</code></li> </ul></dd> </dl> </td></tr></table> </div> <br /> <!-- ==================== NAVIGATION BAR ==================== --> <table class="navbar" border="0" width="100%" cellpadding="0" bgcolor="#a0c0ff" cellspacing="0"> <tr valign="middle"> <!-- Tree link --> <th>&nbsp;&nbsp;&nbsp;<a href="module-tree.html">Trees</a>&nbsp;&nbsp;&nbsp;</th> <!-- Index link --> <th>&nbsp;&nbsp;&nbsp;<a href="identifier-index.html">Indices</a>&nbsp;&nbsp;&nbsp;</th> <!-- Help link --> <th>&nbsp;&nbsp;&nbsp;<a href="help.html">Help</a>&nbsp;&nbsp;&nbsp;</th> <th class="navbar" width="100%"></th> </tr> </table> <table border="0" cellpadding="0" cellspacing="0" width="100%%"> <tr> <td align="left" class="footer"> Generated by Epydoc 3.0.1 on Wed Jul 17 20:24:59 2013 </td> <td align="right" class="footer"> <a target="mainFrame" href="http://epydoc.sourceforge.net" >http://epydoc.sourceforge.net</a> </td> </tr> </table> <script type="text/javascript"> <!-- // Private objects are initially displayed (because if // javascript is turned off then we want them to be // visible); but by default, we want to hide them. So hide // them unless we have a cookie that says to show them. checkCookie(); // --> </script> </body> </html>
vietj/vertx
src/main/vertx2/api/epydoc/api_shim.core.http.HttpServerFileUpload-class.html
HTML
apache-2.0
18,002
// Copyright (c) 2015 Cesanta Software Limited // All rights reserved #include "mongoose.h" static const char *s_http_port = "8000"; static struct mg_serve_http_opts s_http_server_opts; static void ev_handler(struct mg_connection *nc, int ev, void *p) { if (ev == MG_EV_HTTP_REQUEST) { mg_serve_http(nc, p, s_http_server_opts); // Serves static content } } int main(void) { struct mg_mgr mgr; struct mg_connection *nc; cs_stat_t st; mg_mgr_init(&mgr, NULL); nc = mg_bind(&mgr, s_http_port, ev_handler); if (nc == NULL) { fprintf(stderr, "Cannot bind to %s\n", s_http_port); exit(1); } // Set up HTTP server parameters mg_set_protocol_http_websocket(nc); s_http_server_opts.document_root = "web_root"; // Set up web root directory if (mg_stat(s_http_server_opts.document_root, &st) != 0) { fprintf(stderr, "%s", "Cannot find web_root directory, exiting\n"); exit(1); } printf("Starting web server on port %s\n", s_http_port); for (;;) { mg_mgr_poll(&mgr, 1000); } mg_mgr_free(&mgr); return 0; }
bbxyard/bbxyard
yard/skills/mongoose/examples/connected_device_1/server.c
C
apache-2.0
1,067
# NuGet Package Restore Support Support files for NuGet Package Restore.
JetBrains/ReSharperGallery
.nuget/README.md
Markdown
apache-2.0
73
/** * Licensed to the Apache Software Foundation (ASF) under one * or more contributor license agreements. See the NOTICE file * distributed with this work for additional information * regarding copyright ownership. The ASF licenses this file * to you under the Apache License, Version 2.0 (the * "License"); you may not use this file except in compliance * with the License. You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.hadoop.hdfs.server.datanode.erasurecode; import com.google.common.base.Preconditions; import org.apache.hadoop.classification.InterfaceAudience; import org.apache.hadoop.conf.Configuration; import org.apache.hadoop.hdfs.DFSConfigKeys; import org.apache.hadoop.hdfs.DFSUtilClient; import org.apache.hadoop.hdfs.server.datanode.DataNode; import org.apache.hadoop.hdfs.server.protocol.BlockECReconstructionCommand.BlockECReconstructionInfo; import org.apache.hadoop.util.Daemon; import org.slf4j.Logger; import java.util.Collection; import java.util.concurrent.CompletionService; import java.util.concurrent.ExecutorCompletionService; import java.util.concurrent.LinkedBlockingQueue; import java.util.concurrent.SynchronousQueue; import java.util.concurrent.ThreadPoolExecutor; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; /** * ErasureCodingWorker handles the erasure coding reconstruction work commands. * These commands would be issued from Namenode as part of Datanode's heart beat * response. BPOfferService delegates the work to this class for handling EC * commands. */ @InterfaceAudience.Private public final class ErasureCodingWorker { private static final Logger LOG = DataNode.LOG; private final DataNode datanode; private final Configuration conf; private final float xmitWeight; private ThreadPoolExecutor stripedReconstructionPool; private ThreadPoolExecutor stripedReadPool; public ErasureCodingWorker(Configuration conf, DataNode datanode) { this.datanode = datanode; this.conf = conf; this.xmitWeight = conf.getFloat( DFSConfigKeys.DFS_DN_EC_RECONSTRUCTION_XMITS_WEIGHT_KEY, DFSConfigKeys.DFS_DN_EC_RECONSTRUCTION_XMITS_WEIGHT_DEFAULT ); Preconditions.checkArgument(this.xmitWeight >= 0, "Invalid value configured for " + DFSConfigKeys.DFS_DN_EC_RECONSTRUCTION_XMITS_WEIGHT_KEY + ", it can not be negative value (" + this.xmitWeight + ")."); initializeStripedReadThreadPool(); initializeStripedBlkReconstructionThreadPool(conf.getInt( DFSConfigKeys.DFS_DN_EC_RECONSTRUCTION_THREADS_KEY, DFSConfigKeys.DFS_DN_EC_RECONSTRUCTION_THREADS_DEFAULT)); } private void initializeStripedReadThreadPool() { LOG.debug("Using striped reads"); // Essentially, this is a cachedThreadPool. stripedReadPool = new ThreadPoolExecutor(0, Integer.MAX_VALUE, 60, TimeUnit.SECONDS, new SynchronousQueue<>(), new Daemon.DaemonFactory() { private final AtomicInteger threadIndex = new AtomicInteger(0); @Override public Thread newThread(Runnable r) { Thread t = super.newThread(r); t.setName("stripedRead-" + threadIndex.getAndIncrement()); return t; } }, new ThreadPoolExecutor.CallerRunsPolicy() { @Override public void rejectedExecution(Runnable runnable, ThreadPoolExecutor e) { LOG.info("Execution for striped reading rejected, " + "Executing in current thread"); // will run in the current thread super.rejectedExecution(runnable, e); } }); stripedReadPool.allowCoreThreadTimeOut(true); } private void initializeStripedBlkReconstructionThreadPool(int numThreads) { LOG.debug("Using striped block reconstruction; pool threads={}", numThreads); stripedReconstructionPool = DFSUtilClient.getThreadPoolExecutor(2, numThreads, 60, new LinkedBlockingQueue<>(), "StripedBlockReconstruction-", false); stripedReconstructionPool.allowCoreThreadTimeOut(true); } /** * Handles the Erasure Coding reconstruction work commands. * * @param ecTasks BlockECReconstructionInfo * */ public void processErasureCodingTasks( Collection<BlockECReconstructionInfo> ecTasks) { for (BlockECReconstructionInfo reconInfo : ecTasks) { int xmitsSubmitted = 0; try { StripedReconstructionInfo stripedReconInfo = new StripedReconstructionInfo( reconInfo.getExtendedBlock(), reconInfo.getErasureCodingPolicy(), reconInfo.getLiveBlockIndices(), reconInfo.getSourceDnInfos(), reconInfo.getTargetDnInfos(), reconInfo.getTargetStorageTypes(), reconInfo.getTargetStorageIDs()); // It may throw IllegalArgumentException from task#stripedReader // constructor. final StripedBlockReconstructor task = new StripedBlockReconstructor(this, stripedReconInfo); if (task.hasValidTargets()) { // See HDFS-12044. We increase xmitsInProgress even the task is only // enqueued, so that // 1) NN will not send more tasks than what DN can execute and // 2) DN will not throw away reconstruction tasks, and instead keeps // an unbounded number of tasks in the executor's task queue. xmitsSubmitted = Math.max((int)(task.getXmits() * xmitWeight), 1); getDatanode().incrementXmitsInProcess(xmitsSubmitted); stripedReconstructionPool.submit(task); } else { LOG.warn("No missing internal block. Skip reconstruction for task:{}", reconInfo); } } catch (Throwable e) { getDatanode().decrementXmitsInProgress(xmitsSubmitted); LOG.warn("Failed to reconstruct striped block {}", reconInfo.getExtendedBlock().getLocalBlock(), e); } } } DataNode getDatanode() { return datanode; } Configuration getConf() { return conf; } CompletionService<Void> createReadService() { return new ExecutorCompletionService<>(stripedReadPool); } public void shutDown() { stripedReconstructionPool.shutdown(); stripedReadPool.shutdown(); } }
dennishuo/hadoop
hadoop-hdfs-project/hadoop-hdfs/src/main/java/org/apache/hadoop/hdfs/server/datanode/erasurecode/ErasureCodingWorker.java
Java
apache-2.0
6,722
//@target: ES6 function foo(...s: (symbol | number)[]) { } class SymbolIterator { next() { return { value: Symbol(), done: false }; } [Symbol.iterator]() { return this; } } class _StringIterator { next() { return { value: "", done: false }; } [Symbol.iterator]() { return this; } } foo(...new SymbolIterator, ...new _StringIterator);
Microsoft/TypeScript
tests/cases/conformance/es6/spread/iteratorSpreadInCall6.ts
TypeScript
apache-2.0
493