void WaitZarInstance::loadProperties()
{
    //Add our properties to a proplist
    PropertyList proplist;
    proplist.push_back (_waitzar_encoding_prop);
    proplist.push_back (_waitzar_encoding_unicode_prop);
    proplist.push_back (_waitzar_encoding_zawgyi_prop);
    proplist.push_back (_waitzar_encoding_wininnwa_prop);

    //Now, register these properties
    register_properties(proplist);

    //Set tooltips
    _waitzar_encoding_prop.set_tip (_("The encoding of the text WaitZar outputs. Change this only if you know what you're doing."));
    _waitzar_encoding_unicode_prop.set_tip (_("The encoding as defined in Unicode 5.1 and later. The default & recommended option."));
    update_property (_waitzar_encoding_unicode_prop);
    _waitzar_encoding_zawgyi_prop.set_tip (_("The encoding used by the Zawgyi-One font, a popular font on the web which conflicts with Unicode."));
    update_property (_waitzar_encoding_zawgyi_prop);
    _waitzar_encoding_wininnwa_prop.set_tip (_("The encoding used by the Win Innwa font family (inc. Win Kalaw), a popular legacy font which conflicts with ASCII."));
    update_property (_waitzar_encoding_wininnwa_prop);

    //Finally, double-check the label... although this really shouldn't change.
    String newLbl = "";
    int encoding = model->getOutputEncoding();
    if (encoding == ENCODING_UNICODE)
	    newLbl = "UNI";
    else if (encoding == ENCODING_ZAWGYI)
	newLbl = "ZG";
    else if (encoding == ENCODING_WININNWA)
	newLbl = "WI";
    else
	newLbl = "??";
    _waitzar_encoding_prop.set_label (newLbl);
    update_property (_waitzar_encoding_prop);
}
Пример #2
0
static void
seat_properties_changed_cb (GDBusConnection *connection,
                            const gchar *sender_name,
                            const gchar *object_path,
                            const gchar *interface_name,
                            const gchar *signal_name,
                            GVariant *parameters,
                            gpointer user_data)
{
    Login1Seat *seat = user_data;
    GVariantIter *iter;
    GVariantIter *invalidated_properties;
    const gchar *name;
    GVariant *value;

    g_variant_get (parameters, "(sa{sv}as)", NULL, &iter, &invalidated_properties);
    while (g_variant_iter_loop (iter, "{&sv}", &name, &value))
        update_property (seat, name, value);
    g_variant_iter_free (iter);
    while (g_variant_iter_loop (invalidated_properties, "&s", &name))
    {
        GVariant *result;
        GError *error = NULL;

        result = g_dbus_connection_call_sync (connection,
                                              LOGIN1_SERVICE_NAME,
                                              seat->priv->path,
                                              "org.freedesktop.DBus.Properties",
                                              "Get",
                                              g_variant_new ("(ss)", "org.freedesktop.login1.Seat", name),
                                              G_VARIANT_TYPE ("(v)"),
                                              G_DBUS_CALL_FLAGS_NONE,
                                              -1,
                                              NULL,
                                              &error);
        if (error)
            g_warning ("Error updating seat property %s: %s", name, error->message);
        g_clear_error (&error);
        if (result)
        {
            g_variant_get (result, "(v)", &value);
            update_property (seat, name, value);
            g_variant_unref (value);
            g_variant_unref (result);
        }
    }
    g_variant_iter_free (invalidated_properties);
}
Пример #3
0
void
HangulInstance::change_keyboard_layout(const String &layout)
{
    String label;
    if (layout == "2") {
	label = keyboard_layout_2.get_label();
    } else if (layout == "32") {
	label = keyboard_layout_32.get_label();
    } else if (layout == "3f") {
	label = keyboard_layout_3f.get_label();
    } else if (layout == "39") {
	label = keyboard_layout_39.get_label();
    } else if (layout == "3s") {
	label = keyboard_layout_3s.get_label();
    } else if (layout == "3y") {
	label = keyboard_layout_3y.get_label();
    }

    m_factory->m_keyboard_layout = layout;
    keyboard_layout.set_label(label);
    hangul_ic_select_keyboard(m_hic, m_factory->m_keyboard_layout.c_str());

    update_property(keyboard_layout);

    m_factory->m_config->write(String(SCIM_CONFIG_LAYOUT), layout);
}
void WaitZarInstance::trigger_property (const String &property)
{
	//One of our custom buttons was pressed. Right now, that can only change the encoding.
	int currEncoding = model->getOutputEncoding();
	int newEncoding = 0;
	String newLbl = "";
	if (property == SCIM_PROP_WAITZAR_ENCODING_UNICODE) {
	    newEncoding = ENCODING_UNICODE;
	    newLbl = "UNI";
	} else if (property == SCIM_PROP_WAITZAR_ENCODING_ZAWGYI) {
	    newEncoding = ENCODING_ZAWGYI;
	    newLbl = "ZG";
	} else if (property == SCIM_PROP_WAITZAR_ENCODING_WININNWA) {
	    newEncoding = ENCODING_WININNWA;
	    newLbl = "WI";
	}

	if (newEncoding>0 && newEncoding!=currEncoding) {
	    //Update our model.
	    model->setOutputEncoding(newEncoding);

	    //Update our label
	    _waitzar_encoding_prop.set_label (newLbl);
	    update_property (_waitzar_encoding_prop);
	}

}
Пример #5
0
void GstPropertiesModule::new_property_()
{
	auto property = gui_pop<GstDebugger::PropertyValue*>("property");

	auto element = std::dynamic_pointer_cast<ElementModel>(ElementPathProcessor(property->object()).get_last_obj());
	if (!element)
	{
		return;
	}

	std::shared_ptr<GValueBase> value_base = element->get_property(property->name());
	/*std::shared_ptr<GValueEnum> value_enum = std::dynamic_pointer_cast<GValueEnum>(value_base);

	if (value_enum && controller->get_enum_type(property->value().type_name()))
	{
		value_enum->set_type(container.get_item(property->value().type_name()));
	}*/

	if (!update_property(value_base, property->name()))
	{
		append_property(value_base, property->name());
	}

	delete property;
}
Пример #6
0
    virtual PRBool OpenURI(const char* new_uri) {
        gboolean   abort_load = FALSE;
        update_property (mView, PROP_REQUESTED_URI, new_uri);
        g_signal_emit (mView, signals[URI_REQUESTED],
                       0, new_uri, &abort_load);

        return abort_load;
    }
