Mercurial > pidgin
comparison src/request.c @ 8285:d335cc7bca54
[gaim-migrate @ 9009]
Added a type hint to GaimRequestField. This will be used for neat stuff I'm
planning on.
committer: Tailor Script <tailor@pidgin.im>
author | Christian Hammond <chipx86@chipx86.com> |
---|---|
date | Wed, 18 Feb 2004 02:39:47 +0000 |
parents | fa6395637e2c |
children | 89d9d004e3f3 |
comparison
equal
deleted
inserted
replaced
8284:980b3bd976ae | 8285:d335cc7bca54 |
---|---|
271 g_free(field->id); | 271 g_free(field->id); |
272 | 272 |
273 if (field->label != NULL) | 273 if (field->label != NULL) |
274 g_free(field->label); | 274 g_free(field->label); |
275 | 275 |
276 if (field->type_hint != NULL) | |
277 g_free(field->type_hint); | |
278 | |
276 if (field->type == GAIM_REQUEST_FIELD_STRING) | 279 if (field->type == GAIM_REQUEST_FIELD_STRING) |
277 { | 280 { |
278 if (field->u.string.default_value != NULL) | 281 if (field->u.string.default_value != NULL) |
279 g_free(field->u.string.default_value); | 282 g_free(field->u.string.default_value); |
280 | 283 |
327 g_return_if_fail(field != NULL); | 330 g_return_if_fail(field != NULL); |
328 | 331 |
329 field->visible = visible; | 332 field->visible = visible; |
330 } | 333 } |
331 | 334 |
335 void | |
336 gaim_request_field_set_type_hint(GaimRequestField *field, | |
337 const char *type_hint) | |
338 { | |
339 g_return_if_fail(field != NULL); | |
340 | |
341 if (field->type_hint != NULL) | |
342 g_free(field->type_hint); | |
343 | |
344 field->type_hint = (type_hint == NULL ? NULL : g_strdup(type_hint)); | |
345 } | |
346 | |
332 GaimRequestFieldType | 347 GaimRequestFieldType |
333 gaim_request_field_get_type(const GaimRequestField *field) | 348 gaim_request_field_get_type(const GaimRequestField *field) |
334 { | 349 { |
335 g_return_val_if_fail(field != NULL, GAIM_REQUEST_FIELD_NONE); | 350 g_return_val_if_fail(field != NULL, GAIM_REQUEST_FIELD_NONE); |
336 | 351 |
357 gaim_request_field_is_visible(const GaimRequestField *field) | 372 gaim_request_field_is_visible(const GaimRequestField *field) |
358 { | 373 { |
359 g_return_val_if_fail(field != NULL, FALSE); | 374 g_return_val_if_fail(field != NULL, FALSE); |
360 | 375 |
361 return field->visible; | 376 return field->visible; |
377 } | |
378 | |
379 const char * | |
380 gaim_request_field_get_type_hint(const GaimRequestField *field) | |
381 { | |
382 g_return_val_if_fail(field != NULL, NULL); | |
383 | |
384 return field->type_hint; | |
362 } | 385 } |
363 | 386 |
364 GaimRequestField * | 387 GaimRequestField * |
365 gaim_request_field_string_new(const char *id, const char *text, | 388 gaim_request_field_string_new(const char *id, const char *text, |
366 const char *default_value, gboolean multiline) | 389 const char *default_value, gboolean multiline) |