void EditorPropertyRootMotion::_confirmed() {

	TreeItem *ti = filters->get_selected();
	if (!ti)
		return;

	NodePath path = ti->get_metadata(0);
	emit_signal("property_changed", get_edited_property(), path);
	update_property();
	filter_dialog->hide(); //may come from activated
}
Пример #8
0
void
HangulInstance::toggle_hangul_mode()
{
    m_hangul_mode = !m_hangul_mode;
    flush();

    if (m_hangul_mode) {
	hangul_mode.set_label("한");
    } else {
	hangul_mode.set_label("A");
    }

    update_property(hangul_mode);
}
Пример #9
0
void
HangulInstance::toggle_hanja_mode()
{
    m_factory->m_hanja_mode = !m_factory->m_hanja_mode;

    if (m_factory->m_hanja_mode) {
	hanja_mode.set_icon(SCIM_HANGUL_ICON_ON);
    } else {
	hanja_mode.set_icon(SCIM_HANGUL_ICON_OFF);
    }

    update_property(hanja_mode);

    m_factory->m_config->write(String(SCIM_CONFIG_HANJA_MODE), m_factory->m_hanja_mode);
}
Пример #10
0
bool check_cable_status(void)
{
	if(g_chip)
		update_property(g_chip);

	check_cable_status_fusb302();
	if(g_chip){
		if(g_chip->attach && g_chip->cable_type == CABLE_TYPE_UART){
			return true;
		}else{
			return false;
		}
	}
	return false;
}
Пример #11
0
static irqreturn_t tsu6721_muic_func(int irq, void *dev)
{
	struct muic_data *chip = dev;
	int int1=0,int2=0;
	int dev1=0;
	int dev3=0;
	int ret=0;

	mutex_lock(&chip->muic_mutex);
	//ret = tsu6721_muic_mask_int(chip,true);
	ret = regmap_read(chip->regmap,INTERRUPT1,&int1);
	ret = regmap_read(chip->regmap,INTERRUPT2,&int2);
	ret = regmap_read(chip->regmap,DEVICE_TYPE1,&dev1);
	ret = regmap_read(chip->regmap,DEVICE_TYPE3,&dev3);
	//ret = tsu6721_muic_mask_int(chip,false);
	//pr_info(TAG"%s int1 = 0x%2x,int2 = 0x%2x, dev1 = 0x%2x, dev3 = 0x%2x\n",__func__,int1,int2,dev1,dev3);
	if(int1 & (1<<0)){
		chip->attach = true;
	}
	if((int1 & (1<<1) )){
		chip->attach = false;
	}

	if(irq==0 && dev1)
		chip->attach = true;
	if(chip->attach){
		if(dev1 & (1<<3)){
			chip->cable_type = CABLE_TYPE_UART;
		}else if(dev1 & (1<<2)){
			chip->cable_type = CABLE_TYPE_USB;
		}else if(dev3 &(1<<2)){
			chip->cable_type = CABLE_TYPE_NON_STANDARD;
		}else{
			chip->cable_type = CABLE_TYPE_NONE;
		}
	}
	mutex_unlock(&chip->muic_mutex);
	update_property(chip);
	return IRQ_HANDLED;
}
BWIPP* bwipp_load_from_file(const char *filename) {

	FILE *f;

	BWIPP *ctx=malloc(sizeof(BWIPP));

	ResourceList *curr=NULL;
	Resource *resource=NULL;
	char buf[MAX_LINE];
	char *code=NULL;
	bool skip=true;

	ctx->version=NULL;
	ctx->resourcelist=NULL;
	ctx->numresources=0;

	f=fopen(filename, "r");
	if (f==NULL)
		goto error;
	code=malloc(MAX_CODE * sizeof(char));
	while (fgets(buf, sizeof buf, f)!=NULL) {
		if (skip) {
			if (strcmp(buf,"% --BEGIN TEMPLATE--\n")==0)
				skip=false;
			if (strncmp(buf,"% Barcode Writer in Pure PostScript",35)==0) {
				char *version, *p;
				if (ctx->version!=NULL) goto error;
				p=strrchr(buf,' ');
				version=p+1;
				p=strchr(version,'\n');
				*p=0;
				ctx->version=strdup(version);
			}
			continue;
		}
		if (strcmp(buf,"% --END TEMPLATE--\n")==0) {
			break;
		}

		/* % --BEGIN {TYPE} {NAME}-- */
		if (strncmp(buf,"% --BEGIN ",10)==0) {
			char *type, *name, *p;
			if (resource!=NULL) goto error;
			type=buf+10;
			p=strchr(type,' ');
			*p=0;
			name=p+1;
			p=strrchr(name,'-');
			*(p-1)=0;
			resource=malloc(sizeof(Resource));
			resource->type=dupstr(type);
			resource->name=dupstr(name);
			resource->reqs=NULL;
			resource->numprops=0;
			resource->props=NULL;
			resource->code=NULL;
			code[0]='\0';
			continue;
		}  /* BEGIN */

		/* % --REQUIRES {REQS}-- */
		if (strncmp(buf,"% --REQUIRES ",13)==0) {
			char *reqs, *p;
			if (resource==NULL || resource->reqs!=NULL)
				goto error;
			reqs=buf+13;
			p=strrchr(reqs,'-');
			*(p-1)=0;
			resource->reqs=dupstr(reqs);
			continue;
		}  /* REQUIRES */

		/* % --PROP: {PROPERTY} */
		if (strncmp(buf,"% --",4)==0 && strlen(buf)>=9 &&
				*(buf+8)==':') {
			char *key, *val, *p;
			key=buf+4;
			p=buf+8;
			*p=0;
			val=buf+9;
			p=strchr(val,'\n');
			*p=0;
			update_property(resource,key,val+1);
                        continue;                                      
                } /* PROP */           

		/* % --END {TYPE} {NAME}-- */
		if (strncmp(buf,"% --END ",8)==0) {
			char *type, *name, *p;
			if (resource==NULL)
				goto error;
			type=buf+8;
			p=strchr(type,' ');
			*p=0;
			name=p+1;
			p=strrchr(name,'-');
			*(p-1)=0;
			if (strcmp(resource->type,type)!=0)
				goto error;
			if (strcmp(resource->name,name)!=0)
				goto error;
			resource->code=dupstr(code);
			code[0]='\0';

			/* Add to ResourceList */
			if (ctx->resourcelist==NULL) {
				ctx->resourcelist=malloc(sizeof(ResourceList));
				ctx->resourcelist->entry=resource;
				ctx->resourcelist->next=NULL;
				curr=ctx->resourcelist;
			} else {
				ResourceList *tmp=malloc(sizeof(ResourceList));
				tmp->entry=resource;
				tmp->next=NULL;
				curr->next=tmp;
				curr=tmp;
			}

			resource=NULL;
			ctx->numresources++;
			continue;
		}  /* END */

		/* PS Code */
		if (resource) {
			strcat(code,buf);
                }

	}
	fclose(f);
	free(code);
	return ctx;

error:
	if (resource!=NULL) {
		if (resource->type!=NULL) free(resource->type);
		if (resource->name!=NULL) free(resource->name);
		if (resource->reqs!=NULL) free(resource->reqs);
		if (resource->code!=NULL) free(resource->code);
		if (resource->props!=NULL)
			free_propertylist(curr->entry->props);
	}
	if (code!=NULL)	free(code);
	bwipp_unload(ctx);
	return NULL;

}
Пример #13
0
 virtual void LocationChanged(const char *new_uri) {
     update_property (mView, PROP_LOCATION, new_uri);
     g_signal_emit (mView, signals[LOCATION_CHANGED],
                    0, new_uri);
 }
Пример #14
0
 virtual void StatusChanged(const char *new_status, PRUint32 flags) {
     update_property (mView, PROP_STATUS, new_status);
     g_signal_emit (mView, signals[STATUS_CHANGED],
                    0, new_status);
 }
Пример #15
0
 virtual void SetTitle(const char *new_title) {
     update_property (mView, PROP_TITLE, new_title);
     g_signal_emit (mView, signals[TITLE_CHANGED],
                    0, new_title);
 }
Пример #16
0
void
FilterInstanceBase::filter_update_property (const Property &property)
{
    update_property (property);
}
static void
on_localed_properties_changed (GDBusProxy   *proxy,
                               GVariant     *changed_properties,
                               const gchar **invalidated_properties,
                               GtkBuilder   *dialog)
{
        GVariant *v;
        GtkWidget *label;
        const char *layout;
        char **layouts;
        GString *disp;
        guint i;

        if (invalidated_properties != NULL) {
                guint i;
                for (i = 0; invalidated_properties[i] != NULL; i++) {
                        if (g_str_equal (invalidated_properties[i], "Locale"))
                                update_property (proxy, "Locale");
                        else if (g_str_equal (invalidated_properties[i], "X11Layout"))
                                update_property (proxy, "X11Layout");
                }
        }

        v = g_dbus_proxy_get_cached_property (proxy, "Locale");
        if (v) {
                const gchar **strv;
                gsize len;
                gint i;
                const gchar *lang, *messages, *time;
                gchar *name;
                GtkWidget *label;

                strv = g_variant_get_strv (v, &len);

                lang = messages = time = NULL;
                for (i = 0; strv[i]; i++) {
                        if (g_str_has_prefix (strv[i], "LANG=")) {
                                lang = strv[i] + strlen ("LANG=");
                        }
                        else if (g_str_has_prefix (strv[i], "LC_MESSAGES=")) {
                                messages = strv[i] + strlen ("LC_MESSAGES=");
                        }
                        else if (g_str_has_prefix (strv[i], "LC_TIME=")) {
                                time = strv[i] + strlen ("LC_TIME=");
                        }
                }
                if (!messages) {
                        messages = lang;
                }
                if (!time) {
                        time = lang;
                }

                if (messages) {
                        name = gdm_get_language_from_name (messages, NULL);
                        label = WID ("system_display_language");
                        gtk_label_set_text (GTK_LABEL (label), name);
                        g_free (name);
                        g_object_set_data_full (G_OBJECT (label), "language", g_strdup (lang), g_free);
                }

                if (time) {
                        name = gdm_get_region_from_name (time, NULL);
                        label = WID ("system_format");
                        gtk_label_set_text (GTK_LABEL (label), name);
                        g_free (name);
                        g_object_set_data_full (G_OBJECT (label), "region", g_strdup (time), g_free);
                }
                g_variant_unref (v);
        }

        label = WID ("system_input_source");
        v = g_dbus_proxy_get_cached_property (proxy, "X11Layout");
        if (v) {
                layout = g_variant_get_string (v, NULL);
                g_object_set_data_full (G_OBJECT (label), "input_source", g_strdup (layout), g_free);
	} else {
                g_object_set_data_full (G_OBJECT (label), "input_source", NULL, g_free);
                update_copy_button (dialog);
                return;
        }

	disp = g_string_new ("");
	layouts = g_strsplit (layout, ",", -1);
	for (i = 0; layouts[i]; i++) {
		gchar *utf_visible;

		utf_visible = xkb_layout_description_utf8 (layouts[i]);
		if (disp->str[0] != '\0')
			disp = g_string_append (disp, ", ");
		disp = g_string_append (disp, utf_visible ? utf_visible : layouts[i]);
		g_free (utf_visible);
	}
        gtk_label_set_text (GTK_LABEL (label), disp->str);
        g_string_free (disp, TRUE);

        g_variant_unref (v);

        update_copy_button (dialog);
}
Пример #18
0
/* The c++ function for: main(lp:list[string]) [NEW_ALLOC+BAG_UPDATE+SLOT_UPDATE+STRING_UPDATE] */
void  main_list(list *lp)
{ GC_BIND;
  { ClaireBoolean * rCode = CTRUE;
    char * _Zcm = copy_string("");
    char * _Zcf = copy_string("");
    int  dblevel = 1;
    char * _Zout = copy_string("");
    char * _Zcj = copy_string("");
    int  slevel = 0;
    int  clevel = 1;
    ClaireBoolean * _Zinit_ask = CTRUE;
    int  vlevel = 2;
    list * l = ((list *) copy_bag(lp));
    { ClaireHandler c_handle = ClaireHandler();
      if ERROR_IN 
      { { (Reader._starfs_star->value= _string_(copy_string("\\")));
          (OBJECT(Generate_producer,Generate.PRODUCER->value)->extension = copy_string(".cpp"));
          update_property(Optimize.libraries_dir,
            Optimize.compiler,
            17,
            Kernel._object,
            _oid_(list::alloc(Kernel._any,3,_string_(copy_string("c:\\claire\\v3.3\\bin\\public\\ntv")),
              _string_(copy_string("c:\\claire\\v3.3\\bin\\debug\\ntv")),
              _string_(copy_string("c:\\claire\\v3.3\\bin\\public\\ntv")))));
          (Optimize.compiler->headers_dir = copy_string("c:\\claire\\v3.3\\bin\\include"));
          update_property(Optimize.options,
            Optimize.compiler,
            19,
            Kernel._object,
            _oid_(list::alloc(Kernel._any,3,_string_(copy_string("-c /O2 /Oi")),
              _string_(copy_string("-c /Zi")),
              _string_(copy_string("-c /Zi")))));
          (Optimize.compiler->env = copy_string("ntv"));
          (Optimize.claire_lib->value= _string_(copy_string("")));
          { while ((l->length != 0))
            { if ((equal((*(l))[1],_string_(copy_string("?"))) == CTRUE) || 
                  (equal((*(l))[1],_string_(copy_string("-help"))) == CTRUE))
               printHelp_void();
              else if (equal((*(l))[1],_string_(copy_string("-s"))) == CTRUE)
               { if (3 <= l->length)
                 l= skip_list(l,3);
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -s <s1> <s2>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-f"))) == CTRUE)
               { if (2 <= l->length)
                 { load_string(string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -f <filename>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-env"))) == CTRUE)
               { if (2 <= l->length)
                 { (Optimize.compiler->env = string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -env <OS name>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-m"))) == CTRUE)
               { if (2 <= l->length)
                 { if (_Zinit_ask == CTRUE)
                   { load_string(copy_string("init"));
                    _Zinit_ask= CFALSE;
                    } 
                  { module * m = string2module_string(string_v((*(l))[2]));
                    load_module(m);
                    begin_module(m);
                    l= skip_list(l,2);
                    (Optimize.claire_modules->value= _oid_(OBJECT(list,Optimize.claire_modules->value)->addFast(_oid_(m))));
                    } 
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -m <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-v"))) == CTRUE)
               { if (2 <= l->length)
                 { vlevel= (vlevel+integer_I_string(string_v((*(l))[2])));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -v <integer>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-ld"))) == CTRUE)
               { if (2 <= l->length)
                 { (Optimize.claire_lib->value= (*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -od <directory>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-od"))) == CTRUE)
               { if (2 <= l->length)
                 { (Optimize.compiler->source = string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -od <directory>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-os"))) == CTRUE)
               { if (2 <= l->length)
                 { slevel= integer_I_string(string_v((*(l))[2]));
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -ol <int>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-S"))) == CTRUE)
               { if (2 <= l->length)
                 { (CLREAD(global_variable,new_class2(Core._global_variable,symbol_I_string2(string_v((*(l))[2]))),value) = Kernel.ctrue);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -S <FLAG>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-o"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zout= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -o <name>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-p"))) == CTRUE)
               { (Optimize.OPT->profile_ask = CTRUE);
                dblevel= ((dblevel <= 1) ?
                  1 :
                  dblevel );
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-D"))) == CTRUE)
               { dblevel= 0;
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-safe"))) == CTRUE)
               { (Optimize.compiler->safety = ((dblevel == 0) ?
                  0 :
                  1 ));
                (Optimize.claire_lib->value= (*(Optimize.compiler->libraries_dir))[2]);
                (Optimize.claire_options->value= (*(Optimize.compiler->options))[2]);
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-O"))) == CTRUE)
               { (Optimize.compiler->optimize_ask = CTRUE);
                dblevel= 2;
                l= skip_list(l,1);
                } 
              else if (equal((*(l))[1],_string_(copy_string("-l"))) == CTRUE)
               { if (2 <= l->length)
                 { Optimize.compiler->libraries->addFast((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -l <library>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cl"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcm= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cm <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cc"))) == CTRUE)
               { if (2 <= l->length)
                 { clevel= 0;
                  _Zcm= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cc <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cm"))) == CTRUE)
               { if (2 <= l->length)
                 { clevel= 2;
                  _Zcm= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cl <module>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-cj"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcj= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  } 
                } 
              else if (equal((*(l))[1],_string_(copy_string("-cjx"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcj= string_v((*(l))[2]);
                  clevel= 0;
                  l= skip_list(l,2);
                  } 
                } 
              else if (equal((*(l))[1],_string_(copy_string("-cx"))) == CTRUE)
               { if (2 <= l->length)
                 { _Zcf= string_v((*(l))[2]);
                  l= skip_list(l,2);
                  clevel= 2;
                  } 
                else close_exception(((general_error *) (*Core._general_error)(_string_(copy_string("option: -cx <filename>")),
                    _oid_(Kernel.nil))));
                  } 
              else if (equal((*(l))[1],_string_(copy_string("-n"))) == CTRUE)
               { _Zinit_ask= CFALSE;
                l= skip_list(l,1);
                } 
              else { if (string_v((*(l))[1])[1 - 1] == '-')
                   { print_any((*(l))[1]);
                    princ_string(copy_string(" is an unvalid option\n"));
                    printHelp_void();
                    } 
                  rCode= CFALSE;
                  l= list::empty(Kernel._string);
                  } 
                } 
            } 
          if (equal_string(_Zout,copy_string("")) == CTRUE)
           { if (equal_string(_Zcm,copy_string("")) != CTRUE)
             _Zout= _Zcm;
            else if (equal_string(_Zcf,copy_string("")) != CTRUE)
             _Zout= _Zcf;
            } 
          if (_Zinit_ask == CTRUE)
           load_string(copy_string("init"));
          (Optimize.claire_options->value= (*(Optimize.compiler->options))[((dblevel == 0) ?
            2 :
            ((dblevel == 2) ?
              1 :
              3 ) )]);
          if (equal(Optimize.claire_lib->value,_string_(copy_string(""))) == CTRUE)
           (Optimize.claire_lib->value= (*(Optimize.compiler->libraries_dir))[((dblevel == 0) ?
            2 :
            ((dblevel == 2) ?
              1 :
              3 ) )]);
          (ClEnv->verbose = vlevel);
          if (slevel > 0)
           (Optimize.compiler->safety = slevel);
          if (equal_string(_Zcm,copy_string("")) != CTRUE)
           { module * m = string2module_string(_Zcm);
            (Optimize.compiler->active_ask = CTRUE);
            if (equal(_oid_(m->uses),_oid_(list::alloc(1,GC_OID((*(OBJECT(bag,Optimize.claire_modules->value)))[2])))) == CTRUE)
             { (Optimize.claire_modules->value= _oid_(shrink_list(OBJECT(bag,Optimize.claire_modules->value),2)));
              tformat_string(copy_string("=== Light Module ~S:~S -> use ~S=== "),0,list::alloc(3,_oid_(m),
                GC_OID(_oid_(m->uses)),
                GC_OID(Optimize.claire_modules->value)));
              } 
            (Optimize.claire_modules->value= _oid_(OBJECT(list,Optimize.claire_modules->value)->addFast(_oid_(m))));
            (*Reader.load)(value_string(copy_string("Compile")));
            if (equal_string(_Zout,copy_string("")) != CTRUE)
             (m->external = _Zout);
            load_module(m);
            if (dblevel < 1)
             { (Optimize.compiler->safety = ((Optimize.compiler->safety <= 4) ?
                Optimize.compiler->safety :
                4 ));
              Optimize.compiler->debug_ask->addFast(_oid_(m));
              } 
            compile_module(m);
            if (clevel == 1)
             { if (equal_string(_Zout,copy_string("")) != CTRUE)
               (m->external = _Zout);
              cmakefile_any(_oid_(m),copy_string(""));
              } 
            else if (clevel == 2)
             cmakefile_any(_oid_(m),_Zout);
            CL_exit(0);
            } 
          else if (equal_string(_Zcj,copy_string("")) != CTRUE)
           (*Core.call)(value_string(copy_string("jcmakefile")),
            _oid_(string2module_string(_Zcj)),
            _string_(_Zout),
            _oid_(equal(clevel,0)));
          else if (equal_string(_Zcf,copy_string("")) != CTRUE)
           { (Optimize.compiler->active_ask = CTRUE);
            (*Reader.load)(value_string(copy_string("Compile")));
            load_string(_Zcf);
            function_compile_string(_Zcf,_Zcf);
            cmakefile_any(_string_(_Zcf),_Zout);
            CL_exit(0);
            } 
          } 
        ClEnv->cHandle--;} 
      else if (belong_to(_oid_(ClEnv->exception_I),_oid_(Kernel._any)) == CTRUE)
      { c_handle.catchIt();{ restore_state_meta_reader(Reader.reader);
          debug_if_possible_void();
          } 
        } 
      else PREVIOUS_HANDLER;} 
    } 
void EditorPropertyRootMotion::_node_clear() {

	emit_signal("property_changed", get_edited_property(), NodePath());
	update_property();
}
Пример #20
0
bool
SocketInstance::do_transaction (Transaction &trans, bool &ret)
{
    int cmd = -1;
    bool cont = false;

    ret = false;

    SCIM_DEBUG_IMENGINE(2) << " Do transaction:\n";

    if (trans.get_command (cmd) && cmd == SCIM_TRANS_CMD_REPLY) {
        while (trans.get_command (cmd)) {
            switch (cmd) {
                case SCIM_TRANS_CMD_SHOW_PREEDIT_STRING:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  show_preedit_string ()\n";
                    show_preedit_string ();
                    break;
                }
                case SCIM_TRANS_CMD_SHOW_AUX_STRING:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  show_aux_string ()\n";
                    show_aux_string ();
                    break;
                }
                case SCIM_TRANS_CMD_SHOW_LOOKUP_TABLE:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  show_lookup_table ()\n";
                    show_lookup_table ();
                    break;
                }
                case SCIM_TRANS_CMD_HIDE_PREEDIT_STRING:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  hide_preedit_string ()\n";
                    hide_preedit_string ();
                    break;
                }
                case SCIM_TRANS_CMD_HIDE_AUX_STRING:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  hide_aux_string ()\n";
                    hide_aux_string ();
                    break;
                }
                case SCIM_TRANS_CMD_HIDE_LOOKUP_TABLE:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  hide_lookup_table ()\n";
                    hide_lookup_table ();
                    break;
                }
                case SCIM_TRANS_CMD_UPDATE_PREEDIT_CARET:
                {
                    uint32 caret;
                    if (trans.get_data (caret)) {
                        SCIM_DEBUG_IMENGINE(3) << "  update_preedit_caret (" << caret << ")\n";
                        update_preedit_caret (caret);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_UPDATE_PREEDIT_STRING:
                {
                    WideString str;
                    AttributeList attrs;
                    if (trans.get_data (str) && trans.get_data (attrs)) {
                        SCIM_DEBUG_IMENGINE(3) << "  update_preedit_string ()\n";
                        update_preedit_string (str, attrs);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_UPDATE_AUX_STRING:
                {
                    WideString str;
                    AttributeList attrs;
                    if (trans.get_data (str) && trans.get_data (attrs)) {
                        SCIM_DEBUG_IMENGINE(3) << "  update_aux_string ()\n";
                        update_aux_string (str, attrs);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_UPDATE_LOOKUP_TABLE:
                {
                    CommonLookupTable table;
                    if (trans.get_data (table)) {
                        SCIM_DEBUG_IMENGINE(3) << "  update_lookup_table ()\n";
                        update_lookup_table (table);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_COMMIT_STRING:
                {
                    WideString str;
                    if (trans.get_data (str)) {
                        SCIM_DEBUG_IMENGINE(3) << "  commit_string ()\n";
                        commit_string (str);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_FORWARD_KEY_EVENT:
                {
                    KeyEvent key;
                    if (trans.get_data (key)) {
                        SCIM_DEBUG_IMENGINE(3) << "  forward_key_event ()\n";
                        forward_key_event (key);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_REGISTER_PROPERTIES:
                {
                    PropertyList proplist;
                    if (trans.get_data (proplist)) {
                        SCIM_DEBUG_IMENGINE(3) << "  register_properties ()\n";

                        // Load icon files of these properties from remote SocketFrontEnd.
                        for (PropertyList::iterator it = proplist.begin (); it != proplist.end (); ++it)
                            it->set_icon (global->load_icon (it->get_icon ()));

                        register_properties (proplist);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_UPDATE_PROPERTY:
                {
                    Property prop;
                    if (trans.get_data (prop)) {
                        SCIM_DEBUG_IMENGINE(3) << "  update_property ()\n";

                        // Load the icon file of this property from remote SocketFrontEnd.
                        prop.set_icon (global->load_icon (prop.get_icon ()));

                        update_property (prop);
                    }
                    break;
                }
                case SCIM_TRANS_CMD_BEEP:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  beep ()\n";
                    beep ();
                    break;
                }
                case SCIM_TRANS_CMD_START_HELPER:
                {
                    String helper_uuid;
                    if (trans.get_data (helper_uuid)) {
                        SCIM_DEBUG_IMENGINE(3) << "  start_helper (" << helper_uuid << ")\n";
                        start_helper (helper_uuid);
                    }
                    break; 
                }
                case SCIM_TRANS_CMD_STOP_HELPER:
                {
                    String helper_uuid;
                    if (trans.get_data (helper_uuid)) {
                        SCIM_DEBUG_IMENGINE(3) << "  stop_helper (" << helper_uuid << ")\n";
                        stop_helper (helper_uuid);
                    }
                    break; 
                }
                case SCIM_TRANS_CMD_SEND_HELPER_EVENT:
                {
                    String helper_uuid;
                    Transaction temp_trans;
                    if (trans.get_data (helper_uuid) && trans.get_data (temp_trans)) {
                        SCIM_DEBUG_IMENGINE(3) << "  send_helper_event (" << helper_uuid << ")\n";
                        send_helper_event (helper_uuid, temp_trans);
                    }
                    break; 
                }
                case SCIM_TRANS_CMD_OK:
                {
                    SCIM_DEBUG_IMENGINE(3) << "  ret = true\n";
                    ret = true;
                    break;
                }
                case SCIM_TRANS_CMD_GET_SURROUNDING_TEXT:
                {
                    WideString text;
                    int cursor;
                    uint32 maxlen_before;
                    uint32 maxlen_after;
                    Transaction temp_trans;
                    if (trans.get_data (maxlen_before) && trans.get_data (maxlen_after)) {
                        global->init_transaction (temp_trans);
                        if (get_surrounding_text (text, cursor, (int) maxlen_before, (int) maxlen_after)) {
                            temp_trans.put_command (SCIM_TRANS_CMD_GET_SURROUNDING_TEXT);
                            temp_trans.put_data (text);
                            temp_trans.put_data ((uint32) cursor);
                        } else {
                            temp_trans.put_command (SCIM_TRANS_CMD_FAIL);
                        }
                        global->send_transaction (temp_trans);
                    }
                    cont = true;
                    break;
                }
                case SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT:
                {
                    uint32 offset;
                    uint32 len;
                    Transaction temp_trans;
                    if (trans.get_data (offset) && trans.get_data (len)) {
                        global->init_transaction (temp_trans);
                        if (delete_surrounding_text ((int) offset, (int) len)) {
                            temp_trans.put_command (SCIM_TRANS_CMD_DELETE_SURROUNDING_TEXT);
                            temp_trans.put_command (SCIM_TRANS_CMD_OK);
                        } else {
                            temp_trans.put_command (SCIM_TRANS_CMD_FAIL);
                        }
                        global->send_transaction (temp_trans);
                    }
                    cont = true;
                    break;
                }
                default:
                    SCIM_DEBUG_IMENGINE(3) << "  Strange cmd: " << cmd << "\n";;
            }
        }
    } else {
        SCIM_DEBUG_IMENGINE(3) << "  Failed to get cmd: " << cmd << "\n";
    }

    SCIM_DEBUG_IMENGINE(2) << " End of Do transaction\n";

    return cont;
}
Пример #21
0
/**
 * update_drconf_node
 * @brief update the ibm,dynamic-memory property for added/removed memory
 *
 * @param lmb pointer to updated lmb
 * @param lmb_list pointer to all lmbs
 * @param action ADD or REMOVE
 * @returns 0 on success, !0 on failure
 */
static int
update_drconf_node(struct dr_node *lmb, struct lmb_list_head *lmb_list,
		   int action)
{
	char *prop_buf;
	size_t prop_buf_sz;
	char *tmp;
	struct drconf_mem *drmem;
	uint phandle;
	int i, entries;
	int rc;

	/* The first int of the buffer is the number of entries */
	entries = *(int *)lmb_list->drconf_buf;

	/* convert for LE systems */
	entries = be32toh(entries);

	drmem = (struct drconf_mem *)(lmb_list->drconf_buf + sizeof(entries));

	for (i = 0; i < entries; i++) {

		if (be32toh(drmem->drc_index) != lmb->drc_index) {
			drmem++;
			continue;
		}

		if (action == ADD) {
			drmem->flags |= be32toh(DRMEM_ASSIGNED);
			update_drconf_affinity(lmb, drmem);
		} else {
			drmem->flags &= be32toh(~DRMEM_ASSIGNED);
		}

		break;
	}

	/* Now create the buffer we pass to the kernel to have this
	 * property updated.  This buffer has the format
	 * "update_property <phandle> ibm,dynamic-memory <prop_len> <prop> \
	 * [strlen("remove") | strlen("add")] <drc_index> "
	 *
	 * The simple collapsing of all strings, spaces, and ints makes this
	 * a length of 61 + the size of the drconf property, round the
	 * calculation to 128 + <property_size> to ensure the buffer is
	 * always big enough.
	 */
	prop_buf_sz = 128 + lmb_list->drconf_buf_sz;
	prop_buf = zalloc(prop_buf_sz);
	if (prop_buf == NULL)
		return -1;

	rc = get_phandle(lmb->ofdt_path, &phandle);

	if (rc) {
		say(DEBUG, "Failed to get phandle for %s under %s. (rc=%d)\n", 
				lmb->drc_name, lmb->ofdt_path, rc);
		return rc;
	}

	memset(prop_buf, 0, prop_buf_sz);
	tmp = prop_buf;
	tmp += sprintf(tmp, "update_property 0x%x ibm,dynamic-memory %d ",
		       phandle, lmb_list->drconf_buf_sz);

	memcpy(tmp, lmb_list->drconf_buf, lmb_list->drconf_buf_sz);
	tmp += lmb_list->drconf_buf_sz;

	tmp += sprintf(tmp, " %s %" PRId64 " ",
		       (action == ADD ? "add" : "remove"),
		       sizeof(lmb->lmb_address));
	memcpy(tmp, &lmb->lmb_address, sizeof(lmb->lmb_address));
	tmp += sizeof(lmb->lmb_address);

	rc = update_property(prop_buf, (tmp - prop_buf));

	free(prop_buf);
	return rc;
}